• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to do submit the Dynamic produced element in Struts

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello friends!
I use javascript to product some html'element Dynamicly. e.g
(
var aRows=oTable.rows;
var aCells=oRow1.cells;
var oCell1_1=aRows (oRow1.rowIndex).insertCell(aCells.length);
oCells.innerHTML="<p align=center><input type=text size=5 name="txtCard"></p>";
)
Client can freely produce these elements which name or id is the same . but how to do ,in action formbean ,get these Dynamic value that is post.
and that,reture these value to jsp when validate
is failure.
All help will be highly appreciated.
Regards,
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In your ActionForm, create an attribute that is either an array or a collection and provide the appropriate setters and getters for indexed properties. Additionally, make sure your javascript names your filds something like fieldName[index], where index is a a number is a series from 0..# of fields.
Let's say your attribute name is tableCell. In that case, your ActionForm should look something like this:

Your javascript should be generating lines that look like this:

HTH
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic