Focal Point
Chained Comboboxes - setting defaults ....

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9341020092

July 01, 2008, 02:33 AM
Pete
Chained Comboboxes - setting defaults ....
Hi All,

I've been exploring how to chain comboboxes via the xml/pchold method, and all the examples on here have been a great help.

Let's say that i have 3 chained combo's

- Country
- Car
- Model

Normal behavior is that when country is changed car and model are populated with those items that belong to the choosen country

But how can i do :

When Model is changed , i would like to see that car and country are set to the defaults to which model belongs

ex.

when the model is changed to value V12XKE AUTO
Country should be put on default Engeland
Car should be put on default Jaguar

How should i go about this?

P.


D: WF 7.6.2 P. : WF 7.6.2 on W2003
------------------------------------------------------------------
I see myself as an intelligent, sensitive human, with the soul of a clown which forces me to blow it at the most important moments.

-Jim Morrison-

July 01, 2008, 05:44 AM
Tony A
Pete,

You are talking reverse chaining which you would have to code completely yourself in JavaScript unless you can utilise the existing function "populateDynamicCtrl(ctrl)" within the ibirls2.js.

You would have to ensure each of your population fexes has a variable test for each combobox that you want to utilise.

Good luck

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
July 01, 2008, 06:12 AM
Pete
Hi Tony,

But i dont want to repopulate them , just select the right parent (or doesn't that make any difference)

P.


D: WF 7.6.2 P. : WF 7.6.2 on W2003
------------------------------------------------------------------
I see myself as an intelligent, sensitive human, with the soul of a clown which forces me to blow it at the most important moments.

-Jim Morrison-

July 01, 2008, 06:59 AM
Tony A
Pete,

When your launch page loads, a sequence of JavaScript calls are made that build the contents of your chained combo boxes in the order that you chain them. When this JS is executed it replaces the onChange event call for each of your combo box(es) with a call to populate the dynamic control(s). The first combo is populated, then the second etc. This is where your requirement would fall down.

The reason being that the onChange event would be triggered everytime you made a change to a predecessor combo in your chain and the whole event would ripple through the JS again, removing any selection that your user had made in the final combo.

E.g. with no selection in the first two combos and a selection of a model in the third. You trigger the update process and locate the country relevant to your selection and apply that change to the first combo. Note: A change to the first combo. The onchange event would now be triggered and the selction in the first combo would be cascaded down through your chain, reseting the selectedindex of each subordinate combo to 0 - thus your model selection would be lost.

Hope this explains it OK.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10