Focal Point
[SOLVED] Chained combo boxes and the 'ALL' option

This topic can be found at:

August 04, 2014, 10:52 AM
[SOLVED] Chained combo boxes and the 'ALL' option
I have created an HTML page with several chained combo boxes. I have checked the box to add "ALL" option. What I would like to do is if the number of options in the drop down contains only a single value then show that value rather than 'ALL'. The number of values varies and what the values are change as the chaining is being resolved.

This message has been edited. Last edited by: Keith_Tice,

WebFOCUS 8009, All Outputs
August 04, 2014, 12:06 PM
This isn't too difficult. The easiest way I could think of would be to use the onbeforeload event on the second control to delete the "all" value if only two items exist (the "all" value and the other value). Your code might look like this:

//Begin function combobox2_ononbeforeload
function combobox2_ononbeforeload(ctrl,arrValuesToLoad) {
   if(arrValuesToLoad.length === 2) {
//End function combobox2_ononbeforeload 

WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
August 04, 2014, 03:46 PM

That works great! Thank you so much for the quick reply.

WebFOCUS 8009, All Outputs