• 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

Using Javascript to write to Iterated ArrayList element

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my struts page, I am using logic:iterate to cycle through a list of objects in an ArrayList to display my data. Several of the fields can be changed by the user.

I'm trying to set an onchange event on the control (html:radio) and have the associated javascript set a flag in the appropriate object in the array list. I've tried many ways of formatting the javascript and can't get it to register.

My current line is:

document.ManageEntryPointForm.list[recNum].changeFlag.value="true";

where ManageEntryPointForm is the name of the form, list is the alias for the array list as defined in the logic:iterate, recNum is the index number from the iterate passed into the javascript as a parameter, and changeFlag is the attribute in the object from the ArrayList.

Can anyone tell me what I am doing wrong?

Thanks,

Joe
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

list is the alias for the array list as defined in the logic:iterate



"list" is the alias logic:iterate creates in the Java code. It does not create a Javascript list. You have to do that yourself and then your code should work.
 
J P Nelson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you provide example code. What you are describing doesn't register in the brain cells...

Its Monday...

Additionally, I want to get the flags into the Java code. I want to be able to act on them withing my action class.
[ January 17, 2005: Message edited by: Joseph Nelson ]
 
Marc Peabody
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, before I write any code for you...
Why do you need the flags set in javascript?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic