• 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

Struts - JSR168 Ajax Portlet - Problem!

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

Ok, I really hope somebody can help with this as I have hit a brick wall. I have a JSR-168 Struts portlet that I am developing and I would like to implement AJAX functionality - simply to update an InnerHTML tag on the screen for now.

I have my jsp page set up, along with my struts action. The aim is to update the page during the 'onchange' event of my text input. Can somebody please review my code to let me know if I am missing anything? It would much appreciated. Thanks.

districtChart.jsp



WelcomeAction.java



struts-config.xml

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Christopher,
I have two comments about your Javascript code, although I am certainly not an expert.
First, in you createXMLHttpRequest function, the preferred method of creating a XMLHttpRequest is new XMLHttpRequest
before the use of the new ActiveXObject.
Secondly, quoting Head Rush Ajax on page 183, "Using the innerHTML property is not a good way to get and set the contents of an element.
It's not part of the DOM specification, and the W3C has deprecated it - future versions of browsers may not even support it. Worse than that,
some browsers don't support it now."

I recommend that you look at the Head Rush book or any Ajax book and find better code to replace text in a DOM, instead of using the innerHTML
property.

[ December 06, 2007: Message edited by: Bill Fly ]

[ December 06, 2007: Message edited by: Bill Fly ]

[ December 06, 2007: Message edited by: Bill Fly ]
[ December 06, 2007: Message edited by: Bill Fly ]
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am also facing the same problem. if you have found any solution for your posts, please let me know.
Thanks in advance,
Paul
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic