-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
Is their any way by which we can make a modal window in ZK can behave like a Pop up window.
Modal Window: A modal window provides the so-called modal effect that limits a user from accessing components other than the modal window. Users cannot access anything outside of the modal window, including clicking or tabbing.
popup window: A popup window automatically closed when user clicks on any component other than the popup window itself or any of its descendants.
My requirement is to open a modal window but when user clicks on any component other than the model window itself or any of its descendants then model window should be automatically closed same as pop up. We can't use pop up window because for displaying a pop up window we need a anchor.
Instead of mode="modal"
i have used mode="popup"
and it is working as per my requirement.
I do not know where you get the info that a pop up window need to have an anchor, only a component where you attach it.
Here you have a sample code where you trigger the popup with button, I created a fiddle also :
<zk>
<window border="normal" title="popup from button" vflex="1">
<button label="show pop up" onClick='mypopup.open(self)' />
<popup id="mypopup">
<vbox>
<label value="Here you have a popup."/>
<button label="I do nothing :)"/>
</vbox>
</popup>
</window>
</zk>
If you mean that I reffer to the self
attribute now, you can change it to spaceOwner
also.
Greetz chill.
On my parent view model i have written below for opening a modal window.
Executions.getCurrent().createComponents(/popup.zul, currentView, arg);
On the modal window(popup.zul
)
<zk>
<window mode="modal" popup="true" width="350px" height="250px"
id="alertWindow" closable="true"
apply="org.zkoss.bind.BindComposer" border="normal"
position="right,top"
viewModel="@id('vm') @init('com.test.ShowNotificationViewModel')">
</window>
</zk>
I just want this opened window should behave like pop up instead of modal window. When i am removing the mode="modal"
attribute of window then this page is not opening when i am calling the
Executions.getCurrent().createComponents(/popup.zul, currentView, arg);
Asked: 2015-01-05 12:11:38 +0800
Seen: 135 times
Last updated: Jan 06 '15
mvvm or mvc?
chillworld ( 2015-01-05 12:38:17 +0800 )editI am using MVVM
iamsudhir4u ( 2015-01-05 12:59:21 +0800 )editIs the provided example enough or do you want an example with
chillworld ( 2015-01-05 13:06:51 +0800 )edit@Command
?