Re: Pretty url for tabs

2008-11-13 Thread pixologe

ahhh sorry my fault.

of course i meant TabbedPanel and AbstractTab.

Stateless* are the names of the classes I created...

Sorry!


rmoskal wrote:
> 
> Thanks, that seems super straight forward as I've come to expect from
> wicket.  Only one thing, there doesn't seem to be a StatelessTabbedPanel
> or a StatelessTab in the distribution.
> 
> Regards,
> 
> Robert
> 
> 
> 
> pixologe wrote:
>> 
>> Well, when I think of it the word "exactly" is not right - of course,
>> there's no page versioning and no colons here, since
>> bookmarkablepagelinks are used... this thing works the stateless way when
>> switching tabs. But this way you can have nice urls like
>> [...]/yourPage/yourTabname/
>> 
>> 
>> pixologe wrote:
>>> 
>>> I had exactly the same use case 
>>> 
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Pretty-url-for-tabs-tp20451052p20486094.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Pretty url for tabs

2008-11-13 Thread rmoskal

Thanks, that seems super straight forward as I've come to expect from wicket. 
Only one thing, there doesn't seem to be a StatelessTabbedPanel or a
StatelessTab in the distribution.

Regards,

Robert



pixologe wrote:
> 
> Well, when I think of it the word "exactly" is not right - of course,
> there's no page versioning and no colons here, since bookmarkablepagelinks
> are used... this thing works the stateless way when switching tabs. But
> this way you can have nice urls like [...]/yourPage/yourTabname/
> 
> 
> pixologe wrote:
>> 
>> I had exactly the same use case 
>> 
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Pretty-url-for-tabs-tp20451052p20481676.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Pretty url for tabs

2008-11-13 Thread pixologe

Well, when I think of it the word "exactly" is not right - of course, there's
no page versioning and no colons here, since bookmarkablepagelinks are
used... this thing works the stateless way when switching tabs. But this way
you can have nice urls like [...]/yourPage/yourTabname/


pixologe wrote:
> 
> I had exactly the same use case 
> 



-- 
View this message in context: 
http://www.nabble.com/Pretty-url-for-tabs-tp20451052p20477547.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Pretty url for tabs

2008-11-13 Thread pixologe

Hi,

I had exactly the same use case and solved it as follows - works like charm
(unfortunately I cannot share the code):

extend StatelessTab (each instance to be constructed with its pageparameter
value

extend StatelessTabbedPanel,
constructor with the pageparameter key
override newLink to return a bookmarkablepagelink for each tab
override onbeforerender to set the selected tab dependent on the page's
pageparameter

perhaps you'd also want to adopt pageparameters of the previous request when
switching tabs when generating the links.

hope this helps, cheers :)


rmoskal wrote:
> 
> I'm familiar with the a lot of the strategies that make for nicer urls in
> Wicket, but am at a loss for how to make the urls for a tabpanel
> friendlier.
> 
> Instead of /Home:1:1, /Home:2:1, etc.
> 
> I'd like to have  /Home:Account:1, /Home:Alerts:1, etc.
> 
> It would be nice to lose the last bit on the right, but I could live with
> it if it messes with wickets state maintaining ability.
> 
> Has anyone had a client pester them for this?
> 
> Thanks and regards,
> 
> Robert Moskal
> Brooklyn, USA
> 

-- 
View this message in context: 
http://www.nabble.com/Pretty-url-for-tabs-tp20451052p20477380.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Pretty url for tabs

2008-11-12 Thread Jeremy Thomerson
It's been a while since I used TabbedPanel, so I could be wrong, but I think
you could accomplish something very similar to what you are requesting this
way:

final PageParameters params = getPageParameters();
TabbedPanel tp = new TabbedPanel("id", tabs) {
private static final long serialVersionUID = 1L;
@Override
protected WebMarkupContainer newLink(String linkId, int index) {
PageParameters tabParams = new PageParameters(params);
tabParams.remove("tabName");
tabParams.add("tabName", "your-tab-name");
return new BookmarkablePageLink(linkId, getPage().getClass(),
tabParams);
}
};
tp.setSelectedTab(getIndexForTab(getPageParameters().getString("tabName")));

This would result in the tabname not being colon-delimited as you show, but
instead being a query parameter.  Depending on the URL strategy you are
using, that might be /tabName/foo or ?tabName=foo

Obviously, you would need to implement getIndexForTab yourself based on the
tabs you create.
Hope this helps.

-- 
Jeremy Thomerson
http://www.wickettraining.com



On Wed, Nov 12, 2008 at 7:46 AM, Matej Knopp <[EMAIL PROTECTED]> wrote:

> This is not possible to do with Wicket unless you have each tab on
> different page.
>
> -Matej
>
> On Wed, Nov 12, 2008 at 12:46 AM, rmoskal <[EMAIL PROTECTED]> wrote:
> >
> > I'm familiar with the a lot of the strategies that make for nicer urls in
> > Wicket, but am at a loss for how to make the urls for a tabpanel
> friendlier.
> >
> > Instead of /Home:1:1, /Home:2:1, etc.
> >
> > I'd like to have  /Home:Account:1, /Home:Alerts:1, etc.
> >
> > It would be nice to lose the last bit on the right, but I could live with
> it
> > if it messes with wickets state maintaining ability.
> >
> > Has anyone had a client pester them for this?
> >
> > Thanks and regards,
> >
> > Robert Moskal
> > Brooklyn, USA
> > --
> > View this message in context:
> http://www.nabble.com/Pretty-url-for-tabs-tp20451052p20451052.html
> > Sent from the Wicket - User 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]
>
>


Re: Pretty url for tabs

2008-11-12 Thread Matej Knopp
This is not possible to do with Wicket unless you have each tab on
different page.

-Matej

On Wed, Nov 12, 2008 at 12:46 AM, rmoskal <[EMAIL PROTECTED]> wrote:
>
> I'm familiar with the a lot of the strategies that make for nicer urls in
> Wicket, but am at a loss for how to make the urls for a tabpanel friendlier.
>
> Instead of /Home:1:1, /Home:2:1, etc.
>
> I'd like to have  /Home:Account:1, /Home:Alerts:1, etc.
>
> It would be nice to lose the last bit on the right, but I could live with it
> if it messes with wickets state maintaining ability.
>
> Has anyone had a client pester them for this?
>
> Thanks and regards,
>
> Robert Moskal
> Brooklyn, USA
> --
> View this message in context: 
> http://www.nabble.com/Pretty-url-for-tabs-tp20451052p20451052.html
> Sent from the Wicket - User 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]



Pretty url for tabs

2008-11-11 Thread rmoskal

I'm familiar with the a lot of the strategies that make for nicer urls in
Wicket, but am at a loss for how to make the urls for a tabpanel friendlier.

Instead of /Home:1:1, /Home:2:1, etc.

I'd like to have  /Home:Account:1, /Home:Alerts:1, etc.

It would be nice to lose the last bit on the right, but I could live with it
if it messes with wickets state maintaining ability.

Has anyone had a client pester them for this?

Thanks and regards,

Robert Moskal
Brooklyn, USA
-- 
View this message in context: 
http://www.nabble.com/Pretty-url-for-tabs-tp20451052p20451052.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]