Re: dynamic form action flow

2002-02-01 Thread Ted Husted

 SavePhoneNumberAction.java -- editPhoneNumbers.do

It may be that this is looking up the original phone number again. 

If so, this is also where the recyling message could be coming into it. 

Do you want to go back through the edit action, or straight to the
display page?

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/


Jeff Oberlander wrote:
 
 Ok, I've wasted an embarrassing amount of time on this and would appreciate
 any help.  Its night now and no progress has been made.  This is another
 action flow question.  Maybe there is a sample somewhere that does this?  I
 apologize that this is long.
 
 I have an action form that contains an ArrayList of items (lets say phone
 numbers). The form allows me to edit existing numbers or add new ones.
 When I go to the editPhoneNumbers.jsp page, it displays all of my phone
 numbers based on the ArrayList with a button to add another and a button to
 save the form. I start with a single phone number - e.g. my home number. If
 you hit add, the form should be re-displayed with 2 phone number fields -
 my home one, and a new blank one - both editable.
 
 This is the action flow I currently have:
 
 editPhoneNumbers.do -- EditPhoneNumberAction.java (input is PhoneNumberForm
 - containing an ArrayList of numbers) - this loads my current phone numbers
 from the data store into the form.
 
 EditPhoneNumberAction -- editPhoneNumber.jsp - this displays the form.
 
 editPhoneNumber.jsp -- SavePhoneNumberAction.java (action = add | save)
 
 SavePhoneNumberAction.java - if the action is add, I add an empty
 PhoneNumber object to the ActionForm ArrayList, then I want to redisplay the
 form with the original item, and the blank new one.
 
 SavePhoneNumberAction.java -- editPhoneNumbers.do
 
 Loop is complete.
 I thought this would be as simple as adding a new item to the ArrayList in
 the form and forwarding on the original form.  It doesn't work.  I keep
 getting back (in the display) only my home phone number (the original form
 without the new object)  I suspect it is related to this log message:
 Recycling existing ActionForm bean instance of class .  Another
 interesting point is even though I explicitly set the action property of the
 form in SavePhoneNumberAction, it always comes into EditPhoneNumberAction as
 null.
 
 --
 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]




RE: dynamic form action flow

2002-02-01 Thread Jeff Oberlander

Actually, it doesn't.  I've been through that example pretty thouroughly.
To add a new subscription, it puts up a form with only the fields for the
new subscription (a separate page).  It doesn't dynamically new form fields
to an existing page.

-Original Message-
From: Jon.Ridgway [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 2:05 AM
To: 'Struts Users Mailing List'
Subject: RE: dynamic form action flow


Hi Jeff,

The struts-example.war app does just this, except it uses subscriptions
instead of phone numbers. It's part of the struts download, under webapps.

Jon.

-Original Message-
From: Jeff Oberlander [mailto:[EMAIL PROTECTED]] 
Sent: 01 February 2002 06:08
To: '[EMAIL PROTECTED]'
Subject: dynamic form action flow

Ok, I've wasted an embarrassing amount of time on this and would appreciate
any help.  Its night now and no progress has been made.  This is another
action flow question.  Maybe there is a sample somewhere that does this?  I
apologize that this is long.  

I have an action form that contains an ArrayList of items (lets say phone
numbers). The form allows me to edit existing numbers or add new ones.
When I go to the editPhoneNumbers.jsp page, it displays all of my phone
numbers based on the ArrayList with a button to add another and a button to
save the form. I start with a single phone number - e.g. my home number. If
you hit add, the form should be re-displayed with 2 phone number fields -
my home one, and a new blank one - both editable.  

This is the action flow I currently have:

editPhoneNumbers.do -- EditPhoneNumberAction.java (input is PhoneNumberForm
- containing an ArrayList of numbers) - this loads my current phone numbers
from the data store into the form.

EditPhoneNumberAction -- editPhoneNumber.jsp - this displays the form.

editPhoneNumber.jsp -- SavePhoneNumberAction.java (action = add | save)

SavePhoneNumberAction.java - if the action is add, I add an empty
PhoneNumber object to the ActionForm ArrayList, then I want to redisplay the
form with the original item, and the blank new one.

SavePhoneNumberAction.java -- editPhoneNumbers.do

Loop is complete.
I thought this would be as simple as adding a new item to the ArrayList in
the form and forwarding on the original form.  It doesn't work.  I keep
getting back (in the display) only my home phone number (the original form
without the new object)  I suspect it is related to this log message:
Recycling existing ActionForm bean instance of class .  Another
interesting point is even though I explicitly set the action property of the
form in SavePhoneNumberAction, it always comes into EditPhoneNumberAction as
null.








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




RE: dynamic form action flow

2002-02-01 Thread Jeff Oberlander

I've tried going straight to the display page and then I get the new, blank
element and form, but lose the prior existing form fields (home phone).

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 4:14 AM
To: Struts Users Mailing List
Subject: Re: dynamic form action flow


 SavePhoneNumberAction.java -- editPhoneNumbers.do

It may be that this is looking up the original phone number again. 

If so, this is also where the recyling message could be coming into it. 

Do you want to go back through the edit action, or straight to the
display page?

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/


Jeff Oberlander wrote:
 
 Ok, I've wasted an embarrassing amount of time on this and would
appreciate
 any help.  Its night now and no progress has been made.  This is another
 action flow question.  Maybe there is a sample somewhere that does this?
I
 apologize that this is long.
 
 I have an action form that contains an ArrayList of items (lets say phone
 numbers). The form allows me to edit existing numbers or add new ones.
 When I go to the editPhoneNumbers.jsp page, it displays all of my phone
 numbers based on the ArrayList with a button to add another and a button
to
 save the form. I start with a single phone number - e.g. my home number.
If
 you hit add, the form should be re-displayed with 2 phone number fields
-
 my home one, and a new blank one - both editable.
 
 This is the action flow I currently have:
 
 editPhoneNumbers.do -- EditPhoneNumberAction.java (input is
PhoneNumberForm
 - containing an ArrayList of numbers) - this loads my current phone
numbers
 from the data store into the form.
 
 EditPhoneNumberAction -- editPhoneNumber.jsp - this displays the form.
 
 editPhoneNumber.jsp -- SavePhoneNumberAction.java (action = add | save)
 
 SavePhoneNumberAction.java - if the action is add, I add an empty
 PhoneNumber object to the ActionForm ArrayList, then I want to redisplay
the
 form with the original item, and the blank new one.
 
 SavePhoneNumberAction.java -- editPhoneNumbers.do
 
 Loop is complete.
 I thought this would be as simple as adding a new item to the ArrayList in
 the form and forwarding on the original form.  It doesn't work.  I keep
 getting back (in the display) only my home phone number (the original form
 without the new object)  I suspect it is related to this log message:
 Recycling existing ActionForm bean instance of class .  Another
 interesting point is even though I explicitly set the action property of
the
 form in SavePhoneNumberAction, it always comes into EditPhoneNumberAction
as
 null.
 
 --
 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]




