Java Mailing List Archive

http://www.gg3721.com/

Home » users.tapestry »

Combine a form and response in same template/Java class

thermus

2008-11-02

Replies: Find Java Web Hosting

Author LoginPost Reply

I currently have a very simple webapp. I have a form and return a pageable
grid component based on the form parameters. Right now, I have the form and
response as separate tml/Java classes. Everything works fine, but it's
getting to be a pain to keep all of these pieces in order (2 templates and 2
Java classes per query x 10 queries).

I'd like to combine the form with response so I only have to maintain one
tml and one Java class per query. What is the logic I need in my
class/template to do this?

So far, my attempts have been unsuccessful. I tried to add a Persist
boolean and set it to true in the onSuccess method and included an if-else
in the template to render the appropriate piece. If I just used @Persist, I
couldn't get back to the form to ever load again once it was submitted the
first time. If I used @Persist("flash"), I could reload the form on demand,
but now the grid pager links would take me back to the form (since the
boolean would reset to false).

Does anyone else combine their forms and response pages? Is this a bad
practice? It just seems silly to have to keep track of 4 entities for a
simple form/response. Boy do I miss Perl.
--
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 gg3721.com - Jax Systems, LLC, U.S.A.