Thank you.
~bob
Hmm... it works for me, but it's once again possible I sent you some code before it was quite ready for showtime :-)
I changed the way lists work to actually store list items rather than using only key and value pairs for value and text to make things more consistent for all types of lists. So now DropDownList/ListBox/RadioButtonList all use the exact same item container mechanism.
In the process of that change some of hte rendering logic changed. It's an easy fix once again. I apologize, but it's one of those things when you work with unreleased code.
Here's the update in wwWebListControl::Render():
*** add any items manually added FOR lnX = 1 TO THIS.Items.Count loItem = this.Items.aItems(lnX,2) lcText = loItem.Text lcValue = loItem.Vaue IF VARTYPE(lcValue) # "C" lcValue = lcText ENDIF IF llSingleMode IF this.SelectedValue == lcValue lcOutput = lcOutput + [<option value="] + this.WriteEncodedAttributeString(lcValue) + [" selected="selected">] + lcText + [</option>] + CRLF ELSE lcOutput = lcOutput + [<option value="] + this.WriteEncodedAttributeString(lcValue) + [">] + lcText + [</option>] + CRLF ENDIF ELSE IF "|" + lcValue + "|" $ lcSelectedValues lcOutput = lcOutput + [<option value="] + this.WriteEncodedAttributeString(lcValue) + [" selected="selected">] + lcText + [</option>] + CRLF ELSE lcOutput = lcOutput + [<option value="] + this.WriteEncodedAttributeString(lcValue) + [">] + lcText + [</option>] + CRLF ENDIF ENDIF ENDFOR
Previously this code just retrieve value/string directly instead of the item.
Hope this helps,
+++ Rick ---
+++ Rick ---
Rick,
After updating the server with the new Dispose() and Clear() magic, a client informed me a dropdown that was displaying text options is now only showing the numeric values. Perhaps this is a coincidental timing, but I know this was working as expected two days ago.
Here is the script.
<ww:wwWebDropDownList ID="cboUPSModel" runat="server"> <asp:ListItem Value="1">test1</asp:ListItem> <asp:ListItem Value="2">test2</asp:ListItem> </ww:wwWebDropDownList>
And what was generated.
<select autocomplete="on" id="cboUPSModel" name="cboUPSModel" size="1"> <option value="1">1</option> <option value="2">2</option> </select>
I also populated the values in the code behind, but had the same result. No text in the dropdown.
I seem to remember something about some sort of idiosyncrasy in dropdowns long ago, but could not find anything here in the archives.
~bob