Actually you mentioned something that interested me before and is generalization of the problem I described below.

There are frequent cases when I want to create some "edit" component for some domain class which on the web page requires more than one HTML form field. I noticed this AbstractField class, but I always thought it is only suitable for components that render *only one* HTML form field as output, and not some multiple HTML form elements.

For example, I have domain class Month that contains 2 fields - year and monthOfYear. And I would like to have corresponding "edit" component for editing this domain class and it would require to have 2 HTML selects - one for year and other one for monthOfYear, so user could pick desired month such as 07/2009 via these 2 selects. Maybe I could start developing this components such as :

public MonthField extends AbstractField {
...

and it should have template with 2 select components and so on... Is this the way you would develop it?

-Vjeran

----- Original Message ----- From: "Thiago H. de Paula Figueiredo" <thiag...@gmail.com>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Friday, July 31, 2009 4:21 PM
Subject: Re: How to fetch Form from within "afterSubmit" handler?


Em Fri, 31 Jul 2009 02:13:14 -0300, Vjeran Marcinko
<vjeran.marci...@email.t-com.hr> escreveu:

Hello,

Hi!

I have created multi-form-field component (eg, DateRangeEditor component
that has two DatePickers inside that are used to set "start" and "end"
dates for DateRange domain class).

Why don't you subclass AbstractField? It already does most of the work you
need to do when creating a form field. No need to use SubmitNotifier, just
implement the processSubmission() method. A good example is the source of
the Select component.
To implement validation, take a look at the FormValidationSupport
interface.

--
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



--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.392 / Virus Database: 270.13.37/2273 - Release Date: 07/30/09 18:09:00


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

Reply via email to