You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nic Werner <we...@sonoma.edu> on 2005/03/15 05:37:31 UTC

Re: Correct Prepopulate Method (simple problem) SOLVED.

Okay, after some review of my code and such, it is now working! There is 
not one definite thing, I just double-checked everything I had after 
taking a break.

I want to thank everyone for their input (and patience) and the side 
emails making sure I was up and running. This is a great community, and 
even though I'd much rather lurk, the support is great.

    As Jack suggested, I will move to DispatchActions now, a lot of the 
work up until now was a proof of concept for Struts/iBATIS to see how 
they handled CRUD operations. I'm converted.

- Nic.

Dakota Jack wrote:

>Note that the key is not to think of the ActionForm as somehow being
>wedded to the page form.  That is a crazy way to think.  ///;-)
>
>
>On Mon, 14 Mar 2005 12:43:18 -0800, Dakota Jack <da...@gmail.com> wrote:
>  
>
>>No problem, Nic.  Just trying to see what the problem is.  Glad I
>>asked.  I would not have know this was it.  So, your client on a
>>browser is seeing a list of users, chooses a user, then has that users
>>attributes displayed and can update them.  Right?  If so, this is
>>easy.
>>
>>You can use one JSP page or two for this.  Either way it does not
>>matter.  I would use one, but you look like you would use two.  Let's
>>do that:  Let's also use two Actions -- GetUserAction and
>>UpldateUserAction, although I would only use one and would use
>>DispatchAction in some way.  But, only use one ActionForm -- UserForm
>>-- which will have a field for identifying the user, e.g. id, and
>>fields for the values your user has, e.g. name, soc_sec_no, etc.
>>Select a user from the first JSP page and call GetUserAction.  If
>>successful, the GetUserAction will process the action by getting the
>>User and populating the user's fields in the UserForm, and returning
>>an ActionForward to the second page, where the form values will be
>>displayed.  It is that simple.
>>
>>
>>On Mon, 14 Mar 2005 11:53:12 -0800, Nic Werner <we...@sonoma.edu> wrote:
>>    
>>
>>>I apologize as I seem to have hijacked this thread in a direction I
>>>didn't intend. Jack, I didn't mean for you to pick through my code, it
>>>was just in response to Joe helping me.
>>>
>>>To answer your question Dakota Jack, in an overall view what you have
>>>said is correct:
>>>
>>> From a page of Users, I want to click on one to open a JSP page that I
>>>can 'Edit' the User attributes, and then have that individual
>>>attribute data 'Updated'. It really is very simple.
>>>
>>>Reading the replies here and the Struts FAQ, everyone says "Create two
>>>actions, one to pre-populate the data, and the other to save that data"
>>>- So, the first action populates the data in the Execute() function,
>>>returns an ActionForward to the 'Edit' JSP. But in order for html:form
>>>to display that populated data, I have to refer to the first Action, not
>>>the second, barring me from submitting this data to the second page.
>>>
>>>I've got to have this wrong! I've re-read these responses and pored
>>>through my Struts book but I'm obviously missing something
>>>
>>>Thanks everyone for your input, I only post to the list when I'm truly
>>>stumped.
>>>
>>>- Nic.
>>>
>>>Dakota Jack wrote:
>>>
>>>      
>>>
>>>>I am just going to hold out, Nic, until you merely say what you want
>>>>the client to do without giving any code.  If you want to know what to
>>>>do from me, just tell me what you want the client to do.  As I said,
>>>>this is simple stuff, but dealing with your code just complicates it.
>>>>
>>>>If you don't just want to define what the client wants to see and do,
>>>>that is okay.  That is your choice.  But I am not digging through what
>>>>you are doing to answer a simple question.
>>>>
>>>>Maybe I can do it for you and you can just confirm:
>>>>
>>>>You want to have a page with values in a form call an action to "edit"
>>>>using the values and then to return to some page that will have these
>>>>values displayed and the page will be used by the client to "update"
>>>>the data?  Is that right?  This does not make sense to me but seems to
>>>>be what you want the client to do.  Please just state what you want
>>>>the client to do and only that, okay?  You are really over
>>>>complicating everything, I think.
>>>>
>>>>Jack
>>>>
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>      
>>>
>>--
>>"You can lead a horse to water but you cannot make it float on its back."
>>~Dakota Jack~
>>
>>    
>>
>
>
>  
>


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