CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Search Builder with Multiple List Boxes

Print topic Send  topic

Author Message
Doug
Posted: 05/15/2004, 3:58 PM

I am trying to create a SearchForm that contains 12 list boxes. Each list box needs to be populated from the same table 'Categories". Data Elements in "Categories" is:
1. CATID <Primary Key>
2. Category <Contains Text name of Category>
3. ParentID <Contains child_ID for Categories matching CATID>

DataSource of the SearchBuilder component is the Categories table
I thought what I am trying to accomplish is easy. But I need help with the following:

I am creating 12 drop-down list boxes by adding rows to the Search Builder form, adding listbox controls (ToolBox -> Forms -> ListBox). I need each Listbox to display only records from Categories table that match a hardcoaded ParentID that I thought I define in the DATA SOURCE dialog box from within the Listbox properties.. For instance, I want to display all fruits in a dropdown. I need to filter the categories table for that particular listbox to only display records with a PARENTID of 2 (fruits) . The next Listbox needs to display only records from the categories table with a PARENTID of 3 (flowers)and so on for all 12 list boxes. Upon selection of one of the categories I have a SUBMIT FORM event firing on the ON CHANGE event. This needs to pass the PARENTID to the Grid form. (these appears to be working OK).

Any ideas on how I filter each listbox in a SearchForm against the same table each time but with different PARENTIDs? Finally, Is there a way to hid the SEARCH Button as I dont want it to display.

Any help appreciated!
Doug
Doug
Posted: 05/15/2004, 6:42 PM

:-) Ok, I answered my own question by using the DATASOURCETYPE to SQL and then just put a select/where statement in the DATASOURCE Field. SO, that is retrieveing the right records for each dropdown. But when the page with the results grid appears, I receive the following error instead of the grid displaying:
Form: Grid Products
Error: Error Executing Database Query.

My guess, when I look at the URL, is that since every listbox's value is being passed as blank except for the one list box the user selected from, that is making the query error out. Of course if I remove all of the other stuff in the URL and leave just the one listbox's result, then the grid populates fine. But that is a dynamic thing that would be different for each list box. So I do not see how Remove Parameters would work in that it is at the FORM level and I really need that capability at the control (listbox) level.

Any suggestions?

Thank you
Doug
Doug
Posted: 05/15/2004, 9:11 PM

:-D Ok, well, this has been a fun conversation with myself! ;-) Anyway, I solved this problem. Just for others edification in case anyone is interested, the problem with the error in query execution was one I hate to admit but hey, Im humble.

Anyway, quite simple actually. In the SELECT properyt (left clicking while focused on a listbox) I had placed the same text I had in the NAME field, in the VALUE field. I didnt realize until now just how this property worked. So when I removed the text in the VALUE field ("Select Item") , that apparently allowed the URL to populate correctly and all of the list boxes properly pass the correct value to the URL and the grid page lists the correct records.

All is good...

Thanks for reading!
Doug
peterr


Posts: 5971
Posted: 05/16/2004, 12:30 AM

Good to see you make progress so quickly, especially without help :-)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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