This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Spring and the fly likes How to declare Spring.addDecoration inside javascript function? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "How to declare Spring.addDecoration inside javascript function?" Watch "How to declare Spring.addDecoration inside javascript function?" New topic
Forums: HTML, CSS and JavaScript Spring
Author

How to declare Spring.addDecoration inside javascript function?

Prabakaran Rajendran
Greenhorn

Joined: Apr 22, 2014
Posts: 2
Hi,

I am using "spring web-flow" for doing AJAX actions.

Is that possible to declare "Spring.addDecoration(new Spring.AjaxEventDecoration({ }));" inside the java script function?. Because I am trying to do some validations and value assignments on form submission using JQuery/Java script.

or How can I trigger "Spring.addDecoration" after completion of javascrtipt function ?

Step 1:
function validation() {
if(x==y) {
alert('success');
document.getElementById("id").value = 'myvalue';
}
}

step 2:
Spring.addDecoration(new Spring.AjaxEventDecoration({
formId : "editform",
elementId : "validate",
event : "onclick",
params : {
fragments : "myTable"
}
})
);

I need to execute step-1 first then step-2.

kindly help me to resolve this.

Thanks
Surendra Kumar
Ranch Hand

Joined: Jul 04, 2006
Posts: 235
Yes, you could do as per Spring docs.
 
Don't get me started about those stupid light bulbs.
 
subject: How to declare Spring.addDecoration inside javascript function?