• 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
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

JSP Action Buttons freez after returning from ajax call

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

After clicking the "Submit" button the Action class does the processing and calls the DAO to persist data in the DB.
An Ajax funtion is called which checks if the data submitted has changed status. The code is attached below




The ajax code is




Once the call return with the message being displayed in the jsp. I can't used any button "Submit" or "Reset".

I have a requirement whrer I need to reset the all fields one the processing
is completed for one trade.

Please help !!!
 
Marshal
Posts: 67389
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

innerHtml = "<bean:message key="common.maintenanceMsg2"/>

This will not do what you expect!

The <bean:***> tags are Struts markup and must be evaluated on the server. Assigning them as innerHTML values on the client will not cause these tags to expand into their definitions.

You'll need to try another approach entirely, and not use JSP/Struts markup in your JavaScript.
 
Vertika Solanki
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:

innerHtml = "<bean:message key="common.maintenanceMsg2"/>

This will not do what you expect!

The <bean:***> tags are Struts markup and must be evaluated on the server. Assigning them as innerHTML values on the client will not cause these tags to expand into their definitions.

You'll need to try another approach entirely, and not use JSP/Struts markup in your JavaScript.



I get the desired bean meassgae displayed .. but after that I want to be able to click on the reset button and have fields reset..but this is not happenning. Nothing happens on clicking on the buttons after the message has been displayed thru Ajax call. Before all this ther eset button works fine son I don't believe there is any problem with the reset button JS code



 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the function being called? If not, I am guessing you are killing the event handler that is attached to the button when you do the innerHTML. Just a wild guess.

Eric
 
Vertika Solanki
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Eric Pascarello wrote:Is the function being called? If not, I am guessing you are killing the event handler that is attached to the button when you do the innerHTML. Just a wild guess.

Eric



hi .. this is the JSP code ..

 
Bear Bibeault
Marshal
Posts: 67389
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Posting Struts code in an HTML forum is not appropriate. I have moved this to the Struts forum.

If you would like this discussed in the HTML forum, please be sure to not post server-side markup.
 
    Bookmark Topic Watch Topic
  • New Topic