-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I need to create grid with detailed information about given item (like master grid in zk demo). Detailed information is available when I click 'plus sign' in the row of grid. I created initial row using java code (not zul since I need to dynamically update that grid) and have problems about detailed information (using detail tag found in grid palette). Data in detailed information should be pulled from external server when user request to see that detail (when clicking on plus sign), and detailed information is created using createcomponent function and passing needed arguments in hashmap. However I cannot update values of in created component when user expands it. I am catching that event, but I can't fill data then. I used EL expressions, but they can only fill data on beginning of component creation. If I use ID for labels it throws some kind of exception that IDs are already defined. Those IDs are perfectly unique but I create that component multiple times on page so I guess that they all have same IDs. I tried using Include tag and it works but I don't know how to pass arguments to included zul in this case.
Help will be appreciated.
Hi, ashishd
Here is the simple example that I am trying to get functional:
Test.zul (much like sample on this site)
<?page title="new page title" contentType="text/html;charset=UTF-8"?> <window> <zscript><![CDATA[ import org.zkoss.zk.ui.Executions; import java.util.*; import org.zkoss.zul.*; String[][] iterateOverMe = { {"99", "Fred Flintstone"} ,{"8", "Wilma Flintstone"} ,{"65", "Barney Rubble"} ,{"32", "Betty Rubble"} }; int row = 1; public void onCreate() { Map map = new HashMap(); String temp = String.valueOf(row++); map.put("pageId", temp); Executions.createComponents("/Test/render-item.zul", self, map); } ]]></zscript> <tabbox mold="accordion"> <tabs> <tab forEach="${iterateOverMe}" label="${each[1]}"/> </tabs> <tabpanels> <tabpanel forEach="${iterateOverMe}" onCreate="onCreate();"> </tabpanel> </tabpanels> </tabbox> </window>
render-item.zul (component that I am trying to invoke)
<?page id="${arg.pageId}"?> <zk> <zscript><![CDATA[ public void onClick() { lbl23.setValue("Something new"); } ]]></zscript> <vbox> <label value="${arg.pageId}" id="lbl23"/> <button label="testing${arg.pageId}" onClick="onClick();"/> </vbox> </zk>
Problem is with id in label control
Thanks for replying!
<?page id="${arg.pageId}"?> <zk> <window border="none"> <zscript><![CDATA[ public void onClick() { lbl23.setValue("Something new"); } ]]></zscript> <vbox> <label value="${arg.pageId}" id="lbl23"/> <button label="testing${arg.pageId}" onClick="onClick();"/> </vbox> </window> </zk>
In render-item.zul put them in <window></window> so that they are in different id space.
Br,VinhVo
Asked: 2010-07-15 05:30:16 +0800
Seen: 259 times
Last updated: Jul 15 '10