0

ZK JSP

asked 2010-02-24 04:48:52 +0800

fusion35 gravatar image fusion35
237 2 5

Hi :

I am trying to integrate ZK in JSP using tags.

Here is my code snippet :

<%@ taglib uri="http://www.zkoss.org/jsp/zul" prefix="z"%>
<z:init use="com.emtize.cp.zk.initiator.GenericInitiator"/>
.
.
.
                <z:page>
		  <z:listbox id="lbjoblocation" model="@{listCompanies}" mold="select" width="450px" >
                      <z:listitem self="@{each=comp}" label="@{comp.company}" value="@{comp.id}"/>
		  </z:listbox>
                </z:page>

The initiator :

    public void doInit(Page page, Map map) throws Exception
    {
        List<Company> companies = new UtilManager().getAllCompany();
        page.setVariable("listCompanies", companies);
    }

The problem :

The listbox doesn't get populated.

ZK 3.6.2, ZKJSP : 1.2.0

regards
Devinder

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2010-02-24 16:23:11 +0800

n4rk0 gravatar image n4rk0
120 3

I'm not use the JSP Tags like you ... but maybe helps ...
Set you variable in your doBeforeComposeChildren like this :


public void doBeforeComposeChildren(Component window) throws Exception{
	super.doBeforeComposeChildren(window);
	window.setVariable("Controller", this, true); // I set my controller like a window variable
}


And my zul :


<z:combobox id="cmbCombo" model="${Controller.functionInsideController}" />


functionInsideController is a function inside my controller (the real name of that function is getFunctionInsideController) that gives me the model of the combo.
Hope this helps

Regards,

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: 2010-02-24 04:48:52 +0800

Seen: 216 times

Last updated: Feb 24 '10

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