Hello all,

I'm wondering how others handle a simple flow where a user fills out a
form, form is processed, and then a message is shown as a result ("ok"
or "failed"). I have a simple contact form and am handling this like so:

In my template I have 2 blocks: 1 is the form and the other is the
message (or a place holder). There is also a t:delegate that will render
the page property "content", which is just another block that will be
assigned the form or message block.

Now because I have 2 different possible "bodies" (the blocks), I have to
have some logic to make sure the correct one gets displayed. So my the
page's content property is annotated as @Persist("flash"), and at the
end of the form submission I set the content member to a message. It's
persisted, so that works. To get the initial content (the form) to
render, I check if the content property is null in onActivate, and if so
assign the form block.

It works nicely, and I was wondering how others were handling this
common use case and if something stinks about my method.

Thanks!

chris

-- 
http://thegodcode.net


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to