Thanks a lot, I 'll try it.
Francois Armand a écrit :
Michael Courcy wrote:
Hi
I was really interested on how we could handle the edition of an
entire list in a single page with T5.
Let's say a List<Person> in a situation where we want the user to be
able to edit the name and surname of all in a single request.
What could be the more elegant solution ?
I have a listEditor that build a list of property editor with the
possibility to add/remove/update properties.
I built it to handle simple properties (String, Enum, date...), but it
seems to work as long as you have an editor associated with the
property type : I use it to handle a list of criterion, which are a
complex object (well, complex...). In your case, you would have to
define a personEditor (surely just a beanEditor).
It should (at least :) need a lot more of polish, but it work rather
nicely.
For example, if you want to edit a list of string, say "bleue", "red"
and that the editor for String is "text", the rendered template is :
------------------------
[blue] <remove>
[red] <remove>
<add>
------------------------
The "[]" are text input fields, "<>" are buttons.
The component generate event on button selection so that the parent
element can handle matching action (add or remove element, with
perhaps other business logic).
The project is open source, but the browse SVN is still broken (OW2
plateform... no comment).
Thought, you can checkout the source at this address :
--
svn://svn.forge.objectweb.org/svnroot/interldap/interldap-wui-common/trunk
--
The component is in
src/main/java/org.interldap.wui.t5lib.components/ListEditor.java.
Example of use are available in
src/main/java/org/interldap/wui/t5lib/components/eschema/EditClass and
EditAttribute.
If the god of spare time is with me, I will try to contribute to some
component repository or another the code in January, cleaner and
documented.
--
Michael Courcy
http://courcy.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]