Filed: http://www.openlaszlo.org/jira/browse/LPP-2048
-----Original Message----- From: Jim Grandy [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 10, 2006 1:20 PM To: William Krick Cc: Laszlo-User Subject: Re: [Laszlo-user] dynamically adding and removing tabelements from a tabslider The code looks reasonable but I see the same problems you report. I don't see why this shouldn't work. Please file a bug. On May 9, 2006, at 10:57 AM, William Krick wrote: > Before I can report a bug, I need to be sure that I've got this coded > correctly. Below is an example that illustrates what I'm trying to > do. > There's a lot of strange things happening... > > 1) The buttons on the tabelements don't show up until you "juggle" the > sliders a little. > > 2) Add a bunch of elements. Delete an element from the middle, then > expand > the first item. There is now a gap at the bottom of the container. > > 3) If you delete all the elements, then try to add a few back, the > first one > appears ok, subsequent elements expand and shoot off the screen. > > > <canvas oninit="addElement()"> > <attribute name="num" value="0"/> > > <method name="addElement"><![CDATA[ > if (canvas.num < 6) { > canvas.num++; > new mytabelement(slider, {text:('Element '+canvas.num), > selected:true}); > } > ]]></method> > > <method name="delElement" args="e"><![CDATA[ > slider.removeItem(e); > canvas.num--; > e.destroy() > ]]></method> > > <class name="mytabelement" extends="tabelement"> > <button text="delete this element" > onclick="canvas.delElement(classroot)"/> > </class> > > <view x="20" y="25"> > <simplelayout axis="y" spacing="5"/> > <button text="add another element" onclick="canvas.addElement()"/> > <tabslider id="slider" width="300" height="300"/> > </view> > > </canvas> > > > > -----Original Message----- > From: Jim Grandy [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 09, 2006 12:38 PM > To: William Krick > Cc: Laszlo-User > Subject: Re: [Laszlo-user] dynamically adding and removing tabelements > from a tabslider > > > Hi William, > > I don't know the answer to your question, but assuming you are trying > the obvious thing, please file a bug -- we should make certain it > works. > > jim > > On May 9, 2006, at 8:18 AM, William Krick wrote: > >> In my app, I'm trying to dynamically add and remove tabelements to a >> tabslider. >> >> The code to add tabelements works fine, however, when I remove >> (destroy) >> tabelements, bizarre things happen to the tabslider that makes it >> appear >> that some sort of internal bookkeeping isn't being updated properly. >> >> Does anyone have sample code that shows the correct way to >> dynamically add >> and remove tabelements? >> >> _______________________________________________ >> 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
