GeeCON Prague 2014*
The moose likes Struts and the fly likes JSP Action Buttons freez after returning from ajax call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSP Action Buttons freez after returning from ajax call" Watch "JSP Action Buttons freez after returning from ajax call" New topic
Author

JSP Action Buttons freez after returning from ajax call

Vertika Solanki
Greenhorn

Joined: Mar 12, 2010
Posts: 10
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

Joined: Jan 10, 2002
Posts: 61315
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vertika Solanki
Greenhorn

Joined: Mar 12, 2010
Posts: 10
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Mar 12, 2010
Posts: 10
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

Joined: Jan 10, 2002
Posts: 61315
    
  66

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.
 
GeeCON Prague 2014
 
subject: JSP Action Buttons freez after returning from ajax call