-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have two pages: page1.zul and page2.zul.
Both pages has a class: Page1Window and Page2Window
On page1.zul I have a <include id="main"/> and I set the src on java code: main.setSrc("page2.zul").
My problem is: I want to obtain a reference to the page1 on the page2 to change the src of the include tag.
Anyone can help me?
I think if you are in page1 and want to get some information from your included page2 you could use getFellow()
ex: var = window.getFellow("include").getFellow("page2Win").getVariable("info");
or if in page2 and want info from page1 use getParent()
ex: info = page2Win.getParent().getParent().getParent().getVariable("var");
Also... session variables are possibilities.
As for the best solution, I'm not sure... but I hope that helps
.
No.On the page2 I do not have access to include. getFellows() only show components inside the page2...
Hei I found one solution! I dont know if is the best. but...
I change the include to <div id="main/> and on the java code of the page1 I used
Window w = (Window) Executions.createComponents("page2.zul", getFellow("main"), null);
To obtain the page1 on page2: getParent().getFellow("page1_id")
If anyone has another more efficient solution, please...
james, the getParent on the page2 return null. on page1 i have the <include src="page2.zul"> but getparent return null...
Asked: 2009-09-17 00:03:44 +0800
Seen: 183 times
Last updated: Sep 17 '09