Ondrej Sotolar
Ondrej Sotolar

Reputation: 1442

How do I get data from Tapestry BeanEditForms?

I'm using Tapestry 5 and I have a page on which I have a bean edit form. How do I get data submitted in that form after click on submit? I don't want to use Hibernate to persist the data (I'm using Spring JdbcTemplate). I want to use the data from forms to add them to SQL query.

Upvotes: 2

Views: 520

Answers (1)

Henning
Henning

Reputation: 16311

If you use a BeanEditForm, you already have some kind of backing bean which you specified as the object parameter. That's where the data for the form is coming from when the form is rendered, and that's also where it is going when the form is submitted.

The BeanEditForm component contains a Form component just like when you'd hand-code your form. You can create event handlers for all the standard events in your page class, just like you usually would:

 @OnEvent(EventConstants.SUCCESS)
 void processMyForm() {
     //your code here
 }

Also check out the Bean Edit Form Guide and the component reference for the BeanEditForm component on the Tapestry site.

Upvotes: 4

Related Questions