1

Model window behave as pop up window

asked 2015-01-05 12:11:38 +0800

iamsudhir4u gravatar image iamsudhir4u flag of India
545 7
http://corejavasupport.bl...

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.

delete flag offensive retag edit

Comments

mvvm or mvc?

chillworld ( 2015-01-05 12:38:17 +0800 )edit

I am using MVVM

iamsudhir4u ( 2015-01-05 12:59:21 +0800 )edit

Is the provided example enough or do you want an example with @Command?

chillworld ( 2015-01-05 13:06:51 +0800 )edit

3 Answers

Sort by ยป oldest newest most voted
1

answered 2015-01-06 06:27:01 +0800

iamsudhir4u gravatar image iamsudhir4u flag of India
545 7
http://corejavasupport.bl...

Instead of mode="modal" i have used mode="popup" and it is working as per my requirement.

link publish delete flag offensive edit
1

answered 2015-01-05 12:56:31 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

updated 2015-01-05 12:58:41 +0800

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.

link publish delete flag offensive edit
1

answered 2015-01-06 05:46:01 +0800

iamsudhir4u gravatar image iamsudhir4u flag of India
545 7
http://corejavasupport.bl...

updated 2015-01-06 05:47:12 +0800

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);
link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2015-01-05 12:11:38 +0800

Seen: 135 times

Last updated: Jan 06 '15

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