0

problem with zk 5.0.6

asked 2011-03-11 03:29:32 +0800

abhi21284 gravatar image abhi21284
30

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

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2011-05-23 05:46:49 +0800

abhi21284 gravatar image abhi21284
30

Hi Mathew,

Thanks for your help. I tried your workaround and worked for me.
FYI: I also tried 5.0.7 but seems bug is still there in newer version.

Thanks
Abhinav

link publish delete flag offensive edit

answered 2011-05-22 04:59:27 +0800

matthewgo gravatar image matthewgo
375

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);
        .........

link publish delete flag offensive edit

answered 2011-05-20 09:15:37 +0800

abhi21284 gravatar image abhi21284
30

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

link publish delete flag offensive edit

answered 2011-03-15 05:24:59 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

Hi,

can you post a self-contained simple example which shows the problem?

Cheers, Maik

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-03-11 03:29:32 +0800

Seen: 399 times

Last updated: May 23 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More