You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mark <ma...@xeric.net> on 2011/02/08 18:38:45 UTC

Annotation for Field Description

I am working on a project where the datamodel is being changed
frequently.  The bean edit form is a huge timesaver because it changes
automatically and I don't have to go in an edit every form.

However, I'm finding that I need a bit more explanatory information
for my test users.  I know I can override the fields like this:
       <t:beaneditform t:id="user" submitlabel="message:create-user">
            <p:age>
                <t:label for="age"/>
                <t:textfield t:id="age" value="user.age"/>
                <em>
                    Users must be between 18 and 99.
                </em>
            </p:age>
        </t:beaneditform>

But then I have to maintain the .tml file more than I'd like at this stage.

Does anyone have any suggestions on how to get a bit more descriptive
information to the users from the .java page or a messages file
without needing to edit the .tml and override

For example an annotation that will give you a tooltip or fill in the
<em> tags as shown above would work, but I'm open to any suggestions
and looking for the simplest solution.

Mark

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


Re: Annotation for Field Description

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 08 Feb 2011 21:55:01 -0200, Mark <ma...@xeric.net> wrote:

> The mixin approach sounds reasonable, but I'm not sure how to approach
> changing what gets rendered in each row of the bean editor.  I'm not
> sure how to go about changing the functionality of an existing
> components.

This mixin wouldn't change the functionality of anything. It would just  
change what the component rendered after it was rendered.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: Annotation for Field Description

Posted by Mark <ma...@xeric.net>.
The mixin approach sounds reasonable, but I'm not sure how to approach
changing what gets rendered in each row of the bean editor.  I'm not
sure how to go about changing the functionality of an existing
components.

The mixins that I'm familiar with usually add some code to the page or
to the component, but it looks like what I need to attach to with the
BeanEditForm is several layers deep of components within components
and I'm not sure the best approach for that.

Is there a way to inject functionality into the bean editor?  Is it
better to try to just extend the bean editor?

Any suggestions would be helpful--particularly if there are any
examples even remotely similar that I may have overlooked.

Mark

On Tue, Feb 8, 2011 at 3:10 PM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> Please file a JIRA asking for an additional parameter (<p:xxxDescription>,
> for example) in BeanEditor/BeanEditForm that is put inside the field edition
> block. Or some other message key convention, such as xxx-description, to do
> the same without any markup customization. Meanwhile, you could try writing
> a mixin that adds the descriptions after BeanEditor/BeanEditForm is
> rendered.
>
> On Tue, 08 Feb 2011 18:03:08 -0200, Mark <ma...@xeric.net> wrote:
>
>> On Tue, Feb 8, 2011 at 12:53 PM, LLTYK <LL...@mailinator.com> wrote:
>>>
>>> A more descriptive label would be easy, just add the keys to the
>>> properties
>>> file. More than that will probably delve into custom decorator or
>>> property
>>> block territory.
>>
>> I need the label to stay the same. I'm familiar with the property
>> block, but my goal is to be able to create this without needing to
>> customize the .tml file.
>>
>> Ideally what I want is something like this:
>>
>> class Person {
>>   @ToolTip("The first name of the person being edited")
>>   String firstName;
>>   @ToolTip("The last name of the person being edited")
>>   String lastName;
>>
>>   //getters and setters
>>
>> }
>>
>> Assuming I can figure out how to setup the annotation, what is the
>> best way to change the filed names on the the bean edit form, without
>> resorting to creating a parameter for each attribute?
>>
>> I looked at some of the custom decorator documentation, but it seems
>> designed for modifying services rather than components.
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
> Coordenador e professor da Especialização em Engenharia de Software com
> Ênfase em Java da Faculdade Pitágoras
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> 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: Annotation for Field Description

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Please file a JIRA asking for an additional parameter (<p:xxxDescription>,  
for example) in BeanEditor/BeanEditForm that is put inside the field  
edition block. Or some other message key convention, such as  
xxx-description, to do the same without any markup customization.  
Meanwhile, you could try writing a mixin that adds the descriptions after  
BeanEditor/BeanEditForm is rendered.

On Tue, 08 Feb 2011 18:03:08 -0200, Mark <ma...@xeric.net> wrote:

> On Tue, Feb 8, 2011 at 12:53 PM, LLTYK <LL...@mailinator.com> wrote:
>>
>> A more descriptive label would be easy, just add the keys to the  
>> properties
>> file. More than that will probably delve into custom decorator or  
>> property
>> block territory.
>
> I need the label to stay the same. I'm familiar with the property
> block, but my goal is to be able to create this without needing to
> customize the .tml file.
>
> Ideally what I want is something like this:
>
> class Person {
>    @ToolTip("The first name of the person being edited")
>    String firstName;
>    @ToolTip("The last name of the person being edited")
>    String lastName;
>
>    //getters and setters
>
> }
>
> Assuming I can figure out how to setup the annotation, what is the
> best way to change the filed names on the the bean edit form, without
> resorting to creating a parameter for each attribute?
>
> I looked at some of the custom decorator documentation, but it seems
> designed for modifying services rather than components.
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
Coordenador e professor da Especialização em Engenharia de Software com  
Ênfase em Java da Faculdade Pitágoras
http://www.arsmachina.com.br

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


Re: Annotation for Field Description

Posted by Mark <ma...@xeric.net>.
On Tue, Feb 8, 2011 at 12:53 PM, LLTYK <LL...@mailinator.com> wrote:
>
> A more descriptive label would be easy, just add the keys to the properties
> file. More than that will probably delve into custom decorator or property
> block territory.

I need the label to stay the same. I'm familiar with the property
block, but my goal is to be able to create this without needing to
customize the .tml file.

Ideally what I want is something like this:

class Person {
   @ToolTip("The first name of the person being edited")
   String firstName;
   @ToolTip("The last name of the person being edited")
   String lastName;

   //getters and setters

}

Assuming I can figure out how to setup the annotation, what is the
best way to change the filed names on the the bean edit form, without
resorting to creating a parameter for each attribute?

I looked at some of the custom decorator documentation, but it seems
designed for modifying services rather than components.

Mark

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


Re: Annotation for Field Description

Posted by LLTYK <LL...@mailinator.com>.
A more descriptive label would be easy, just add the keys to the properties
file. More than that will probably delve into custom decorator or property
block territory.
-- 
View this message in context: http://tapestry-users.832.n2.nabble.com/Annotation-for-Field-Description-tp6004837p6005098.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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