Hi,
I'm not sure I have fully understood your situation. You should have:
1- a page which opens a modal dialog via Javascript
2- another page which is rendered inside modal dialog
3- in this last page (the one inside modal window) you want a link to
the page in background (the starting page)
Is this right?
Couldn't you get the url of target page using the same code used for
modal dialog page? i.e.:
comp.urlFor(TargetPageClass.class, params);
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: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]