-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I encountered this problem when migrating from 3.6.3 to 5. I am having problems wiht the Include api:
Include inc=new Include("romen.html"); // this works
Include inc=new Include("romen.zul"); // this does not work, included area shows blank
// I can get it to work by adding the following
inc.setMode("defer"); // this should be wrong according to javadoc since auto will treat .zul as 'instant'
BTW, the <include> tag works fine. Is this a bug?
cheers
romen
Hi, romen
yes, it is a bug
we post it here
we will track it
hi as 1225, i have another problem with version 5.0 include. its when i set SRC of the include with http request parameter with it
like inc.setSrc("zuls/aktejo.zul?id=1");
the page doesn't load and server output this message:
WARNING: Removing non-exist page: [Page z_jp_ih]
Current pages: [[Page mainPage]]
everything works fine if I omit the request parameter, like this:
inc.setSrc("zuls/aktejo.zul");
or are there any other way to pass information to newly loaded page ?
tq
I write a test
It works well on ZK 5.0.1
index.zul
<zk> <include id="inc"/> <zscript><![CDATA[ inc.setSrc("page1.zul?id=1"); ]]></zscript> </zk>
<zk> <label value="value = ${param.id}"/> </zk>
Hi as1225
I changed the library into latest 5.0.1
warning still show up on server output,
WARNING: Removing non-exist page: [Page z_jp_ih]
this is the code triggering inclusion of the page:
Include subInclude;
South subPanel;
public void onClick$miLogin(Event evt) throws Exception {
String uri = "zuls/tesincludezul.zul?id=tejo&uid="+UUID.randomUUID().toString();
System.out.println("uri included:"+uri);
subInclude.setSrc(uri);
subPanel.setOpen(true);
}
the include reside inside south panel
the UUID generate random uniq id on every click execution,.
on the second click, the warning start to show up.
if the included page is quite complex, then the page can't render well
Hi, aktejo
Could post your sample code for reproduce this problem?
Hi again jimmy, hmm, i will try to isolate the problem and create small web project to reproduce it, since my current project involving some hibernate connection
(btw don't know how to upload the code ?).
but, i have annother question, i sout (System.out. println) some text inside a doAfterCompse of an included page,.. form the server out put then i know that doAfterCompose is executed twice even if i invoked include.setSrc once.
code which invoke setSrc
public void onClick$miLogin(Event evt) throws Exception { String uri = "zuls/tesincludezul.zul"; Map p = MapUtil.newMap().store("id", "tejo").store("uid", UUID.randomUUID().toString()); subInclude.setSrc(uri); // subInclude is an include inside subPanel subPanel.setOpen(true);//subPanel is a shout }
controller of included page: extension of GenericForwardComposer
@Override public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); System.out.println("executing do AfterCompose"); //this line executed twice //Sdi.addPageLoadListener(self, new onPageLoad()); }
OK, maybe it is a bug,
you can use Executions.createComponents(uri, panelchildren, null); to instead it
hi , aktejo
I got the same issue as you,
and I try to remove the Include component and create new one, the Warning msg disappeared,
my code looks likes this:
public void onClick$xxx(Event event) { mybox.removeChild( mybox.getFistChild() );//mybox containts the Include comp Include inc = new Include( url ); mybox.appendChild( inc ); }
Hi dongpeng
I tested my sample with ZK 5.0.3
it worked well
<zk> <box id="mybox"> <include src="page1.zul"></include> </box> <button label="update model"> <attribute name="onClick"><![CDATA[ mybox.removeChild(mybox.getFirstChild());//mybox containts the Include comp Include inc = new Include("page2.zul"); mybox.appendChild(inc); ]]></attribute> </button> </zk>
I have a question with the 5.0.3 ,give the some of the code
this is index.zul
<borderlayout height="700px" width="100%" apply="com.gianstone.zk.demo.login.Index"> ...... ...... <vbox spacing="5" id="centerbox" width="100%" style="border: px solid grey;margin-top:3%" height="370px"> <include id="include" src="content.zul" /> </vbox>
<box width="100%"> <hbox width="100%"> <combobox readonly="true"> <comboitem label="待处理安排事项" id="label1"/> <comboitem label="任务"/> <comboitem label="项目"/> </combobox> </hbox> <hbox width="100%"> <textbox id="text" width="100%" rows="20"/> </hbox> </box>
I use include$text in the Index.java show the include$text is null
this is some of the index.java
public class Index extends GenericForwardComposer { private Calendar cal; // private Include include; private Textbox include$text; public void doAfterCompose(Component comp){ try { super.doAfterCompose(comp); include$text.setValue("12345"); } catch (Exception e) { e.printStackTrace(); } }
Asked: 2010-03-05 06:11:40 +0800
Seen: 2,085 times
Last updated: Jun 05 '12