ModalWindow open on page load (without ajax)

2010-12-03 Thread hok

Hello,
I'm trying to open a modal window without ajax request (when the page is
loaded). I've looked at 
https://issues.apache.org/jira/browse/WICKET-12
https://issues.apache.org/jira/browse/WICKET-12 

but trying the proposed solution does not work in my case. I can see in the
log that the window's panel is created but the window itself does not open
when the page is loaded. The code that I'm using is:

public class TestPage extends WebPage {

public TestPage() {
}

@Override
protected void onInitialize() {
super.onInitialize();

ModalWindow window = new ModalWindow(modal_window) {
private static final long serialVersionUID = 
-2976925047468282833L;

@Override
protected boolean makeContentVisible() {
if (getWebRequest().isAjax() == false) {
return true;
} else {
return false;
}
}

};
window.setContent(new EmptyPanel(window.getContentId()));
add(window);
}
}

and for the markup file:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
xmlns:wicket=http://wicket.apache.org/; xml:lang=en lang=en
head
titleWicket test/title
/head
body  
div wicket:id=modal_windowModal window/div
/body
/html

Is there something wrong in the code? Thanks in advance.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ModalWindow-open-on-page-load-without-ajax-tp3071714p3071714.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ModalWindow open on page load (without ajax)

2010-12-03 Thread Ernesto Reinaldo Barreiro
Hope this helps

http://apache-wicket.1842946.n4.nabble.com/opening-ModalWindow-on-page-load-td3055618.html

Proposed solution works for me.

Regards,

Ernesto.



On Fri, Dec 3, 2010 at 9:32 PM, hok ivanvasi...@gmail.com wrote:

 Hello,
 I'm trying to open a modal window without ajax request (when the page is
 loaded). I've looked at
 https://issues.apache.org/jira/browse/WICKET-12
 https://issues.apache.org/jira/browse/WICKET-12

 but trying the proposed solution does not work in my case. I can see in the
 log that the window's panel is created but the window itself does not open
 when the page is loaded. The code that I'm using is:

 public class TestPage extends WebPage {

        public TestPage() {
        }

       �...@override
        protected void onInitialize() {
                super.onInitialize();

                ModalWindow window = new ModalWindow(modal_window) {
                        private static final long serialVersionUID = 
 -2976925047468282833L;

                       �...@override
                        protected boolean makeContentVisible() {
                                if (getWebRequest().isAjax() == false) {
                                        return true;
                                } else {
                                        return false;
                                }
                        }

                };
                window.setContent(new EmptyPanel(window.getContentId()));
                add(window);
        }
 }

 and for the markup file:

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
     http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
        xmlns:wicket=http://wicket.apache.org/; xml:lang=en lang=en
 head
    titleWicket test/title
 /head
 body
        div wicket:id=modal_windowModal window/div
 /body
 /html

 Is there something wrong in the code? Thanks in advance.
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/ModalWindow-open-on-page-load-without-ajax-tp3071714p3071714.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org