0

zk popup window without composer

asked 2010-07-15 01:22:33 +0800

sarszk gravatar image sarszk
102 1 3

Hello All,
I need help, I want to create form window popup. Suppose I have 2 zul page.
1st page is view.zul
<zk>
<grid fixedLayout="true" width="600px">
<columns>
<column label="Name"/>
<column label="Address"/>
</columns>
<rows>
<row/>
<row/>
</rows>
</grid>
<button label="Add data" popup="dataEntry.zul"/>
</zk>

2nd zul is dataEntry.zul
<zk>
<window sizable="true" draggable="true" position="center,center">
<grid fixedLayout="false">
<columns>
<column label="Name" width="250px" />
<column label="Address" width="10px" />
</columns>
<rows>
<row zclass="gridonlist">
<label value="Name" />
<label value=":" />
<textbox />
</row>
<row zclass="gridonlist">
<label value="Address" />
<label value=":" />
<textbox />
</row>
</rows>
</grid>
<button label="Submit" onClick="view.zul"/>
</window>
</zk>

but it doesn't work, I don't know how to make it work. Please, give me some way.
And the important thing is I'm not allowed to create composer. Please helpppppppp
Thanks

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2010-07-15 02:44:53 +0800

Arsen gravatar image Arsen
384 5

You can write zscript for onClick event of button

Window window = (Window) Execution.createComponent("dataEntry.zul", null, null);
window.doPopup();

link publish delete flag offensive edit

answered 2010-07-15 04:35:57 +0800

sarszk gravatar image sarszk
102 1 3

Hi Arsen,
Thanks for your solution, and I apologize for my duplicate thread.

Anyway, I use different way to make it, but I've new problem now. I can create popup window, but when I inputed the some data, I can't refresh the old one, so the old data is still alive. Do you have any solution please?

here my zul code

view.zul
<zk>
<grid fixedLayout="true" width="600px">
<columns>
<column label="Name"/>
<column label="Address"/>
</columns>
<rows>
<row/>
<row/>
</rows>
</grid>
<button label="Add data" onClick="myWin.doHighlighted()"/>
<window id="myWin" visible="false" >
<include src="dataEntry.zul" />
</window>
</zk>


dataEntry.zul

<zk>

<grid fixedLayout="false">
<columns>
<column label="Name" width="250px" />
<column label="Address" width="10px" />
</columns>
<rows>
<row zclass="gridonlist">
<label value="Name" />
<label value=":" />
<textbox />
</row>
<row zclass="gridonlist">
<label value="Address" />
<label value=":" />
<textbox />
</row>
</rows>
</grid>
<button label="Submit" onClick="myWin.SetVisible("false")"/>

</zk>


please help.
Best

link publish delete flag offensive edit

answered 2010-07-15 07:57:21 +0800

Arsen gravatar image Arsen
384 5

That's very strange solution you are using :-)
But anyway I can't see where do you change data?

link publish delete flag offensive edit

answered 2010-07-16 02:27:43 +0800

sarszk gravatar image sarszk
102 1 3

Hi Arsen,
I meant in my 2 zuls I have created, I implemented popup window. So when I click button Add data, popup window of add data is show up, then I input some data, suppose I input name = Duke then I click OK button, so the window pop up of adding data is not visible. Then I tried to click button Add data again and add data is show up, but data with name = Duke is still there. My question is, how to remove it when I click Ok button after I finish inputing data, meanwhile I not allowed to use zscript component.
Thanks, Please help.

link publish delete flag offensive edit

answered 2010-07-16 06:36:37 +0800

Arsen gravatar image Arsen
384 5

<label value="Name" />
<textbox id="nameText"/>
<button label="Submit">
    <attribute name="onClick">
             //clearing input values 
            nameText.setText("");

             //hidding window
             myWin.SetVisible("false")"/>
   </attribute>
</button>

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-07-15 01:22:33 +0800

Seen: 2,716 times

Last updated: Jul 16 '10

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