So you have a CustomLabel component of some kind, right?  What you need is
to pass the Checkbox component as a parameter of type Field, and invoke
Field.getLabel().

<t:CustomLabel field="component:theCheckbox"/>
<t:Checkbox t:id="thisCheckbox" .../>

And inside CustomLabel.java:

  @Parameter(required=true)
  private Field field;

For extra credit:


<t:CustomLabel field="theCheckbox/>
<t:Checkbox t:id="thisCheckbox" .../>

And inside CustomLabel.java:

  @Parameter(required=true, defaultPrefix=BindingConstants.COMPONENT)
  private Field field;


On Tue, Jun 19, 2012 at 9:43 AM, Howard Lewis Ship <hls...@gmail.com> wrote:

> How about <t:checkbox label="prop:propertyThatProvidesLabel">?
>
>
> On Tue, Jun 19, 2012 at 8:47 AM, Norman Franke <nor...@myasd.com> wrote:
>
>> I'm creating a list of t:checkbox items and I want to label them. I can't
>> use t:label, since I need to customize the label.
>>
>> At first, I tried: ${component:myCheckItemID} since the documentation
>> says that should result in the clientId for the compoent. It doesn't, I get
>> basically the toString() of the Checkbox object. I can't do
>> ${component:myCheckItemID.clientId} either, since that results in an error.
>>
>> Short of injecting the component into my class and making it a property,
>> how do I get the clientId of the checkbox component?
>>
>> Norman Franke
>> Answering Service for Directors, Inc.
>> www.myasd.com
>>
>>
>>
>>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

Reply via email to