This looks to be exactly what I need.  I've added the following code to my
home page class:

  public void renderHead(IHeaderResponse response) {
    response.renderOnLoadJavascript("mainUrl = '" +
RequestCycle.get().urlFor(new MainPageClass()) + "'; openJSWindow()");
  }

Unfortunately, I'm now getting and invalid character error from
wicket-event.js.  When I inspect the file being served up from the app, it's
full of garbage.  Almost like it's being sent in some binary format.  I've
used renderOnLoadJavascript() before in a different project without issue,
so it looks like there's something specific with this project which is
causing this error.  Since there's something else I need to work on today, I
probably won't get around to investigating this further until next week.

Joel



igor.vaynberg wrote:
> 
> RequestCycle.urlFor(Page) will do what you want
> 
> -igor
> 
> 
> On 7/19/07, Joel Hill <[EMAIL PROTECTED]> wrote:
>>
>> My app's home page is nothing more than a blank page which has an onload
>> script which opens a new browser window and loads my app's "main" page
>> into it.  I'm having trouble figuring out how to get it to work in
>> wicket.  I don't want to make the page bookmarkable if at all possible,
>> but I have to figure out how to get a url into my javascript call which
>> will access my wicket page.  I know how to get wicket to dynamically
>> create javascript using IHeaderContributor, but not how to get a url
>> which will load a non-bookmarkable wicket page.  I looked into
>> Component#urlFor, but the javadocs say that will make the page
>> bookmarkable; and I really want to force all access to the app to go
>> through the home page.  Any suggestions would be much appreciated.
>> Thanks.
>>
>> Joel
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2005.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Wicket-user mailing list
>> Wicket-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket-URLs-in-javascript-tf4113835.html#a11709841
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to