Hi Rafael,

"I usually prepopullate an ActionForm from the Action. Like, if I have
to save a Person object, I prepopullate the ActionForm in the edit()
method, setting the ActionForm again in the web context(request or
session). And then, return the according ActionForward."

Could you give a example Code for that? 

-----Ursprüngliche Nachricht-----
Von: Rafael Nami [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 22. September 2005 19:36
An: Struts Users Mailing List
Betreff: Re: The best way to prepopulate a ActionForm


Best Regards

Rafael Mauricio Nami

2005/9/22, ojay78 <[EMAIL PROTECTED]>:
>
>
>
> Hi @ all,
>
>
>
> I stuck on a problem. I don't now how to prepoulate a Actionform. What I'm
> doing is this:
>
>
>
> On my showFVKNAdminAction I receive a value from the previous ActionForm
and
> put it in the request so that the next handleFVKNAction have this value.
>
> I also put a attribute in the request so that the handleFVKNAction knows
> that it has to act like a "show" action not like a "update" action. Then I
> get the my values that are relevant for me out of the database. I put this
> List into my Viewmodel and the handleFVKNForm. Then I forward to the jsp.
>
>
>
> In the JSP I get my Viewmodell and show my values on my page with the
> logic:iterate tag
>
> <bean:define      id="fvknList"
>
>                         name="FVKN"
>
>                         property="fvknList"
>
>                         scope="session"
>
>                         type="java.util.List"/>
>
>
>
>
>
>
>
>
>
> html:form action="/handleFVKNAction" method="post" >
>
>             <logic:iterate name="fvknList" id="line" indexId="lineNo"
> type="FVKN">
>
>
>
>                   <tr>
>
>                         <td><%=lineNo.intValue()+1%></td>
>
>                         <td><bean:write name="line" property="fieldName"
> filter="true" /></td>
>
> ..
>
> ..
>
> ..
>
>
>
> This works so far.
>
>
>
> But when I hit the submit button the handleFVKNForm is empty. Why is that
> so?
>
> What I want is to get my List from the database, display it on the jsp
page
> and if the submit button will be pressed it should update this list in my
> database.
>
> I think my failure is, that this fvknList is from my Viewmodel but I
should
> get it from my prepopulated form bean, right? But obviously I don't know
how
> to do that
>
>
>
> Any suggestions for a better way to solve this problem?
>
>
>
>


--
Java - Assim no Server como no Palm
<i>Java - thus in the Server as it is in Palm

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




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

Reply via email to