Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIWComboBox + OnAsyncChange + ItemsHaveValues
#8
(12-20-2021, 11:46 AM)MJS@mjs.us Wrote: >> I think by definition ItemIndex is always a true offset in the VCL sense.

Yes, it is.  But the point is, on the browser side you have this:

<select id=IWCOMBOBOX1>
<option SELECTED="" VALUE="-1">-- No Selection --</option>
<option VALUE="1">A</option>
<option VALUE="1">B</option>
<option VALUE="1">C</option>
<option VALUE="3">D</option>
</select>

The above is the exact representation of such ComboBox and how IW renders it.

Then, when you pick any item from the list, the browser sends a request to the IW server containing the chosen *VALUE* (as long as you have an OnChange/OnAsyncChange event assigned to it, of course):

Let's say you picked the third item. Then IW will receive a request saying that IWComboBox1 selected *VALUE* is 1.

How to decide which of the "1"s above is the one that the user picked? Without testing it I'd say that IW will pick option A as the chosen value (because it looks sequentially within the list, from top to bottom, although it could also do the other way without sacrificing the correctness of the algorithm).

You see why VALUE must be unique?
Reply


Messages In This Thread
RE: TIWComboBox + OnAsyncChange + ItemsHaveValues - by Alexandre Machado - 12-20-2021, 08:18 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)