Hello everyone, 

in our project i have to use our own modal dialog (application is included
in a portal). I have to open the dialog with the help of a javascript
function which is wrapped in a Behaviour. What i am doing now:

- in the constructor of my response page i call the javascript function via
a behaviour, so that immediately after the responsepage is rendered, the
javascript function gets called and the modal dialog opens.
- the javascript funtion accepts a url of the page that will be included in
the dialog.

In order to get the url i'm doing the this:

URL for Page in Modal Dialog:
ServletWebRequest servletWebRequest = (ServletWebRequest) comp
                                .getRequest();
                HttpServletRequest request = 
servletWebRequest.getHttpServletRequest();
                String path = Strings.stripJSessionId(request.getRequestURI());
                CharSequence urlFor = comp.urlFor(targetPageClass, params);
                String contextRelativePath = path + urlFor;


Behaviour for opening the Modal Dialog:

public class OpenModalDialogBehaviour extends AbstractDefaultAjaxBehavior {

        private static final long serialVersionUID = -127624955452459934L;

        private String url;

        public OpenModalDialogBehaviour(String url) {
                this.url = url;
        }

        @Override
        protected void onComponentTag(ComponentTag tag) {
                super.onComponentTag(tag);
                ASPSession session = (ASPSession) ASPSession.get();
                String js = "{if(" + session.isShowModalDialog() + 
"){top.showForm('"
                                + url + " + ');}}";
                tag.append("onload", js , " ");
                session.setShowModalDialog(false);
        }

        @Override
        protected void respond(AjaxRequestTarget target) {
                System.out.println("respond");
        }
}

Now, my problem is, that the response page is the page in the background
(deactivated by the modal-dialog-javascript- function), not the page of the
modal dialog. Therefore the links in the page of my modal dialog are dead
(the onclick functions never get called). 

What i need is some trick to calculate and set the urls for my modal dialog
page manually, but i have no clue how to do this. Or maybe there is a much
simpler solution?

Thanks for any suggestions!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/custom-non-wicket-modal-dialog-Problem-with-urls-tp3726196p3726196.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

Reply via email to