-
1. Re: Submit form and open results in new window
norman.richards Dec 10, 2007 9:42 AM (in response to terryb)The links should all pass the target attribute through. For example:
<s:link view="/whatever.xhtml" target="_blank" />
-
2. Re: Submit form and open results in new window
pettersonfp Dec 11, 2007 12:04 PM (in response to terryb)Hi,
And if I want that my new window doesn't have menus?
Thanks -
3. Re: Submit form and open results in new window
norman.richards Dec 11, 2007 2:24 PM (in response to terryb)I guess you'd have to use javascript to do that. I don't know which (if any) link tags support that.
-
4. Re: Submit form and open results in new window
pettersonfp Dec 11, 2007 7:05 PM (in response to terryb)Hi,
That's what I feared :-)
I hate javascript...
Thanks
Petterson -
5. Re: Submit form and open results in new window
supernovasoftware.com Dec 11, 2007 7:18 PM (in response to terryb)I use something like the following to hide the browser menus.
<input id="index" onclick="javascript:openNewWindow('/start.xhtml','appwin','status=yes,resizable=yes,toolbar=no,scrollbars=yes' + winCenterCoordinates(1024,768));window.opener=null;window.close();" type="submit" value="Enter" />
Javascriptfunction openNewWindow(URLtoOpen, windowName, windowFeatures) { newWindow = window.open(URLtoOpen, windowName, windowFeatures); } function winCenterCoordinates(w, h) { LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0; TopPosition = (screen.height) ? (screen.height - h) / 2 : 0; position = ',top = ' +TopPosition + ',left = ' +LeftPosition + ',height = ' +h + ',width = ' +w; return position; }
Does anyone have any advice on opening then widow or not based on an Ajax request.
Currently I have a login form. This works normally. After successful login, the user is taken to a page with the button shown above. Here they click this button and a new window opens with the browser menus hidden.
I would prefer to give them a validation error if it fails and then open an new browser widow only if it is successful. -
6. Re: Submit form and open results in new window
terryb Dec 11, 2007 7:19 PM (in response to terryb)I may have misunderstood something but I think in my case I couldn't use s:link view="/whatever.xhtml" target="_blank" since it does not submit form. I wanted a single link to submit changes made to form fields and open second page in new window with query results based on submitted form.
I got it working with ...h:commandLink action="sb.action" target="_blank" and redirected to second page in .page.xml.
Peter, if you use facelets you could have 2 templates; with and without menu; and on the page in new window use the the one with no menus. That's how I do it.<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" template="#{something ? '/layout/template' : '/layout/template-nomenu'}">
-
7. Re: Submit form and open results in new window
terryb Dec 11, 2007 7:21 PM (in response to terryb)Jason thanks, browser menus of course.
-
8. Re: Submit form and open results in new window
pettersonfp Dec 11, 2007 7:54 PM (in response to terryb)Jason that is exactly what I was needing,
Thanks a lot
P.S.: Terry, your idea is really good also. I 'll use it to solve another problem :-) -
9. Re: Submit form and open results in new window
supernovasoftware.com Dec 11, 2007 7:58 PM (in response to terryb)No problem. This forum is a life saver.
I guess I'll go as is the Richfaces forum if I get no answer here.