I'm attempting to use a hidden form field to save the database
record's key for an update, and I have a question on whether I'm
approaching this correctly.  Maybe there is a better way within the
webwork framework.

I have a url link something like
updatestatus.action?statusReportId=44, which goes to the UpdateStatus
Action

The UpdateStatus Action sees the incoming statusReportId without any
other data and then populates the data for that key into the
UpdateStatus class's attributes, then returns INPUT, which loads a
jsp page with a form for the record, populated with the values off
the database.  The user makes changes, then the form posts back to
the UpdateStatus Action, only this time, the data values are
populated along with the recordId, so the record is updated.

To get the recordId passed through, I first used a regular text field
via the custom ww tags:

 <ui:textfield label="'status report id'" name="'statusReportId'"/>

And it worked fine

Then I looked for a way to hide the field, and couldn't find
anything, so I tried the standard INPUT element, as such:

<input type="hidden" name="statusReportId" value="<webwork:property
value="statusReportId"/>"/>

And this worked.

So I have 2 questions:
1. Is this a good approach, or is there a better way to handle the
statusReportId field 

2. If a hidden field is the way to go, is there an appropriate WW tag
for this, or do I have to use the <input type="hidden" tag construct.

Thanks.
Wes



__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com


-------------------------------------------------------
This SF.net email is sponsored by: Tablet PC.  
Does your code think in ink? You could win a Tablet PC. 
Get a free Tablet PC hat just for playing. What are you waiting for? 
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to