make a getter in the page:

public String getName() {
    return String.format("%s %s", user.getFirstname(), user.gestLastname());
}

and in the tml:

<table t:type="grid" t:model="mymodel" t:source="users" row="user" xmlns:p="tapestry:parameter">
    <p:nameCell>
        ${name}
    </p:nameCell>
</table>



Kai Weber schrieb:
I have a Bean and want to display a combination of two fields in my Grid.

public class User {
  String getFirstname(){...}
  String getLastname(){...}
}

I use BeanModel in my Page class and tried to find a way to do it 
programmatically, but failed. This way works:

myModel = beanModelSource.createDisplayModel(User.class, 
componentResources.getMessages());

...

<table t:type="grid" t:model="mymodel" t:source="users" row="user">
    <t:parameter name="nameCell">
        ${user.firstname} ${user.lastname}
    </t:parameter>
</table>
But, is this the really the only way? I wanted to customize the display of the 
name cell in Java.

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

Reply via email to