Hi Jack,

I have been thinking of posting the same problem but
was watching this thread to arrive at something that
would help me..

Anyways, as you mentioned in this reply that it can be
done using single Action, I am into the same.

I want to populate the form using dispatch action. 
All the things are in place in the framework I am
trying to build for one of the project.  But somehow I
could not digest the idea of having 2 actions to
populate the form and do some action.  I would like it
to be a Single Action using DispatchAction so that all
the code related to the single form is kept at one
place and is not scattered across the forms.

Plz reply back its urgent.

Regards,


Nitin Dubey



--- Dakota Jack <[EMAIL PROTECTED]> 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
> <[EMAIL PROTECTED]> 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:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


                
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

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

Reply via email to