RE: dynamic form action flow

2002-02-01 Thread Jeff Oberlander

I figured this out finally, thanks to the Vectors in Form thread today,
which turned out to be similar

It was 2 things:
1) The scope in my struts-config was request and should have been session.
2) Upon adding a new blank object to the ArrayList for re-display, instead
of forwarding to the editPhoneNumbers.do action, directly re-display the
jsp.


-Original Message-
From: Jeff Oberlander 
Sent: Friday, February 01, 2002 7:39 AM
To: 'Struts Users Mailing List'
Subject: RE: dynamic form action flow


I've tried going straight to the display page and then I get the new, blank
element and form, but lose the prior existing form fields (home phone).

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 4:14 AM
To: Struts Users Mailing List
Subject: Re: dynamic form action flow


 SavePhoneNumberAction.java -- editPhoneNumbers.do

It may be that this is looking up the original phone number again. 

If so, this is also where the recyling message could be coming into it. 

Do you want to go back through the edit action, or straight to the
display page?

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/


Jeff Oberlander wrote:
 
 Ok, I've wasted an embarrassing amount of time on this and would
appreciate
 any help.  Its night now and no progress has been made.  This is another
 action flow question.  Maybe there is a sample somewhere that does this?
I
 apologize that this is long.
 
 I have an action form that contains an ArrayList of items (lets say phone
 numbers). The form allows me to edit existing numbers or add new ones.
 When I go to the editPhoneNumbers.jsp page, it displays all of my phone
 numbers based on the ArrayList with a button to add another and a button
to
 save the form. I start with a single phone number - e.g. my home number.
If
 you hit add, the form should be re-displayed with 2 phone number fields
-
 my home one, and a new blank one - both editable.
 
 This is the action flow I currently have:
 
 editPhoneNumbers.do -- EditPhoneNumberAction.java (input is
PhoneNumberForm
 - containing an ArrayList of numbers) - this loads my current phone
numbers
 from the data store into the form.
 
 EditPhoneNumberAction -- editPhoneNumber.jsp - this displays the form.
 
 editPhoneNumber.jsp -- SavePhoneNumberAction.java (action = add | save)
 
 SavePhoneNumberAction.java - if the action is add, I add an empty
 PhoneNumber object to the ActionForm ArrayList, then I want to redisplay
the
 form with the original item, and the blank new one.
 
 SavePhoneNumberAction.java -- editPhoneNumbers.do
 
 Loop is complete.
 I thought this would be as simple as adding a new item to the ArrayList in
 the form and forwarding on the original form.  It doesn't work.  I keep
 getting back (in the display) only my home phone number (the original form
 without the new object)  I suspect it is related to this log message:
 Recycling existing ActionForm bean instance of class .  Another
 interesting point is even though I explicitly set the action property of
the
 form in SavePhoneNumberAction, it always comes into EditPhoneNumberAction
as
 null.
 
 --
 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]

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