Re: Adding extra rows to a BeanEditForm / extra columns to a Grid (T5!)
Hello Thiago, Well, in Tapestry 5.0.6, if you just add a column using BeanModel.add, it doesn't show any label, unless you have a added column name-label entry in your app.properties. Don't even have such a property file, but yes - it shows a label (just tried it again to make sure). In your example down there it would be action. beanModel.add(action, null).label(any label you want, including an empty string.); Like I said, when I try giving null, an empty string or a whitespace results in a tapestry exception stating Parameter label was null or contained only whitespace. I've posted a related JIRA, https://issues.apache.org/jira/browse/TAPESTRY-1983, asking for a new parameter in Grid to add new columns without the need to create a BeanModel explicitly as we have to do now. Ah, great! Just added a comment that this would be useful for BeanEditForm too - and voted for it. :) Regad - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Adding extra rows to a BeanEditForm / extra columns to a Grid (T5!)
Hello Thiago, great, works fine! Thank you very much - seems I overlooked the this may be null for a synthetic or placeholder property in the JavaDoc completly. Is there any way to get the grid to not display any name in the header of my synthetic column? I know how to change it, but giving null, an empty string or a whitespace results in a tapestry exception stating Parameter label was null or contained only whitespace. Regards, Tobias Thiago H de Paula Figueiredo schrieb: On Fri, 14 Dec 2007 13:57:54 -0200, Tobias Wehrum [EMAIL PROTECTED] wrote: Tobias Wehrum schrieb: Hello everyone! Is there a way to add extra rows to a BeanEditForm and extra columns to a Grid - rows / columns which doesn't represent a property of the given model? I need it to edit or show values which are relevant for the model, but like I said not included in it, as well as present links in an own column like edit, delete, move etc.. Now, you need to create a BeanModel in your page class and pass it to the Grid: @Inject private BeanModelSource beanModelSource; @Inject private ComponentResources componentResources; public BeanModel getBeanModel() { BeanModel beanModel = beanModelSource.create(YourClassnameHere.class, false, componentResources); beanModel.add(action, null); // action is just a name I chose. return beanModel; } Then, inside your Grid, provide the template for your column: t:parameter name=actionCell !-- Note that the name parameter must be the parameter passed to BeanModel.add concatenated with Cell -- Your links here! :) /t:parameter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Adding extra rows to a BeanEditForm / extra columns to a Grid (T5!)
On Fri, 14 Dec 2007 14:44:11 -0200, Tobias Wehrum [EMAIL PROTECTED] wrote: Hello Thiago, great, works fine! Thank you very much - seems I overlooked the this may be null for a synthetic or placeholder property in the JavaDoc completly. You're welcome! :) Is there any way to get the grid to not display any name in the header of my synthetic column? I know how to change it, but giving null, an empty string or a whitespace results in a tapestry exception stating Parameter label was null or contained only whitespace. Well, in Tapestry 5.0.6, if you just add a column using BeanModel.add, it doesn't show any label, unless you have a added column name-label entry in your app.properties. On the other hand, you can do: beanModel.add(action, null).label(any label you want, including an empty string.); I've posted a related JIRA, https://issues.apache.org/jira/browse/TAPESTRY-1983, asking for a new parameter in Grid to add new columns without the need to create a BeanModel explicitly as we have to do now. -- Thiago H. de Paula Figueiredo Desenvolvedor, Instrutor e Consultor de Tecnologia Eteg Tecnologia da Informação Ltda. http://www.eteg.com.br - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]