You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alberto Brosich <ab...@ogs.trieste.it> on 2014/02/27 15:44:43 UTC

Does wicket:link tag work inside pages in different packages?

Hi,

I have an header panel with a link to the homepage of the site.
This panel is included in every page of the site.
If I use the <wicket:link> tag for that link it works fine (for example,
it is disabled in the homepage) for the pages in the same package of the
Homepage class.
If I am on a page inside another package (subpackage in my case) the
link became the name of that package plus the href specified in the html
panel. For example:

<wicket:link><a href="HomePage.html">...</></wicket:link>

In a page inside package "subpackage" the link is:
"subpackage/HomePage.html" and not "../".

What I'm doing wrong?

Regards

Alberto


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


Re: Does wicket:link tag work inside pages in different packages?

Posted by Alberto Brosich <ab...@ogs.trieste.it>.
Yes, you are right. I will do in that way.
The fact is I have a similar problem with some menu panels with several
links. I just wanted to do the easiest thing.

Now I have another problem with subclasses and subpackages but I will
send a new mail to the list with another topic.

Many thanks

Alberto


On Sun, 2014-03-02 at 13:57 -0500, Paul Bors wrote:
> Instead of using in-line <wicket:link> why not use a <a wicket:id=“homePage”> and then add(new Link(“homePage”, HomePage.class)); to your parent class? That will resolve no matter where its used from.
> 
> After all <wicket:link> is just a Link class at the end of the day.
> Also see the examples page:
> http://www.wicket-library.com/wicket-examples/linkomatic/home
> 
> 
> On Feb 27, 2014, at 11:03 AM, Alberto Brosich <ab...@ogs.trieste.it> wrote:
> 
> > 
> > Yes, I read it.
> > Does it mean that have to do a different header panel for every
> > suppages level (using "../(../)HomePage.html" link)? 
> > 
> > Alberto
> > 
> > 
> > On Thu, 2014-02-27 at 16:30 +0100, Sven Meier wrote:
> >> Have you read http://wicket.apache.org/guide/guide/urls.html#urls_3
> >> ?
> >> 
> >> Sven
> >> 
> >> On 02/27/2014 03:44 PM, Alberto Brosich wrote:
> >>> Hi,
> >>> 
> >>> I have an header panel with a link to the homepage of the site.
> >>> This panel is included in every page of the site.
> >>> If I use the <wicket:link> tag for that link it works fine (for example,
> >>> it is disabled in the homepage) for the pages in the same package of the
> >>> Homepage class.
> >>> If I am on a page inside another package (subpackage in my case) the
> >>> link became the name of that package plus the href specified in the html
> >>> panel. For example:
> >>> 
> >>> <wicket:link><a href="HomePage.html">...</></wicket:link>
> >>> 
> >>> In a page inside package "subpackage" the link is:
> >>> "subpackage/HomePage.html" and not "../".
> >>> 
> >>> What I'm doing wrong?
> >>> 
> >>> Regards
> >>> 
> >>> Alberto
> >>> 
> >>> 
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>> 
> >> 
> >> 
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org



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


Re: Does wicket:link tag work inside pages in different packages?

Posted by Paul Bors <pa...@bors.ws>.
Instead of using in-line <wicket:link> why not use a <a wicket:id=“homePage”> and then add(new Link(“homePage”, HomePage.class)); to your parent class? That will resolve no matter where its used from.

After all <wicket:link> is just a Link class at the end of the day.
Also see the examples page:
http://www.wicket-library.com/wicket-examples/linkomatic/home


On Feb 27, 2014, at 11:03 AM, Alberto Brosich <ab...@ogs.trieste.it> wrote:

> 
> Yes, I read it.
> Does it mean that have to do a different header panel for every
> suppages level (using "../(../)HomePage.html" link)? 
> 
> Alberto
> 
> 
> On Thu, 2014-02-27 at 16:30 +0100, Sven Meier wrote:
>> Have you read http://wicket.apache.org/guide/guide/urls.html#urls_3
>> ?
>> 
>> Sven
>> 
>> On 02/27/2014 03:44 PM, Alberto Brosich wrote:
>>> Hi,
>>> 
>>> I have an header panel with a link to the homepage of the site.
>>> This panel is included in every page of the site.
>>> If I use the <wicket:link> tag for that link it works fine (for example,
>>> it is disabled in the homepage) for the pages in the same package of the
>>> Homepage class.
>>> If I am on a page inside another package (subpackage in my case) the
>>> link became the name of that package plus the href specified in the html
>>> panel. For example:
>>> 
>>> <wicket:link><a href="HomePage.html">...</></wicket:link>
>>> 
>>> In a page inside package "subpackage" the link is:
>>> "subpackage/HomePage.html" and not "../".
>>> 
>>> What I'm doing wrong?
>>> 
>>> Regards
>>> 
>>> Alberto
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


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


Re: Does wicket:link tag work inside pages in different packages?

Posted by Alberto Brosich <ab...@ogs.trieste.it>.
Yes, I read it.
Does it mean that have to do a different header panel for every
suppages level (using "../(../)HomePage.html" link)? 

Alberto


On Thu, 2014-02-27 at 16:30 +0100, Sven Meier wrote:
> Have you read http://wicket.apache.org/guide/guide/urls.html#urls_3
> ?
> 
> Sven
> 
> On 02/27/2014 03:44 PM, Alberto Brosich wrote:
> > Hi,
> >
> > I have an header panel with a link to the homepage of the site.
> > This panel is included in every page of the site.
> > If I use the <wicket:link> tag for that link it works fine (for example,
> > it is disabled in the homepage) for the pages in the same package of the
> > Homepage class.
> > If I am on a page inside another package (subpackage in my case) the
> > link became the name of that package plus the href specified in the html
> > panel. For example:
> >
> > <wicket:link><a href="HomePage.html">...</></wicket:link>
> >
> > In a page inside package "subpackage" the link is:
> > "subpackage/HomePage.html" and not "../".
> >
> > What I'm doing wrong?
> >
> > Regards
> >
> > Alberto
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org



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


Re: Does wicket:link tag work inside pages in different packages?

Posted by Sven Meier <sv...@meiers.net>.
Have you read http://wicket.apache.org/guide/guide/urls.html#urls_3
?

Sven

On 02/27/2014 03:44 PM, Alberto Brosich wrote:
> Hi,
>
> I have an header panel with a link to the homepage of the site.
> This panel is included in every page of the site.
> If I use the <wicket:link> tag for that link it works fine (for example,
> it is disabled in the homepage) for the pages in the same package of the
> Homepage class.
> If I am on a page inside another package (subpackage in my case) the
> link became the name of that package plus the href specified in the html
> panel. For example:
>
> <wicket:link><a href="HomePage.html">...</></wicket:link>
>
> In a page inside package "subpackage" the link is:
> "subpackage/HomePage.html" and not "../".
>
> What I'm doing wrong?
>
> Regards
>
> Alberto
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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