-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello
Our application uses IFrame on windows. Iframe these we open other files zul. When I run using the IE everything works as expected. The class composer is performed only once. But if I run the same code on firefox the composer runs twice. Follows a code to reproduce the problem.
test.zul
<?xml version="1.0" encoding="UTF-8"?>
<window
apply="test.MyComposer"
width="300px" height="300px"
id="test">
<button
id="btnOpen"
width="100px"
height="21px"
label="Open window" >
<attribute name="onClick">
Window w = new Window();
w.setParent(test);
Iframe f = new Iframe();
f.setSrc("http://localhost:8400/zk/test2.zul");
w.setWidth("400px");
w.setHeight("400px");
f.setWidth("100%");
f.setHeight("100%");
f.setParent(w);
w.doModal();
</attribute>
</button>
</window>
test.MyComposer.java
package test;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.util.GenericAutowireComposer;
public class MyComposer extends GenericAutowireComposer {
public MyComposer() {
super('$', false, true);
}
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
System.out.println("doAfterCompose " + comp.getId());
}
}
test2.zul
<?xml version="1.0" encoding="UTF-8"?>
<window
apply="test.MyComposer"
width="300px" height="300px"
id="test2">
<label id="lbl" value="Hi. I'm test2.zul" />
</window>
After execution, the console comes out this:
doAfterCompose test
doAfterCompose test2
doAfterCompose test2
What's wrong?
Thanks in advance.
Sorry about the lack of more information.
Follows:
IE version 8
Firefox version: 3.6.4
zkee-eval-bin-5.0.4-FL-2010-07-27
Thanks
This bug will be fixed in next release
https://sourceforge.net/tracker/?func=detail&atid=785191&aid=1952402&group_id=152762
Hi
The problem was solved for Zul different files: the file to be opened in the iframe is not the file that this opening. But if the window is open that the iframe is the same zul file that calls the error repeats.
Simply replace the line:
f.setSrc (http://localhost:8400/zk/test2.zul ");
By
f.setSrc (http://localhost:8400/zk/test.zul ");
I say this because our application has a zul file that acts as an entry point into the application. It, through the controller, we mount the screen dynamically.
So in order to simulate the problem just open the file itself Zul (test.zul) inside the iframe.
Incidentally, even after this fix the problem happens in IE.
Thanks
Asked: 2010-08-05 13:40:13 +0800
Seen: 580 times
Last updated: Aug 13 '10