You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Pratibha Gopalam <pr...@ltp.soft.net> on 2006/05/30 07:13:48 UTC

Dynamic assigning component id

Hello,

Is there a way of dynamically assigning a component id at runtime? For 
example if I creating components in a for loop and I want to assign the 
component ids at runtime, is that possible?

Tapestery doesn't allow me to use a ognl expression for jwcid like 
jwcid="ognl:categoryName".  Is there any other way?

Thanks,
Pratibha

------------------------------DISCLAIMER------------------------------
This message is for the named person's use only. It may contain 
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission. 

If you receive this message in error, please immediately delete it and 
all copies of it from your system, destroy any hard copies of it and 
notify the sender. You must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message if you are not the 
intended recipient. 

Lisle Technology Partners Pvt. Ltd. and any of its subsidiaries each 
reserve the right to monitor all e-mail communications through its 
networks. 

Any views expressed in this message are those of the 
individual sender, except where the message states otherwise and the 
sender is authorized to state them to be the views of any such entity.

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


Re: Dynamic assigning component id

Posted by Pratibha Gopalam <pr...@ltp.soft.net>.
Great! Thanks a lot!

Mike Snare wrote:

> thanks!
>
> -Mike
>
> On 5/30/06, Nick Westgate <ni...@key-planning.co.jp> wrote:
>
>> A tip: note that you don't need the element attribute for components
>> that default it to templateTag (check the .jwc file). DRY ;-)
>>
>> So just
>> <span jwcid="@Any" id="ognl:componentId"/>
>> is fine.
>>
>> Cheers,
>> Nick.
>>
>>
>> Mike Snare wrote:
>> > Right.  You have to use jwcid otherwise it's not a tapestry component.
>> > Keep using jwcid, but also use plain old id.  For an implicit
>> > component, it would look something like this:
>> >
>> > <span jwcid="@Any" id="ognl:componentId" element="span" />
>> >
>> > -Mike
>>


------------------------------DISCLAIMER------------------------------
This message is for the named person's use only. It may contain 
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission. 

If you receive this message in error, please immediately delete it and 
all copies of it from your system, destroy any hard copies of it and 
notify the sender. You must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message if you are not the 
intended recipient. 

Lisle Technology Partners Pvt. Ltd. and any of its subsidiaries each 
reserve the right to monitor all e-mail communications through its 
networks. 

Any views expressed in this message are those of the 
individual sender, except where the message states otherwise and the 
sender is authorized to state them to be the views of any such entity.

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


Re: Dynamic assigning component id

Posted by Mike Snare <mi...@gmail.com>.
thanks!

-Mike

On 5/30/06, Nick Westgate <ni...@key-planning.co.jp> wrote:
> A tip: note that you don't need the element attribute for components
> that default it to templateTag (check the .jwc file). DRY ;-)
>
> So just
> <span jwcid="@Any" id="ognl:componentId"/>
> is fine.
>
> Cheers,
> Nick.
>
>
> Mike Snare wrote:
> > Right.  You have to use jwcid otherwise it's not a tapestry component.
> > Keep using jwcid, but also use plain old id.  For an implicit
> > component, it would look something like this:
> >
> > <span jwcid="@Any" id="ognl:componentId" element="span" />
> >
> > -Mike
>
> ---------------------------------------------------------------------
> 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: Dynamic assigning component id

Posted by Nick Westgate <ni...@key-planning.co.jp>.
A tip: note that you don't need the element attribute for components
that default it to templateTag (check the .jwc file). DRY ;-)

So just
<span jwcid="@Any" id="ognl:componentId"/>
is fine.

Cheers,
Nick.


Mike Snare wrote:
> Right.  You have to use jwcid otherwise it's not a tapestry component.
> Keep using jwcid, but also use plain old id.  For an implicit
> component, it would look something like this:
> 
> <span jwcid="@Any" id="ognl:componentId" element="span" />
> 
> -Mike

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


Re: Dynamic assigning component id

Posted by Mike Snare <mi...@gmail.com>.
Right.  You have to use jwcid otherwise it's not a tapestry component.
 Keep using jwcid, but also use plain old id.  For an implicit
component, it would look something like this:

<span jwcid="@Any" id="ognl:componentId" element="span" />

-Mike

On 5/30/06, Andreas Bulling <sp...@phoenix.hadiko.de> wrote:
> On 30. Mai 2006 - 16:19:37, Pratibha Gopalam wrote:
> | Thanks for the reply.
> |
> | In the template (.html) we normally use the jwcid to give a id and tell
> | tapestry what type of component to instantiate. How do I do the same
> | thing with id?
> |
> | <span jwcid=someid@Block > -- </span> -- this works, but the id
> | 'someid' is static. Now I want to make that dynamic.
> |
> | <span id ="ognl:myId" type="Block" > -- <span> : This doesn't work
> | because tapestry looks for jwcid to create the components. If I move the
> | component declaration to the page file, the id is again static there.
>
> From my understanding of his mail I'd use _both_ jwcid and the id
> attribute - perhaps that works?
>
> Cheers,
>   Andreas
>
> ---------------------------------------------------------------------
> 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: Dynamic assigning component id

