Question

Is it possible to initialize a window that I've already put in a page with a .zul spicified dynamically?

I do like this:

<n:div id = "content">  
     <window id="content_wnd">
     </window>
</n:div>

- it is at the main window

and i want, for example initialize this "content_wnd" window by "/login_wnd.zul":

content_wnd = (Window)Executions.createComponents(
                "/login_wnd.zul", null, null);

and after it executes, a new window appears in the bottom of the page, not in the

<n:div>
</n:div>

block, where the "content_wnd" is placed. What's wrong here and what is the correct way to dynamically put a window into a specified place of the page?

Was it helpful?

Solution

That is expected behavior. Because the java reference content_wnd is not the child of <div id="content"> but the objecct content_wnd it refered to before you called Executions.createComponents.
To append the window as a child of the content do the following.
*.zul

<n:div id = "content"/>  

create Window in java with content div as parent

content_wnd = (Window)Executions.createComponents(
                "/login_wnd.zul", content, null);

where content is a referenc to the div.
For example add the field

@Wire
Div content;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top