You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alexander Monakhov <do...@gmail.com> on 2010/10/22 14:26:05 UTC

AjaxTabbedPanel and location line

Hi, guys.

I've got one page that contains AjaxTabbedPanel component. Each ITab
contains AjaxTabbedPanel. So, page contains tabs and subtabs. When different
tabs selected, location path isn't changed. Could you suggest me how to
change location for every selected tab?

For example, there are 'tab1' and 'tab2'. 'tab1' contains 'subtab1' and
'subtab2', The same for 'tab2'. I'd like it to work as following: when user
selects tab1/subtab1 location line would contain
http://domain.com/tab1/subtab2, when user selects tab2/subtab1 location line
would contain http://domain.com/tab2/subtab1, etc.

Also, it would be great if user types http://domain.com/tab2/subtab1 in
location line and appropriated tab would be opened.

Any idea how to make this?

Best regards, Alexander.

Re: AjaxTabbedPanel and location line

Posted by Alexander Monakhov <do...@gmail.com>.
Hi, there.

Thanx for your reply. Every time user selects tab, new instance of
page is created. Is it fine for performance? Why don't just retrieve
the same page from session? And what does cost less to CPU -
deserialize page from session or instantiate new one?

Best regards, Alexander.

P.S.: IndexedHybridUrlCodingStrategy doesn't work for me, it fails if
mounted page contains form. I've created jira issue in this case. So,
I'm trying to use HybridUrlCodingStrategy.

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


Re: AjaxTabbedPanel and location line

Posted by Mauro Ciancio <ma...@gmail.com>.
Hello,
  I've implemented something like this but using a TabbedPanel and not
AjaxTabbedPanel. The issue with AjaxTabbedPane is that the url is
always the same while you're navigating through the tabs.

  I'll tell you what I've done: I subclassed TabbedPanel and I overrode:

protected WebMarkupContainer newLink(String linkId, int index)

  and I return a BookmarkablePageLink instead of a Link. In the
pageparameters I added a string that is the tab being clicked.
Something like this:

PageParameters pp = new PageParameters("0=" + tab.getBaseURL())
return new BookmarkablePageLink<Void>(linkId, target, pp);

  Also, I mounted the page containing the tabbedpanel with the
following strategy: IndexedHybridUrlCodingStrategy, so the url will
end up in: domain.com/page/tab1 or /page/tab2 according to the baseURL
method.

  And the last step is to parse the pageparameters when your page is
constructed and tell the tabbedpanel which one is the selected tab, so
the selected tab is shown.

HTH
Regards.

On Fri, Oct 22, 2010 at 9:26 AM, Alexander Monakhov <do...@gmail.com> wrote:
> Hi, guys.
>
> I've got one page that contains AjaxTabbedPanel component. Each ITab
> contains AjaxTabbedPanel. So, page contains tabs and subtabs. When different
> tabs selected, location path isn't changed. Could you suggest me how to
> change location for every selected tab?
>
> For example, there are 'tab1' and 'tab2'. 'tab1' contains 'subtab1' and
> 'subtab2', The same for 'tab2'. I'd like it to work as following: when user
> selects tab1/subtab1 location line would contain
> http://domain.com/tab1/subtab2, when user selects tab2/subtab1 location line
> would contain http://domain.com/tab2/subtab1, etc.
>
> Also, it would be great if user types http://domain.com/tab2/subtab1 in
> location line and appropriated tab would be opened.
>
> Any idea how to make this?
>
> Best regards, Alexander.
>



-- 
Mauro Ciancio

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


Re: AjaxTabbedPanel and location line

Posted by Alexander Monakhov <do...@gmail.com>.
So, any suggestion here?

Best regards, Alexander.

Re: AjaxTabbedPanel and location line

Posted by Martin Grigorov <mg...@apache.org>.
Changing the location will reload the page.
The only part that can be changed is the location.hash: #something via
javascript.

On Fri, Oct 22, 2010 at 2:26 PM, Alexander Monakhov <do...@gmail.com>wrote:

> Hi, guys.
>
> I've got one page that contains AjaxTabbedPanel component. Each ITab
> contains AjaxTabbedPanel. So, page contains tabs and subtabs. When
> different
> tabs selected, location path isn't changed. Could you suggest me how to
> change location for every selected tab?
>
> For example, there are 'tab1' and 'tab2'. 'tab1' contains 'subtab1' and
> 'subtab2', The same for 'tab2'. I'd like it to work as following: when user
> selects tab1/subtab1 location line would contain
> http://domain.com/tab1/subtab2, when user selects tab2/subtab1 location
> line
> would contain http://domain.com/tab2/subtab1, etc.
>
> Also, it would be great if user types http://domain.com/tab2/subtab1 in
> location line and appropriated tab would be opened.
>
> Any idea how to make this?
>
> Best regards, Alexander.
>