Dan, I implemented your workaround in my code and it seems to work fine (albeit slow) except when the combobox list only includes one item on startup.
See my attached sample code to see what I mean. It stops loading 1990 at the fifth combobox because it only has one item. As a side question, is there some way to clean up this code by factoring out a specialized combobox or textlistitem class? Not having spent any time in delegate land, I'm not sure how that would be done. ... Krick -----Original Message----- From: Dan Stowell [mailto:[EMAIL PROTECTED] Sent: Friday, December 23, 2005 5:09 PM To: William Krick; [EMAIL PROTECTED]; [email protected] Cc: [email protected] Subject: RE: [Laszlo-user] Bug? -- combobox dropdown list with invisible items? > This really sucks. We've heard that criticism of combobox before. And having had to use it several times, with and without dynamic data, I agree that it can be a pain. But there's usually a workaround for what you want to achieve. In the code below I set up delegates so that selectItemAt( 0 ) only gets called once the combobox is fully populated. By "the code below", I mean the code I've attached to this message. Hope this helps! > > 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 Dan Stowell Software Engineer Laszlo Studios
drilldown.lzx
Description: Binary data
_______________________________________________ Laszlo-user mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-user
