You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by kevjay <ke...@gmail.com> on 2012/05/25 20:01:57 UTC

Pretty URLs for AjaxLazyLoadPanel

I'm using AjaxTabbedPanel and AjaxLazyLoadPanel.  How do I make the URLs for
the individual panels the way I want?  Right now, a link to a specific panel
looks like
http://localhost:8888/?1-1.ILinkListener-tabs-tabs~container-tabs-2-link. 
How do I make it something like http://localhost:8888/myTab2?  I cannot seem
to find a way.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Pretty-URLs-for-AjaxLazyLoadPanel-tp4649499.html
Sent from the Users forum 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


Re: Pretty URLs for AjaxLazyLoadPanel

Posted by Martin Grigorov <mg...@apache.org>.
You can also use url like: path/to/page/tab2
where 'tab2' is an indexed parameter. In this case you will have its
value in the page's constructor and you can load the page with 'tab2'
pre-selected.

On Tue, May 29, 2012 at 9:51 PM, kevjay <ke...@gmail.com> wrote:
> Thanks for the explanation.  This is what I was looking for.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Pretty-URLs-for-AjaxLazyLoadPanel-tp4649499p4649555.html
> Sent from the Users forum 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
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: Pretty URLs for AjaxLazyLoadPanel

Posted by kevjay <ke...@gmail.com>.
Thanks for the explanation.  This is what I was looking for.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Pretty-URLs-for-AjaxLazyLoadPanel-tp4649499p4649555.html
Sent from the Users forum 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


Re: Pretty URLs for AjaxLazyLoadPanel

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

You can simulate this by using the fragment part of the url, a.k.a. the hash.
For example the url may look like: path/to/page#tab2
Then the page will be loaded with tab1 selected but a onDomReady
script can click on tab2 if it is not the currently selected and an
Ajax call will do the switch.
This is how sites like Twitter, GMail, Facebook,... work but they do
some more work to not show you the page with tab1 for better user
experience.

On Tue, May 29, 2012 at 9:21 PM, kevjay <ke...@gmail.com> wrote:
> Thanks for the reply Martin.  Basically, my use case is to provide a "pretty"
> URL that will have the non-default tab already selected.  The desired tab is
> selected if I provide a URL like
> http://localhost:8888/?1-1.ILinkListener-tabs-tabs~container-tabs-2-link,
> but I was hoping to be able to control what these URLs looked like.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Pretty-URLs-for-AjaxLazyLoadPanel-tp4649499p4649552.html
> Sent from the Users forum 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
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: Pretty URLs for AjaxLazyLoadPanel

Posted by kevjay <ke...@gmail.com>.
Thanks for the reply Martin.  Basically, my use case is to provide a "pretty"
URL that will have the non-default tab already selected.  The desired tab is
selected if I provide a URL like
http://localhost:8888/?1-1.ILinkListener-tabs-tabs~container-tabs-2-link,
but I was hoping to be able to control what these URLs looked like.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Pretty-URLs-for-AjaxLazyLoadPanel-tp4649499p4649552.html
Sent from the Users forum 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


Re: Pretty URLs for AjaxLazyLoadPanel

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Only pages may have "pretty" urls.
AjaxLazyLoadPanel is a component and it should be used inside a page.
Additionally it needs to find the exact page instance. Read about
stateful components for more info.

What is your use case ?
Why you need to make requests to an Ajax component ?

It is possible to mount a component by mounting a custom
IRequestMapper that returns ComponentRenderingRequestHandler in its
#mapRequest() method but the result will be just the markup of the
component, e.g. <div>...</div>. But I cannot guarantee that this will
work because AjaxLazyLoadPanel needs to contribute some JavaScript to
be able to work and there wont be <head> in this response ...

On Fri, May 25, 2012 at 9:01 PM, kevjay <ke...@gmail.com> wrote:
> I'm using AjaxTabbedPanel and AjaxLazyLoadPanel.  How do I make the URLs for
> the individual panels the way I want?  Right now, a link to a specific panel
> looks like
> http://localhost:8888/?1-1.ILinkListener-tabs-tabs~container-tabs-2-link.
> How do I make it something like http://localhost:8888/myTab2?  I cannot seem
> to find a way.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Pretty-URLs-for-AjaxLazyLoadPanel-tp4649499.html
> Sent from the Users forum 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
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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