On Mon, 21 Jul 2014 05:14:33 -0300, nn kk <inv...@abv.bg> wrote:
I have a form with many inputs, selects, etc, which I want to submit. Some of these inputs are in some custom components in order to reduce repeating code and to add some specific behavior visual as some dynamic css passed to the custom components and functional as some of them are fileuploads for example so I need to access them and get the files or do something by the submit. The form also have dynamic number of components. Let's say I have a list of people in the db, so when I get the whole list, I want to render a form with upload profile picture for all these people, also some other inputs... so in a loop, I'm listing all these input fields,
Again, if you have <t:loop><t:upload/></t:loop>, independently of how many times you iterate the loop, you're using a single Upload component and rendering it once per loop iteration.
so after fill in I want to submit the whole form, but right before submits I have to access the UploadedFile-s, which are wrapped in custom component with method which does this.
These components are editing some property. Read this property instead of asking the components directly. You should avoid calling methods directly on injected components as much as possible. Your approach described above goes against Tapestry's best practices.
I think you should turn your custom components into actual form fields, i.e., implement Field and most probably subclass AbstractField.
We cannot help much without the source of your components. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org