MikeOliverAZ (1) [Avatar] Offline
I have a need for hidden fields in a form originally generated by Roo.

disabled="true" doesn't work as it doesn't include the field's value in the form post.
render="false" doesn't even put the field in the DOM.

I need the hidden field so I can use javascript to populate it after user input in other fields in the form.

didn't find anything in the book that correlated to what I see in the Roo generated forms.

A quick example showing a hidden field added to a Roo generated create.jspx or update.jspx would be loverly.

ken.rimple (246) [Avatar] Offline
Re: Hidden Fields in a Roo form

Have you tried just using an <input type="hidden" name="fieldName" value="value"/>? You can use ${ } el expressions to put the field value in there if needed based on the model.

I've added a tip to chapter 6 - btw we're moving the content around such that chapter 5 is the first 2/3 of the original chapter 5, a little slimmed, chapter 6 is advanced customization, and a new chapter 7 will be created with ajax, gwt, and jsf.

We'll announce more details later, but it was a move to make the chapters more digestible. I suggest adding ketchup myself, but people aren't listening to me around that score...
MikB (202) [Avatar] Offline
Re: Hidden Fields in a Roo form
Well Ken, all you have to do is add a ketchupListener:
class --class ~.web.KetchupListener --extends org.rooinaction.coursemanager.web.CondimentExecutionAdapter