You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Mi...@health.gov.au on 2009/07/09 04:13:35 UTC

Help: Open file in new window if specified. [SEC=UNCLASSIFIED]

Hello.

I'm trying to open the contents of a file in a new window if the filepath 
is specified.  What is the best way to do this?

I can get the filepath in via PageParameters, I can use a panel to include 
some JavaScript based upon if I get the filepath or not, but how do I get 
the filepath into the javascript command?

Or is there a better way?

I'm  using the latest wicket 1.4 snapshot and the page the window will be 
opened from is a WebPage.

Michelle

______________________________________________________________________
"Important: This transmission is intended only for the use of the addressee and may contain confidential or legally privileged information.  If you are not the intended recipient, you are notified that any use or dissemination of this communication is strictly prohibited.  If you receive this transmission in error please notify the author immediately and delete all copies of this transmission."

Re: Help: Open file in new window if specified. [SEC=UNCLASSIFIED]

Posted by Mathias Nilsson <wi...@gmail.com>.
maybe a behavior

final AbstractDefaultAjaxBehavior behaviour = new
AbstractDefaultAjaxBehavior(){
			@Override
			protected void respond(AjaxRequestTarget target) {
			}
			
			@Override 
	       public void renderHead(IHeaderResponse response) { 
	            response.renderJavascript( "window.open ('"+
getRequestCycle().urlFor(TestPage.class,null) +"','mywindow'); " , "test"); 
	       } 
		  }; 

You must change the getRequestCycle).urlFor to you page. The second
parameter takes a Parameters object.
You can also implement IHeaderContributor and add a javascript there. 
-- 
View this message in context: http://www.nabble.com/Help%3A-Open-file-in-new-window-if-specified.-----SEC%3DUNCLASSIFIED--tp24402604p24404066.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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