Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Unable to call java script function in JSP (Struts 2)

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Resolved Please ignore
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are talking about the function showMessage(), right?

You need to provide the relevant .js-files, otherwise it's hard to say why it doesn't work.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use Firebug to debug your JavaScript code, or just put some alert(...) statements in the selectAll(...) function to help track down what you've done wrong.

I'd strongly recommend using a JavaScript library like jQuery, Prototype, etc. to help clean up the JavaScript.

I really hope you clean up the JSP, too--that's extremely difficult to read and hard to maintain. Mixing Java and JSP like this, in this quantity, is a recipe for disaster.

There's no reason to use <s:a...> tags if you're not using them for the Ajax theme. If you're not using the Ajax theme, there's no reason to use <s:head theme="ajax"/>, and it will add a *significant* amount of overhead to your page loading since it loads Dojo.
 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic