-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
I have a listbox and a panel. when user selects any item into the listbox the panel renders the data according to the selection.
On page load first item of the listbox is selected and in panel data renders for the first item.
It was all working properly until I upgraded ZK version from 5.0.5 to 5.0.6.
The problem is now(with 5.0.6) on page load panel does not render data for first item selected in the listbox. if I select any item manually it works fine.
I checked that onSelect event is being fired at the right time(when page loads) but data is not coming into the panel.
Please help if any one have idea about it
Thanks
Abhinav
Hi
It seems like a bug
plz follow this thread
you can try the workaround:
<hbox id="hbox"> ..... detailPanel.detach(); Include include = new Include(); include.setSrc("detal.zul"); hbox.appendChild(include); .........
Hi Maik,
Thanks for your reply. I am sorry for my late reply, actually I was stuck badly somewhere.
I reproduce my problem. please see the code. I have 2 zul files. I tested below code with 5.0.5 and it worked as expected but did not work with 5.0.6
main zul
<zk> <window title="Hello World!!" border="normal" width="100%" id="win" apply="com.TestPanel"> <hbox> <listbox id="listbox" width="40%"><attribute name="onSelect"><![CDATA[ desktopScope.put("key", self.getSelectedItem().getLastChild().getLabel()); detailPanel.invalidate(); ]]></attribute> <attribute name="onCreate"> self.setSelectedIndex(0); org.zkoss.zk.ui.event.Events.postEvent("onSelect", self, ""); detailPanel.invalidate(); </attribute> <listhead> <listheader label="Author" sort="auto" /> <listheader label="Title" sort="auto" /> <listheader label="Publisher" sort="auto" /> <listheader label="Hardcover" sort="auto" /> </listhead> <listitem> <listcell label="Philip Hensher" /> <listcell label="The Northern Clemency" /> <listcell label="Knopf (October 30, 2008)" /> <listcell label="608 pages" /> </listitem> <listitem> <listcell label="Philip Hensher" /> <listcell label="The Fit" /> <listcell label="HarperPerennial (April 4, 2005)" /> <listcell label="240 pages" /> </listitem> <listitem> <listcell label="Philip Hensher" /> <listcell label="Kitchen Venom" /> <listcell label="Flamingo (May 19, 2003)" /> <listcell label="336 pages" /> </listitem> </listbox> <include src="detail.zul" id="detailPanel" vflex="true" widht="50%"/> </hbox> </window> </zk>
detail zul
<zk> <zscript> String x = (String) desktopScope.get("key"); System.out.println("detail " + x); </zscript> <vbox> <label value="area below this message should be udpated as soon as page loads. same as clicking on listitem "> </label> <label value="${x}" style="align: left;"> </label> </vbox> </zk>
seems a bug in 5.0.6. please help anyone have any idea about it
Thanks,
Abhinav
Hi,
can you post a self-contained simple example which shows the problem?
Cheers, Maik
Asked: 2011-03-11 03:29:32 +0800
Seen: 399 times
Last updated: May 23 '11