• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

adding dynamic controls in struts2

 
Ranch Hand
Posts: 133
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

We are currently migrating one web application from struts 1.x to struts2.
In which, we have a functionality where we add a row of controls dynamically, in struts1.x what we did was
1. add a new "div"
2. create and concatenate html code using strut's <html:select/> tag
3. rewrite the innerHTML of that div with javascript

this can be done for multiple rows as well.

here is the code snippet for the same


this way it was working fine.

but when we are trying the same with <s:select /> in struts2like this,



we are getting 'Unterminated String constant' error in javascript!

we have already tried a number of combinations on this, to check if we are doing something wrong with the escape characters.

But as per my understanding, this is related to interpretation of the var by struts2.

awaiting replies on the same,

Thanks,
Rohit
 
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at the source html it might help you.. as struts 2 renders the s:select tag into multiple tags... label, table etc..

look here
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic