tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thiago H. de Paula Figueiredo" <thiag...@gmail.com>
Subject Re: Handling form events inside components
Date Fri, 04 Mar 2011 15:37:31 GMT
On Fri, 04 Mar 2011 11:57:05 -0300, Stephan Windmüller  
<stephan.windmueller@tu-dortmund.de> wrote:

> Of course. I have a page like this
>
> ---
>
> <t:layout>
>  <t:form>
>   <t:textfield t:id="name">
>   <t:anothercomponent value="otherdata"/>
>   <t:userlist source="users"/>
>  </t:form>
> </t:layout>
>
> ---
>
> The userlist is my component. It contains an editable list of users.
>
> Now I want to add buttons for actions like "move up" or "delete". When
> the surrounding form is submitted, the userlist component should perform
> the selected action. The data should be saved by the surrounding page
> afterwards.
>
> But when I change the data in the submit event like
> "onSelectedFromMoveUpButton". the sorting is overwritten by the form
> submission values.

Why don't you handle that as a non-form-submission event? Maybe you're  
overcomplicating your solution. I've implemented these actions as  
EventLinks.

I you really want to implement the way you're planning, take a look at the  
use of FormSupport in the form fields components of Tapestry, specially  
AbstractField and Hidden. It can store commands that will be executed by  
the Form component. I've never used it, though.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Mime
View raw message