This really sucks.
We've heard that criticism of combobox before. Having used it in a variety of situations, I agree that it can be a pain (especially for dynamic data). There is usually workaround for what you want to achieve, though. The attached code uses delegates to ensure the combobox is populated before calling selectItemAt(). Pleaes note that if you refresh the dataset (or remove or append children), the delegate will fire again - though that can also be fixed.
Hope this helps! Dan
One way, selectItemAt(0) works properly but the text doesn't show, the other the text shows but selectItemAt(0) doesn't work. -----Original Message----- From: Jeff Freedman [mailto:[EMAIL PROTECTED] Sent: Friday, December 23, 2005 9:42 AM To: 'William Krick'; [email protected] Cc: [email protected] Subject: RE: [Laszlo-user] Bug? -- comboboxe dropdown list with invisible items? I think that's because the ReplicationManager hasn't finished populating the floating list yet so there's nothing to select AND the comboBox ondata event doesn't seem to fire. I've gotten around that by the following: <textlistitem datapath="listData:/results" text="$path{'@name'}" value="$path{'@id'}"> <method event="ondata"> if (this.clonenumber == 0) { parent.selectItemAt(0); } </method> </textlistitem> Perhaps one of the dev guys can fix the combobox to fire an ondata event when it's populated. Jeff -----Original Message----- From: William Krick [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 21, 2005 4:45 PM To: [EMAIL PROTECTED]; [email protected] Subject: RE: [Laszlo-user] Bug? -- comboboxe dropdown list with invisible items? That fixes the text in the list, however, now SelectItemAt(0) doesn't work. Try this example comparing both listitem and textlistitem... <?xml version="1.0" encoding="UTF-8" ?> <canvas> <dataset name="ds1" src="http://eio-online.com/symbols/getyear" request="true" ondata="cb1.selectItemAt(0)"/> <dataset name="ds2" src="http://eio-online.com/symbols/getyear" request="true" ondata="cb2.selectItemAt(0)"/> <simplelayout/> <combobox id="cb1" editable="false"> <listitem datapath="ds1:/resultset/result" text="$path{'@modelyear'}"/> </combobox> <combobox id="cb2" editable="false"> <textlistitem datapath="ds2:/resultset/result" text="$path{'@modelyear'}"/> </combobox> </canvas> -----Original Message----- From: Jeff Freedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 21, 2005 4:12 PM To: 'William Krick'; [email protected] Subject: RE: [Laszlo-user] Bug? -- comboboxe dropdown list with invisible items? William, Try using textlistitem instead of listitem. Jeff -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of William Krick Sent: Wednesday, December 21, 2005 3:36 PM To: [email protected] Subject: [Laszlo-user] Bug? -- comboboxe dropdown list with invisible items? Here's a much simpler, stripped down version of the code I posted earlier. The combobox is filled with items pulled from the web. The items are in the dropdown list but the text isn't visible for some reason. When you select one of the invisible items in the list, the combobox is filled with that item (the correct behaviour). Why are the items in the list invisible? Is this a bug or am I doing something wrong? <?xml version="1.0" encoding="UTF-8" ?> <canvas> <dataset name="ds" request="true" src="http://eio-online.com/symbols/getyear"/> <combobox editable="false"> <listitem datapath="ds:/resultset/result" text="$path{'@modelyear'}"/> </combobox> </canvas> _______________________________________________ Laszlo-user mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-user _______________________________________________ Laszlo-user mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-user
test-combobox.lzx
Description: application/lzx
_______________________________________________ Laszlo-dev mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
