You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Stephane Decleire <sd...@cariboo-networks.com> on 2007/01/23 15:32:33 UTC

Default namespace in a library ?

Hi,

Is there a default namespace that one can use in a library similar to 
the default "application" namespace for an application ?
I have 2 pages in a library (say Page1 and Page2). When i make a link on 
one of those pages from an application page, i use the id i have 
declared in the <library> tag of my application as a namespace (say 
lib:Page1) and everything is ok.
But i need a link between the 2 pages of my library (from Page1 to 
Page2). I can't use the "lib" namespace which is associated to the 
application. And with no namespace, i have the following error :
    Page 'Page2' not found in application namespace.
Any idea ?

--
Stéphane Decleire



Re: Default namespace in a library ?

Posted by Stephane Decleire <sd...@cariboo-networks.com>.
Not as elegant as an annotation but that works.

Thanks a lot !

--
Stéphane Decleire


Robert Binna a écrit :
> Thats true, but you could create a method instead of your annotated 
> method with the following content.
>
> IPage getPage()  {
>    return getRequestCycle().getPage(getNamespace().getId() + ":" + 
> pageName);
> }
>
> Stephane Decleire wrote:
>
>> Thanks Robert but that solution can't be used in the @InjectPage 
>> annotation which needs a constant value ... :-(
>>
>> -- 
>> Stéphane Decleire
>>
>>
>>
>> Robert Binna a écrit :
>>
>>> Hi
>>>
>>> You could try the following. In the page you have the method 
>>> getNamespace().getId() which returns you the id of the namespace the 
>>> page is currently registered in, so if you want to link ot a page 
>>> with in the same namespace you can link to getNamespace().getId() + 
>>> ":" + pageName
>>> If someone has a more ellegant solution, I would also be very happy 
>>> ;-).
>>>
>>> Kind regards,
>>>                   Robert
>>>
>>> Stephane Decleire wrote:
>>>
>>>> Hi,
>>>>
>>>> Is there a default namespace that one can use in a library similar 
>>>> to the default "application" namespace for an application ?
>>>> I have 2 pages in a library (say Page1 and Page2). When i make a 
>>>> link on one of those pages from an application page, i use the id i 
>>>> have declared in the <library> tag of my application as a namespace 
>>>> (say lib:Page1) and everything is ok.
>>>> But i need a link between the 2 pages of my library (from Page1 to 
>>>> Page2). I can't use the "lib" namespace which is associated to the 
>>>> application. And with no namespace, i have the following error :
>>>>    Page 'Page2' not found in application namespace.
>>>> Any idea ?
>>>>
>>>> -- 
>>>> Stéphane Decleire
>>>>
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

Re: Default namespace in a library ?

Posted by Robert Binna <r....@synedra.com>.
Thats true, but you could create a method instead of your annotated 
method with the following content.

IPage getPage()  {
    return getRequestCycle().getPage(getNamespace().getId() + ":" + 
pageName);
}

Stephane Decleire wrote:

> Thanks Robert but that solution can't be used in the @InjectPage 
> annotation which needs a constant value ... :-(
>
> -- 
> Stéphane Decleire
>
>
>
> Robert Binna a écrit :
>
>> Hi
>>
>> You could try the following. In the page you have the method 
>> getNamespace().getId() which returns you the id of the namespace the 
>> page is currently registered in, so if you want to link ot a page 
>> with in the same namespace you can link to getNamespace().getId() + 
>> ":" + pageName
>> If someone has a more ellegant solution, I would also be very happy ;-).
>>
>> Kind regards,
>>                   Robert
>>
>> Stephane Decleire wrote:
>>
>>> Hi,
>>>
>>> Is there a default namespace that one can use in a library similar 
>>> to the default "application" namespace for an application ?
>>> I have 2 pages in a library (say Page1 and Page2). When i make a 
>>> link on one of those pages from an application page, i use the id i 
>>> have declared in the <library> tag of my application as a namespace 
>>> (say lib:Page1) and everything is ok.
>>> But i need a link between the 2 pages of my library (from Page1 to 
>>> Page2). I can't use the "lib" namespace which is associated to the 
>>> application. And with no namespace, i have the following error :
>>>    Page 'Page2' not found in application namespace.
>>> Any idea ?
>>>
>>> -- 
>>> Stéphane Decleire
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>


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


Re: Default namespace in a library ?

Posted by Stephane Decleire <sd...@cariboo-networks.com>.
Thanks Robert but that solution can't be used in the @InjectPage 
annotation which needs a constant value ... :-(

--
Stéphane Decleire



Robert Binna a écrit :
> Hi
>
> You could try the following. In the page you have the method 
> getNamespace().getId() which returns you the id of the namespace the 
> page is currently registered in, so if you want to link ot a page with 
> in the same namespace you can link to getNamespace().getId() + ":" + 
> pageName
> If someone has a more ellegant solution, I would also be very happy ;-).
>
> Kind regards,
>                   Robert
>
> Stephane Decleire wrote:
>
>> Hi,
>>
>> Is there a default namespace that one can use in a library similar to 
>> the default "application" namespace for an application ?
>> I have 2 pages in a library (say Page1 and Page2). When i make a link 
>> on one of those pages from an application page, i use the id i have 
>> declared in the <library> tag of my application as a namespace (say 
>> lib:Page1) and everything is ok.
>> But i need a link between the 2 pages of my library (from Page1 to 
>> Page2). I can't use the "lib" namespace which is associated to the 
>> application. And with no namespace, i have the following error :
>>    Page 'Page2' not found in application namespace.
>> Any idea ?
>>
>> -- 
>> Stéphane Decleire
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

Re: Default namespace in a library ?

Posted by Robert Binna <r....@synedra.com>.
Hi

You could try the following. In the page you have the method 
getNamespace().getId() which returns you the id of the namespace the 
page is currently registered in, so if you want to link ot a page with 
in the same namespace you can link to getNamespace().getId() + ":" + 
pageName
If someone has a more ellegant solution, I would also be very happy ;-).

Kind regards,
                   Robert

Stephane Decleire wrote:

> Hi,
>
> Is there a default namespace that one can use in a library similar to 
> the default "application" namespace for an application ?
> I have 2 pages in a library (say Page1 and Page2). When i make a link 
> on one of those pages from an application page, i use the id i have 
> declared in the <library> tag of my application as a namespace (say 
> lib:Page1) and everything is ok.
> But i need a link between the 2 pages of my library (from Page1 to 
> Page2). I can't use the "lib" namespace which is associated to the 
> application. And with no namespace, i have the following error :
>    Page 'Page2' not found in application namespace.
> Any idea ?
>
> -- 
> Stéphane Decleire
>
>
>


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