Hi

What Jing describes below is in essence the problem I am wishing to solve
... retaining any *new* user input into the master form when they also
branch off to enter input into the detail form.  When they return to the
master form the *new* data should be displayed.

What I have done now is the following:

1.  I am currently using the locic:iterate tage to write the detail records.

2.  Each detail record has an edit button which set's an action parameter
(e.g. 'editDetail') via JavaScript (using DispatchAction
http://husted.com/struts/tips/002.html).

3.  The submit button has a property 'detailSelected' and is indexed.

4.  The master ActionForm has the following method:
    
        public void setDetailSelected(int index, String value)
      {
                this.detailSelected = index;
      }

So the master form is submitted with all its details.  I then use the index
value to get the selected detail object from the collection and populate the
detail ActionForm.

Thoughts or comments?
Shane

-----Original Message-----
From: Jing Zhou [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 17 July 2003 7:42 a.m.
To: Sandeep Takhar; Struts Users Mailing List
Subject: Re: How do I implement a Master/Detail maintenance form?

As far as I know, some people do use multiple
forms on one page. But if both the master form
and the detail form have input fields, the scenario
I described in my early message blocks me to
support the use of multiple forms.

It is a general problem with the use of multiple forms.
Could someone share some knowledge on how they
avoid such embarrassments to end users? Or such
construct is improper and needs some modifications
to be practical?

Jing

----- Original Message ----- 
From: "Sandeep Takhar" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; "Jing
Zhou" <[EMAIL PROTECTED]>
Sent: Wednesday, July 16, 2003 2:10 PM
Subject: Re: How do I implement a Master/Detail maintenance form?


> I suppose my assumptions are that there is nothing to
> process on the "master" form.
>
> sandeep
> --- Jing Zhou <[EMAIL PROTECTED]> wrote:
> >
> > ----- Original Message ----- 
> > From: "Sandeep Takhar" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List"
> > <[EMAIL PROTECTED]>; "Jing
> > Zhou" <[EMAIL PROTECTED]>
> > Sent: Wednesday, July 16, 2003 7:33 AM
> > Subject: Re: How do I implement a Master/Detail
> > maintenance form?
> >
> >
> > > I don't think there is best-practices specific to
> > > master/detail processing per se.
> >
> > Agree.
> >
> > >
> > > There are a lot of different ways to do this.  So
> > many
> > > that I don't know where to start actually.
> > >
> > > I would look at scaffolding as a best-practices
> > and I
> > > would buy Struts in Action by Ted Husted & gang.
> > >
> > > Not a plug, but if I was just starting, this is
> > the
> > > advice I would want.  <assumption that you are
> > just
> > > starting>
> > >
> > > One way to do this is to have multiple forms on
> > the
> > > master page.  Each "action" posts to a different
> > form
> > > and the update/read links just point directly to
> > an
> > > action.  An example of an action is "Add" or
> > "Delete".
> >
> > I have a question regarding to the use of multiple
> > forms
> > on the same page (with different html form
> > elements).
> > Since each action button posts to a different form,
> > a senario can be conceived in which a user fills in
> > both
> > of master form and detail form on the page and then
> > clicks a button to submit the detail form.
> >
> > Suppose the next screen is the same page, then
> > the user would find the data entries for the master
> > form
> > are lost. Do you have any workaround for this
> > senario?
> > It is not clear to me that such use of multiple
> > forms is valid
> > or not. Just my thoughts for a quite long time with
> > an assumption that we do not combine the master form
> > and the detail form into one html form.
> >
> > If I suppose the next screen is going to be a
> > different page,
> > then I think it is simpler to have the detail form
> > on
> > another page at the beginning. So the use of
> > multiple
> > forms would not bring me much benefits.
> >
> > >
> > > sandeep
> >
> > Jing
> >
> > > --- Jing Zhou <[EMAIL PROTECTED]> wrote:
> > > >
> > > > ----- Original Message ----- 
> > > > From: "Shane Mingins"
> > > > <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Tuesday, July 15, 2003 4:58 PM
> > > > Subject: How do I implement a Master/Detail
> > > > maintenance form?
> > > >
> > > >
> > > > > Hi
> > > > >
> > > > > Are there any *best practices* or examples
> > around
> > > > showing the best way of
> > > > > implementing the maintenance of a
> > master/detail
> > > > relationship using the
> > > > > Struts framework?
> > > > >
> > > > > For example if I provide a form with a
> > supplier
> > > > and list of products where
> > > > > you can edit the supplier details and/or edit
> > the
> > > > product details, to
> > > > select
> > > > > the product to edit I need to provide a key to
> > > > identify that product.  I
> > > > can
> > > > > use a link but then any changes to the
> > supplier
> > > > are not kept as the link
> > > > > does not submit the form.
> > > >
> > > > I presume your supplier page is the master page
> > and
> > > > it contains a list of
> > > > links pointing to a product page. If this is the
> > > > case, I use Java scripts to
> > > > force a submission in order to sync the
> > supplier's
> > > > data with the form bean
> > > > before forwarding to the product page.
> > > >
> > > > >
> > > > > Thanks
> > > > > Shane
> > > > >
> > > > >
> > > > > Shane Mingins
> > > > > Analyst Programmer
> > > > > Assure NZ Ltd
> > > > > Ph 644 494 2522
> > > > >
> > > >
> > > > Jing
> > > > Netspread Carrier
> > > > http://www.netspread.com
> > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > > 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]
> > > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > SBC Yahoo! DSL - Now only $29.95 per month!
> > > http://sbc.yahoo.com
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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]
> >
>
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>


---------------------------------------------------------------------
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