• 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

how to do submit the Dynamic produced element in Struts

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

pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic