0

Button to Add Multiple Included Pages/Windows?

asked 2010-10-08 16:32:09 +0800

Tessla gravatar image Tessla
330 2

updated 2010-10-08 16:56:59 +0800

I have a sample.zul file that contains just a window with its set of components (without ids except for the window having ID="test".

I have an index.zul file with just a button. I want to make it so that when I click on a button, pops up the window in the index.zul via include. When I click on the button again, another sample.zul should be included with the same window (programatically changing the id to be different maybe?).

How would I do this?

The reason behind this is so that I can essentially have a window template (sample.zul) and just be able to create multiple instances of sample.zul in the same index.zul page if the user clicks the button.

I was thinking something along the lines of:

<div="testdiv">
<button label="Spawn Window" sclass="blue"/>
<attribute name="onClick">
Include newtest = new Include();
ni.setSrc("sample.zul");
testdiv.appendChild(newtest);
</attribute>
</div>

It doesn't do anything though. Perhaps the id of the window in sample.zul is the same, which causes conflict? Im not sure...

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2010-10-18 04:44:23 +0800

bayaraa2054 gravatar image bayaraa2054
75 2

Hello, Tessla

There are some example.

http://www.zkoss.org/smalltalks/zk3.5.2/

Thank you.

link publish delete flag offensive edit

answered 2010-10-18 05:45:39 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

Hi Tessla,
Use Executions.createComponents() instead. Here is one example code for that in this thread

link publish delete flag offensive edit

answered 2010-10-18 05:48:10 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

or you could also use these techniques specified here and here

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-10-08 16:32:09 +0800

Seen: 538 times

Last updated: Oct 18 '10

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