Re: Validation of a component inside a Form

2010-09-15 Thread Thiago H. de Paula Figueiredo
On Wed, 15 Sep 2010 02:45:53 -0300, Stephan Windmüller wrote: On 14.09.2010 18:30, Josh Canfield wrote: Flash persistence is good for getting data between the action and render requests. Tapestry does redirect after every event so you'd generally set the value in an action request so you ca

Re: Validation of a component inside a Form

2010-09-14 Thread Stephan Windmüller
On 14.09.2010 18:30, Josh Canfield wrote: > Flash persistence is good for getting data between the action and > render requests. Tapestry does redirect after every event so you'd > generally set the value in an action request so you can use it in the > render request, or vice versa I suppose. Yes

Re: Validation of a component inside a Form

2010-09-14 Thread Josh Canfield
Flash persistence is good for getting data between the action and render requests. Tapestry does redirect after every event so you'd generally set the value in an action request so you can use it in the render request, or vice versa I suppose. It took some considering to come up with why you might

Re: Validation of a component inside a Form

2010-09-14 Thread Stephan Windmüller
On 14.09.2010 15:14, Thiago H. de Paula Figueiredo wrote: > I think your component shouldn't extend AbstractField. Okay, but in either case the data is not set correctly. In the surrounding page I defined the "users" object as a List with flash persistence. In the onPrepare method I check if it

Re: Validation of a component inside a Form

2010-09-14 Thread Thiago H. de Paula Figueiredo
On Tue, 14 Sep 2010 09:29:13 -0300, Stephan Windmüller wrote: On 14.09.2010 13:28, Thiago H. de Paula Figueiredo wrote: The added values inside the component are not stored in form fields but in a mapped Java class with Flash Persistence. Is it possible to retrieve these values, too? In th

Re: Validation of a component inside a Form

2010-09-14 Thread Stephan Windmüller
On 14.09.2010 13:28, Thiago H. de Paula Figueiredo wrote: >> The added values inside the component are not stored in form fields but >> in a mapped Java class with Flash Persistence. Is it possible to >> retrieve these values, too? > In this case, your component does not represent a form field and

Re: Validation of a component inside a Form

2010-09-14 Thread Thiago H. de Paula Figueiredo
On Tue, 14 Sep 2010 04:44:29 -0300, Stephan Windmüller wrote: On 13.09.2010 17:01, Thiago H. de Paula Figueiredo wrote: The line String submittedValue = request.getParameter(elementName); produces "null" every time. You'll have to generate the id and name of the HTML form fields

Re: Validation of a component inside a Form

2010-09-14 Thread Stephan Windmüller
On 13.09.2010 17:01, Thiago H. de Paula Figueiredo wrote: >> The line >>> String submittedValue = request.getParameter(elementName); >> produces "null" every time. > You'll have to generate the id and name of the HTML form fields in a way > that you can get them back when the form is su

Re: Validation of a component inside a Form

2010-09-13 Thread Thiago H. de Paula Figueiredo
On Mon, 13 Sep 2010 11:56:17 -0300, Stephan Windmüller wrote: The line String submittedValue = request.getParameter(elementName); produces "null" every time. You'll have to generate the id and name of the HTML form fields in a way that you can get them back when the form is su

Re: Validation of a component inside a Form

2010-09-13 Thread Stephan Windmüller
On 13.09.2010 16:21, Thiago H. de Paula Figueiredo wrote: > It doesn't require much background knowledge. Just take a look at this > method implementation in the Select component: Thanks for the hint. I tried it, but it does not work. I do not know if this has to do with my problem but submitt

Re: Validation of a component inside a Form

2010-09-13 Thread Thiago H. de Paula Figueiredo
On Mon, 13 Sep 2010 10:26:51 -0300, Stephan Windmüller wrote: tracker.recordError(...); If one of this components creates form fields, a good approach is to make> the component an AbstractField sublclass. That requires an implementation of processSubmission and this in turn requires some

Re: Validation of a component inside a Form

2010-09-13 Thread Stephan Windmüller
On 13.09.2010 14:47, Thiago H. de Paula Figueiredo wrote: >> Is it possible to send validation errors to the outer form in which a >> component is used? > @Environmental > private ValidationTracker tracker; That works, thanks for the quick reply! > tracker.recordError(...); > If one of this comp

Re: Validation of a component inside a Form

2010-09-13 Thread Thiago H. de Paula Figueiredo
On Mon, 13 Sep 2010 09:36:40 -0300, Stephan Windmüller wrote: Hi! Hi! Is it possible to send validation errors to the outer form in which a component is used? @Environmental private ValidationTracker tracker; tracker.recordError(...); If one of this components creates form fields, a g