Re: AjaxTabbedPanel and location line

2010-10-23 Thread Alexander Monakhov
So, any suggestion here?

Best regards, Alexander.


Re: AjaxTabbedPanel and location line

2010-10-23 Thread Mauro Ciancio
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 BookmarkablePageLinkVoid(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 domin...@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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AjaxTabbedPanel and location line

2010-10-22 Thread Martin Grigorov
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 domin...@gmail.comwrote:

 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.