whoops - cut too much out, forgot the ctor

        public OrderEntryForm( ) {
                doReset = true;
                defaults();
        }


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 5:06 PM
To: [EMAIL PROTECTED]
Subject: RE: persistance for wizard type forms


i think thats the default behavior for an ActionForm.reset()  In your class
that extends the ActionForm, add a reset().  You can leave it empty at
first, and your ActionForm bean in the session shouldn't get cleared.  We
use this capability to set initial defaults and to optionally clear values
based on a button (i.e. New Order vs. Similar Order button) - take a look at
the chunk of code below, its a sample from our user interface framework (i
stripped out the non-relevant stuff). 

Pete Zybrick

public class OrderEntryForm extends ActionForm implements IOrderEntry {
        private boolean doReset;

        public void setDoReset(boolean doReset) {
                this.doReset = doReset;
        }
        public boolean getDoReset() {
                return doReset;
        }
        /**
         * @see ActionForm#reset(ActionMapping, HttpServletRequest)
         */
        public void reset(ActionMapping mapping, HttpServletRequest request)
{
                String fromPathName = mapping.getPath();
                String submitTarget = request.getParameter("submitTarget");

                // Process: OrderEntry
                if (fromPathName.equals("/OrderEntry")) {
                        if ((submitTarget.equals("submit"))
                                || (submitTarget.equals("cancel"))
                                || (submitTarget.equals("enquiry")))
                                doReset = false;

                        // Process: OrderEntryResultsConfirmed
                } else
                        if
(fromPathName.equals("/OrderEntryResultsConfirmed")) {
                                if ((submitTarget.equals("similarOrder"))
                                        || (submitTarget.equals("print"))
                                        || (submitTarget.equals("cancel")))
                                        doReset = false;

                                // Process: OrderEntryResultsRejected
                        } 
                }

                if (doReset)
                        defaults();
                doReset = true;
        }

        public void defaults() {
                
                // set the default values in your form here
                

        }



-----Original Message-----
From: Sriram Nookala [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 4:47 PM
To: Struts Users Mailing List
Subject: persistance for wizard type forms


I'm developing  wizard-type forms using struts. The data I entered
previously doesn't show up when I go back to the previous form even though I
use the same 'ActionForm' for all the wizard forms and I set the scope in
the action mapping to 'session'. What am I missing ?


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

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

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

Reply via email to