Jacky,
Recently an associated of mine became tired of trying to get DHTML to work properly 
between NS and IE and came up with a crafty way of hitting the server just to pass a 
flag value in a request parameter to tell the JSP to add a new section of HTML to the 
page without affecting any other data that had already been entered on the page. The 
Action class basically did nothing but route the request to the same JSP page. 
He used a single form per page and named the line item input field(s) with "[counter]" 
and the Form class set accessor method was something like setX(String key, String 
value) { x.put(key,value); } where x is a HashMap. Both the JSP and Action class that 
processes the data use a loop to pull data out of the HashMap where key = "1", "2", 
"3" etc. until a null value is returned.
Although this is a bit creative and worked, I am not sure if it is recommend by the 
Struts old-timers. 
I would avoid using multiple Forms per page. I would also avoid any use of the 
innerHTML for dynamic client side adding of input fields into a Form. About the only 
choice left that I see is to make a server hit and let the JSP build more line items.
Anyone else out there use something like a "NoAction" action for this sort of thing?
I hope this helps?
-Tony
.
 Jacky Kimmel <[EMAIL PROTECTED]> wrote:Here I go:

I have a jsp that contains 4 forms. One for main info, another for 
merchandise info, and two for ship address address and bill address. 
Currently upon submit, I have an addressAction that gets passed the 
addressForms info. I stuff those parameters into AddressValue objects and put 
them into the httpRequestServletAttribute. I do the same with 
lineItems (which I need to change in the future because I need to have the 
ability to have muliple lineItems). Then the createPoAction gets the 
address and lineItem value objects from the requestAttributes and then call 
createPO(). How do I write the jsp appropriatly? Do I need to use 
form nesting? On the flip side, when I retrieve from the db, can I use 
this same grouping of forms or should I create a new form to diplay all 
of the data? Anyone have a suggestion on how to allow for a "add line 
Item" button that will just give another row of blank fields to the 
existing form?

I know this a lot but am in the trenches solo!!!!!!!




---------------------------------
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

.
.
.
Tony Baity
.
.
.


---------------------------------
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

Reply via email to