Posted by Andreas Bulling <sp...@phoenix.hadiko.de>.
On 30. Mai 2006 - 16:19:37, Pratibha Gopalam wrote:
| Thanks for the reply.
| 
| In the template (.html) we normally use the jwcid to give a id and tell 
| tapestry what type of component to instantiate. How do I do the same 
| thing with id?
| 
| <span jwcid=someid@Block > -- </span> -- this works, but the id  
| 'someid' is static. Now I want to make that dynamic.
| 
| <span id ="ognl:myId" type="Block" > -- <span> : This doesn't work 
| because tapestry looks for jwcid to create the components. If I move the 
| component declaration to the page file, the id is again static there.

>From my understanding of his mail I'd use _both_ jwcid and the id
attribute - perhaps that works?

Cheers,
  Andreas

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


Re: Dynamic assigning component id

Posted by Pratibha Gopalam <pr...@ltp.soft.net>.
Thanks for the reply.

In the template (.html) we normally use the jwcid to give a id and tell 
tapestry what type of component to instantiate. How do I do the same 
thing with id?

<span jwcid=someid@Block > -- </span> -- this works, but the id  
'someid' is static. Now I want to make that dynamic.

<span id ="ognl:myId" type="Block" > -- <span> : This doesn't work 
because tapestry looks for jwcid to create the components. If I move the 
component declaration to the page file, the id is again static there.

If possible can you please send me the code snippet as to how you could 
do that?

thanks,
Pratibha

Mike Snare wrote:

> Just use id, not jwcid.  The jwcid tells it which component in the
> .jwc/page file to use, but the id can be set however you wish.  I just
> did that on a few custom components I've written so I know it works.
> I imagine there may be some components for which it doesn't if ID is
> reserved, but I don't know.
>
> Give it a shot.
>
> On 5/30/06, Pratibha Gopalam <pr...@ltp.soft.net> wrote:
>
>> Hello,
>>
>> Is there a way of dynamically assigning a component id at runtime? For
>> example if I creating components in a for loop and I want to assign the
>> component ids at runtime, is that possible?
>>
>> Tapestery doesn't allow me to use a ognl expression for jwcid like
>> jwcid="ognl:categoryName".  Is there any other way?
>>
>> Thanks,
>> Pratibha
>>


------------------------------DISCLAIMER------------------------------
This message is for the named person's use only. It may contain 
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission. 

If you receive this message in error, please immediately delete it and 
all copies of it from your system, destroy any hard copies of it and 
notify the sender. You must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message if you are not the 
intended recipient. 

Lisle Technology Partners Pvt. Ltd. and any of its subsidiaries each 
reserve the right to monitor all e-mail communications through its 
networks. 

Any views expressed in this message are those of the 
individual sender, except where the message states otherwise and the 
sender is authorized to state them to be the views of any such entity.

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


Re: Dynamic assigning component id

Posted by Mike Snare <mi...@gmail.com>.
Just use id, not jwcid.  The jwcid tells it which component in the
.jwc/page file to use, but the id can be set however you wish.  I just
did that on a few custom components I've written so I know it works.
I imagine there may be some components for which it doesn't if ID is
reserved, but I don't know.

Give it a shot.

On 5/30/06, Pratibha Gopalam <pr...@ltp.soft.net> wrote:
> Hello,
>
> Is there a way of dynamically assigning a component id at runtime? For
> example if I creating components in a for loop and I want to assign the
> component ids at runtime, is that possible?
>
> Tapestery doesn't allow me to use a ognl expression for jwcid like
> jwcid="ognl:categoryName".  Is there any other way?
>
> Thanks,
> Pratibha
>
> ------------------------------DISCLAIMER------------------------------
> This message is for the named person's use only. It may contain
> confidential, proprietary or legally privileged information. No
> confidentiality or privilege is waived or lost by any mistransmission.
>
> If you receive this message in error, please immediately delete it and
> all copies of it from your system, destroy any hard copies of it and
> notify the sender. You must not, directly or indirectly, use, disclose,
> distribute, print, or copy any part of this message if you are not the
> intended recipient.
>
> Lisle Technology Partners Pvt. Ltd. and any of its subsidiaries each
> reserve the right to monitor all e-mail communications through its
> networks.
>
> Any views expressed in this message are those of the
> individual sender, except where the message states otherwise and the
> sender is authorized to state them to be the views of any such entity.
>
> ---------------------------------------------------------------------
> 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