Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Multiple Drop Down Lists in Ajax Panel

Updated: 21 May 2010 | 6 comments
Shovel's picture
0 0 Votes
Login to vote

I have a collection of data that I am trying to filter within an Ajax Dynamic Update Panel Component

The first Drop down list has all of the 'Materials' in it
       The second list has all of the "Manufacturers' that make that material. So far so good!
                The third drop down list has all the 'Colors' of that Material made by the selected Manufacturer. Based on the selection in the 'Manufacturers' drop list 

The  Materials and Manufacturers drop lists have the 'Post Form on Value Change' set to True but for some reason the Color drop list is only reading off of the 'Materials' selection.
I have used a Dynamic Model to filter through the collection of items to appear on each drop list and the workflow is sound. 
Is there a limit to the number of Drop Lists that can Post the form (or Panel)? Am I losing ThisForm data when I am Posting?

I have even placed Ascii labels under each Drop list to confirm the selection after Post and sure enough the Manufacturer (second) drop list isn't populating the ASCII label.

Any ideas would be greatly appreciated!
Thanks!
Phil

Comments

yliquor's picture
20
Nov
2009
0 Votes 0
Login to vote

Are you declaring your output

Are you declaring your output variables earlier in your model, or are you using the "This Form.Data" of your varibale in your workflow to determine the colors?  I have found that with Ajax the This Form data is not reliable.  It works when you use the add new data element or Initialize Data component ahead of your form.

Shovel's picture
20
Nov
2009
0 Votes 0
Login to vote

 This Form is the second

 This Form is the second component in Dialog WorkFlow Component (first being the SQL lookup of items).
I am using the "This Form.Data" to determine the colours. 
I'm not sure how to establish variable data before the form if the variable isnt being set until you are actually in the form.

yliquor's picture
20
Nov
2009
0 Votes 0
Login to vote

Just use the Initialize Data

Just use the Initialize Data component and don't set a value for the variable.  Just make sure you set the output data on your drop down box to be the same variable name.

Shovel's picture
20
Nov
2009
0 Votes 0
Login to vote

 That seems to be more

 That seems to be more reliable now! Thank you!
One last question if I may. 
I am building a collection to populate my drop down list, but if I go back and change my selection in the first field it isn't resetting the collection. It appears to be adding to the collection. I tried clearing the collection but it says it doesn't exist yet. Any ideas? This is my first time using Dynamic models.
Thanks! 

DropDownListDynamic.jpg

yliquor's picture
20
Nov
2009
0 Votes 0
Login to vote

I would build your array with

I would build your array with an initialize variable and then use that for your Items in your drop down.  Then you can remove items from the collection and add to it, etc.

stuper2's picture
20
Nov
2009
0 Votes 0
Login to vote

Shovel

I recommend you use the Configurable Collection filter instead for filtering those collections... a lot simpler. Also, you're right, if you put a clear collection component in that model, (say, between the start and ":for each" component) it will try to clear a collection that doesn't exist yet. Try this: with your other data, initialize a Logical true/false var. called "CollectionExists." Then in the model shown in your screenshot, add an "Add new data element" just before the End component of this model and set it to logical true/false, configure it to set the "CollectionExists" variable and set it to true. Then, right after the Start comp, add a True false rule comp and set it to evaluate the variable "CollectionExists," with the true path hitting a Clear collection comp and the false path skipping it.
Make sense?