For my application, I will need to allow users to enter their own (essentially random) e-mail addresses. The Palette component seems to require a pre-defined set of available options, which unfortunately does not meet my particular requirement. So I will continue work on my own custom property editor.

I discovered that the BeanEditForm guide page almost completely neglects to discuss PropertyEditContext objects, knowledge of which seem rather critical to fully understanding how to create a custom property editor. I found some discussion of PropertyEditContext at the following wiki topic.

http://wiki.apache.org/tapestry/Tapestry5HowToCreateAPropertyEditBlock

I believe I now have the general idea and will start working out the details by experimenting in code.I may yet have questions, but at least I know where I'm headed now. Many thanks for pointing me in the correct direction.

Yancey




On Apr 18, 2009, at 9:27 PM, Thiago H. de Paula Figueiredo wrote:

Em Sat, 18 Apr 2009 16:48:03 -0300, Yeargan Yancey <yan...@unt.edu>
escreveu:

Before I go banging my head against a wall for too long, is it
possible to create a custom property editor to handle a complex (multi-
valued) property?

Yes! :) There's a guide here:
http://tapestry.apache.org/tapestry5/guide/beaneditform.html. If it is not
enough, post yourr doubts here and we'll try to help you. ;)

I am working with a directory services database via LDAP and it would
be extremely helpful if I can mange to enhance BeanEditForm and
BeanDisplay to handle LDAP entries where a property (LDAP attribute)
may have multiple values.

To be more specific, I want to create a property editor for the
String[] type. At the moment, I just want to display String[]
properties using the BeanDisplay component, but I can already foresee
a need to be able to fully edit a String[] property (including
adding / removing values from the array, using AJAX to add/remove
fields to the form).

Have you taken a look at the Palette component? It looks like it it
already implements what you need:
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Palette.html .
It, together with a custom DataTypeAnalyzer, one view block (for
BeanDisplay) and one edit block (for BeanEditForm/BeanEditor). The
BeanEditForm guide previously mentioned tells you how to do it.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to