struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Problem with unused Formbean-Properties
Date Thu, 23 Jan 2003 19:35:40 GMT


On Thu, 23 Jan 2003, Andreas Langmann wrote:

> Date: Thu, 23 Jan 2003 12:46:33 +0100
> From: Andreas Langmann <andreas.langmann@isb-ag.de>
> Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: Problem with unused Formbean-Properties
>
> Hello,
>
> i have a formBean which has a property id. this id is not shown to the user
> and it has no associated input field. If the user posts the FormData the id
> contains the prior value - as expected. But since we implemented the
> "reset()" method in every formBean, struts calls this method and deletes my
> id.
>
> What i need is that struts uses the formBean for displaying the Page and
> posting the data without calling reset... i thought this could be handled
> with the param scope (session/request) but struts calls reset anyway...
>
> I need to store this id field from the get-request and access it in the post
> request but i dont want to store it as attribute...
>
> any ideas?
>

Omitting the reset() is not a good idea -- the least of your problems is
that checkboxes won't work any more.

Even though you don't want the id field displayed, you can make it part of
the incoming form by using a hidden field (with <html:hidden>).  That way,
it gets populated with the correct value just like everything else.

> thanks
>
> Andreas Langmann
>

Craig



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message