Thiago H. de Paula Figueiredo schrieb:
Em Sat, 18 Apr 2009 07:38:53 -0300, manuel aldana <ald...@gmx.de>
escreveu:
Generally I would need something more flexible how to tell whether a
parameter is read-only or editable inside the form. For my current
problem the read-only vs. editable depends on roles (i.e. different
roles have different access rights to edit certain fields).
This is easy: create a method that returns a BeanModel that will be
passed to BeanEditForm/BeanEditor. This method will remove or reorder
BeanModel properties according to your requirements.
I see, but how do I set a property to be read only?
Looking at the api
(http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/internal/beaneditor/BeanModelImpl.html)
I couldn't find such a thing.
Maybe it would be cool to add a new component parameter (readonly) to
BeanEditForm:
<beaneditform .... readonly="literal:foo,bar"/>
or even better, to let it control through page class:
<beaneditform .... readonly="prop:readOnlyParameters"/>
If/else constructs would work inside the page-template, but don't look
nice if there are many parameters. They really pollute the page template.
--
manuel aldana
ald...@gmx.de
software-engineering blog: http://www.aldana-online.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org