Bear Bibeault wrote:There is no valid reason to be using scriptlets for new code in 2009.
You haven't really explained what you are doing very well. If you're just making an Ajax call to get the data to populate a select element, you can just return the data as a JSON construct and have the JavaScript use it to reconstruct the select element.
OK. I've abandoned the scriptlet route and tried to utilize json.
I'm still getting the results back from the action but I can't get the desired results to appear as the options in the select.
Here's the action
When a user selects a value from the dropdown att1, I want the dropdown op1 to display the results of the ajax call. The dropdown op1 contains operators for queries (=, !=, Like, etc.) Based on the type of attribute selected in the att1 dropdown, I want valid operators to appear (so for a float selection in att1, I don't want to display LIKE, etc). I will eventually do the same for the dropdown attval1 (which will require db lookup) but that should fall into place once I get op1 working.
I assume I need to do something else around "dojo.byId("op1").innerHTML = response ; " but I don't know what.
The results I get are
{"operators":[["= ","0"],["!= ","1"],["LIKE","3"],["~","4"]],"ops":"success"}
which certainly contains the data I need, but I don't know how to get [["= ","0"],["!= ","1"],["LIKE","3"],["~","4"]] of the result into the options of my select box. Certainly there is some call I can utilize rather than manually parsing.
Thanks again for your assistance.