I am trying to figure out how to make a cascading dropdown (initial dropdown for type, then another dynamically loaded dropdown loaded via ajax or a partial page based on the type) inside the editable row rich composite control.
Based on some of the other threads on here adding a partial page to the repeat inside the editable table wont work as I expect, so I am wondering what is the easiest and best way to accomplish what I am trying to do.
Any Ideas?
Based on some of the other threads on here adding a partial page to the repeat inside the editable table wont work as I expect, so I am wondering what is the easiest and best way to accomplish what I am trying to do.
Any Ideas?
RE: How to make a cascading dropdown inside an editable table
Generally when doing cascading drop down type setups using partial pages is the suggested approach, but you are right that this will cause issues in repeating tables.
How fixed are you on using the editable table approach? Could you perhaps use a normal repeating table that contains an edit button in each row? You could then for example use a popup dialog on edit that contains the dropdown controls using partial pages in the normal way.
Alternatively, if you do need to use the editable table then I think you would need to look at including the second dropdown control in the page, but get it to make AJAX calls to the server to retrieve the relevant data to show when needed.
You could have a look at this thread for details on how to setup a filtering select control to call the server to get the data list: http://www.hyfinity.com/node/263
I think you could use this as a base, and then customise the calls from the client as required. For example, you would need to pass the value from the relevant type dropdown to make sure it was loading in the correct set of values for you second dropdown. According to http://dojotoolkit.org/reference-guide/1.8/dojox/data/QueryReadStore.html you can quite easily customise the QueryReadStore to control the sever query that it makes, in your case by adding in an additional parameter value to send.
Unfortunately this is not something I have done before, so cant give you exact steps, but hopefully these pointers are useful if you do decide to go down this route. Also you don+?+?+?t have to use dojo controls for this. You could decide that it is easier to just use a standard select box, and then with javascript make the call to the server to get the relevant list of options to display based on the selected type, and the just manually create the option entries needed in the second dropdown.
I hope this helps. Please let me know how you get on.
Regards,
Gerard