Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Is it possible to use defaultToFirstOption for dependent selects?

    In line with the example for dependent selects (which gives an error at my browser, but I tried it with my local server and then it works), I was wondering if is possible to (and if so, how):
    • Select a default first item when the category changes. Thus defaultToFirstOption = true in the second box (item).
    • Prevent a fetch for the second box (item) as long as no category is selected. Disabling the combobox is also an option.
    My real world example is that the first select box gives an option to select a customer and the second select box a purchaser for that customer.
    Last edited by wallytax; 25 Aug 2016, 04:34.

    #2
    The defaulting from defaultToFirstOption happens once only, on the first load from the server. You could use DataArrived to make it happen any time new data is loaded.

    The only way to prevent a fetch would be to hide or disable the control.

    Comment


      #3
      Okay, just to be 100% sure: that dataArrived event should be added to the second box then? To the pickListProperties or to the item properties itself? And, I would then get a data set back and simply set the value to the first item in that data set? Perhaps, this sounds a bit silly, but I don't believe it's possible to set the selected index to 0 or something? I'm not in the position right now to test it.

      Comment

      Working...
      X