CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 how can i refer to the form datasource in the listbox query builder under the where clause (also, what is application?)

Print topic Send  topic

Author Message
CodeChargenewbie

Posts: 114
Posted: 03/10/2008, 7:39 AM

Two questions that may or may not be related.

Under the parameter types in query builder, there's one called Application. What is this exactly and how can I use it? I know what Form is, but I'm not sure how to reference it ($form->control->Getvalue() maybe?).

My other concern is referencing the form datasource in a listbox's query builder. I'd like to set a where condition that equates a Field from the listbox datasource to a field in the form's datasource, or even a textbox from the form itself. How can I go about this?

thank you.
View profile  Send private message
quasimidi


Posts: 151
Posted: 03/10/2008, 12:52 PM

Dear CCN,

I would do the following for your lstbox:

Create the listbox, and leave the WHERE statement empty.
Now, go back to the visual form designer, and select the listbox. On it's event's tab, select "Before Build Select" -> Add CUSTOM CODE.

In the custom code, you can modify your WHERE statement like this:
$rowid = CCGetFromGet("rowid",1);  
$form_name->Datasource->Where .=" rowid = ".$rowid;  

_________________
RS
View profile  Send private message
CodeChargenewbie

Posts: 114
Posted: 03/11/2008, 6:30 AM

Quote quasimidi:
Dear CCN,

I would do the following for your lstbox:

Create the listbox, and leave the WHERE statement empty.
Now, go back to the visual form designer, and select the listbox. On it's event's tab, select "Before Build Select" -> Add CUSTOM CODE.

In the custom code, you can modify your WHERE statement like this:
$rowid = CCGetFromGet("rowid",1);  
$form_name->Datasource->Where .=" rowid = ".$rowid;  

Thank you for the suggestion. Yes, I'm confident this solution can be readily applied in custom code. I was curious if there was a way to replicate it inside the visual query builder itself, however. If I knew what and how to apply "Application" and "Form", perhaps that could be of some service, I'm not sure.
View profile  Send private message
datadoit
Posted: 03/11/2008, 4:24 PM

CodeChargenewbie wrote:
> If I knew what and how to apply
> "Application" and "Form", perhaps that could be of some service, I'm not sure.
> ---------------------------------------

I'd love to know also. Great topic for the new wiki.
wkempees
Posted: 03/13/2008, 10:47 AM

> Under the parameter types in query builder, there's one called
> Application.
> What is this exactly and how can I use it? I know what Form is, but I'm
> not
> sure how to reference it ($form->control->Getvalue() maybe?).

Application and Form both ok, I think.
Just choose Form and in the Parameter type the name of the textbox =
yourfieldname


> My other concern is referencing the form datasource in a listbox's query
> builder. I'd like to set a where condition that equates a Field from the
> listbox datasource to a field in the form's datasource, or even a textbox
> from
> the form itself. How can I go about this?

Not very clear to me what you intend to do.
> My other concern is referencing the form datasource in a listbox's query
> builder.
as above but not sure it will work as the form is not posted yet.

> ..... I'd like to set a where condition that equates a Field from the
> listbox datasource to a field in the form's datasource, or even a textbox
> from
> the form itself.
Normaly a Listbox has a bound column, that would be available in the form.
It is this value that gets stored in a related field upon submit.

It might be the case that you are doing a update panel and as such
could/should have the value available, but normaly it would have to be
posted to be reachable.

Walter

CodeChargenewbie

Posts: 114
Posted: 03/14/2008, 11:19 AM

yes, i think i got it confused. I haven't been getting much sleep...

Thanks for the solution on The Form. appreciate it.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.