SelectOptionsConnector & Dependent Listbox & Form Bind



I searched the sample code source and found the example for SelectOptionsConnector in

If I understand this correctly. I can keep my html combo boxes in my form and instead of using the this connector to load it with select option.

So here the scenario. I have two Listboxes “Country” and “State”

Q1. Can I make them dependent, State is populated only if a country is selected?

I assume that by giving each their own connector and passing the county id to state and using the render_sql in the state connector I can accomplish this.

Q2. When my form loads data , if the country and state fields of my record are populated will those values be selected by the list box? can my list box be bound to the data value loaded so that it displays the corresponding value. How do i accomplish this?

This is not supported by default, it possible to catch onChange event of one select and reload another one, but it will require some custom coding.

They work the same as normal selectboxes. If you loading data in form after filling select with values. The option, which has value equal to related data property, will be selected.