You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by NickCanada <nm...@ucalgary.ca> on 2007/12/05 00:27:49 UTC

Template Page and the URLs

HI there,

Looking at the template example in the Wicket Examples (either Markup
Inheritance or Borders), there is a demo of the issue I have.
Page 1 and Page 2 are displayed via bookmarkable page links and the urls
show this. Now when I replace the panel using the "Change Ad" button, I get
an entirely different "non bookmarkable" type of url even though I just
changed the panel rather than the page.
Is there a way of just getting the panels to swap without the url switching
completely?
(maybe this is a complete beginner question!)

As ever, I appreciate your time in helping.

Nick

  
-- 
View this message in context: http://www.nabble.com/Template-Page-and-the-URLs-tf4946247.html#a14161459
Sent from the Wicket - User 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: Template Page and the URLs

Posted by NickCanada <nm...@ucalgary.ca>.
ok my own thread is becoming a monologue:

So i solved an issue for me with replacing components in a bookmarkable
page. Upon a panel replacement the URL would be replaced with this type of
non-bookmarkable wicket url: ?wicket:interface=:2::: . I did an ajax
replacement instead so a new whole page was not generated hence no new url. 

On further research (being a non-expert sometimes means it is hard to know
what you should be looking for) I found this link
http://www.nabble.com/Nicer-URLs-in-Wicket-tf4164954.html#a11849944 in which
Matej describes the HybridUrlCodingStrategy Class  - mounting bookmarkable
pages with this strategy turns, for example the upload page in the examples
.../wicketExamples1_X/upload/single.1 to this
.../wicketExamples1_X/upload/single.1.1  after a successful upload instead
of .../wicketExamples1_X/upload?wicket:interface=:2::: 

Thanks Matej!

One customer for Wicket in Action here.
-- 
View this message in context: http://www.nabble.com/Template-Page-and-the-URLs-tf4946247.html#a14179983
Sent from the Wicket - User 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: Template Page and the URLs

Posted by NickCanada <nm...@ucalgary.ca>.

Hey I managed to answer my own question. Sweet.

If you change the "Change Ad" link component to an AjaxLink and then
implement this onClick instead you don't end up with a non-bookmarkable url
where once you had one.

public void onClick(AjaxRequestTarget target) {
                if (currentBanner.getClass() == Banner1.class)
				{
                                     currentBanner = new Banner2("ad");
                                      currentBanner.setOutputMarkupId(true);      
					TemplatePage.this.replace(currentBanner);
				}
				else
				{
                                         currentBanner = new Banner1("ad");
                                      currentBanner.setOutputMarkupId(true);  
					TemplatePage.this.replace(currentBanner);
				}
                 target.addComponent (currentBanner);
            }

However is the non-Ajax link behaviour expected upon a Panel change within
the page? Since the page was obtained via a bookmarkable link do I HAVE to
use an AjaxLink if I want it to remain with  a bookmarkable URL?

Cheers
Nick 
-- 
View this message in context: http://www.nabble.com/Template-Page-and-the-URLs-tf4946247.html#a14163023
Sent from the Wicket - User 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