You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Bill Holloway <bi...@peoplepad.com> on 2008/04/22 03:43:51 UTC

T5: Form in a loop with PropertyEditor and custom type editor

This is kind of a reprise of an earlier e-mail, but it's more narrowed down
and easy to reproduce.

I have a form in a loop (in a cell parameter basically).  The form is very
simple.  It has a propertyeditor component which edits a custom data type.
I have defined a custom component which inherits from AbstractField to edit
that type -- this custom component implements processSubmission.

Looking at the parameter names coming from the submission of the form, I
notice that the field in the looped-over form always has a "_n" tacked onto
its parameter name.  This makes perfect sense since the form is in a loop.

However, the elementName argument to process submission does not have this
integer tacked on, and there's no way to know which parameter to pull out.

Any thoughts on how to solve this dilemma?  I.e., how to capture the integer
value in my custom editor so I can grab the right parameter?

-- 
Bill @ PeoplePad

RE: T5: Form in a loop with PropertyEditor and custom type editor

Posted by Jonathan Barker <jo...@gmail.com>.
Bill,

If I understand correctly what you are trying to do, you probably want to
use the context parameter on your Form element.  For example, you might
have:

<t:grid source="source" row="rowObject">
<t:parameter name="editCell">
<form t:type="Form" t:id="editForm" context="rowObject.id">
	<!-- your select goes here -->
</form>
</t:parameter>
</t:grid>

You would then have 
public void onSuccessFromEditForm(Long id){
}

Jonathan



> -----Original Message-----
> From: Bill Holloway [mailto:bill@peoplepad.com]
> Sent: Monday, April 21, 2008 9:44 PM
> To: Tapestry users
> Subject: T5: Form in a loop with PropertyEditor and custom type editor
> 
> This is kind of a reprise of an earlier e-mail, but it's more narrowed
> down
> and easy to reproduce.
> 
> I have a form in a loop (in a cell parameter basically).  The form is very
> simple.  It has a propertyeditor component which edits a custom data type.
> I have defined a custom component which inherits from AbstractField to
> edit
> that type -- this custom component implements processSubmission.
> 
> Looking at the parameter names coming from the submission of the form, I
> notice that the field in the looped-over form always has a "_n" tacked
> onto
> its parameter name.  This makes perfect sense since the form is in a loop.
> 
> However, the elementName argument to process submission does not have this
> integer tacked on, and there's no way to know which parameter to pull out.
> 
> Any thoughts on how to solve this dilemma?  I.e., how to capture the
> integer
> value in my custom editor so I can grab the right parameter?
> 
> --
> Bill @ PeoplePad


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