• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Action Buttons freez after returning from ajax call

 
Vertika Solanki
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 !!!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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



 
Eric Pascarello
author
Rancher
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
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic