--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
wrap it in a <a> or add a javascript onclick event handler
Thank you, but could you, please, give me an example of using <a> tag? I need to pass a string argument to it.
So I have Java class: PublishingAction:
public class PublishingAction implements Action, ProminentProjectAction {
...
@JavaScriptMethod
public void lockMismatch(int hashCode){
for(MismatchesContainer mc: allMismatches){
for(Mismatch msm: mc.getMismatchesList()){
if(msm.hashCode()==hashCode){
msm.lock("Claimer", "reason");
}
}
}
}And in jelly:
<script>
var myAction= <st:bind value="${it}" />
function lockMismatch(mismatchHash) {
myAction.lockMismatch(mismatchHash);
}
</script>
...
<img src="/plugin/PluginForJenkins/images/claim.png" onClick="javascript:lockMismatch(${instanceSecond.hashCode})"/>Now I'm getting error (visible through GoogleChrome):
- POST http://localhost:8080/$stapler/bound/c1678e1a-fc77-44d9-b212-2d73bc6e7b80/lockMismatch 413 (FULL head) prototype.js:1585
Ajax.Request.Class.create.requestprototype.js:1585 Ajax.Request.Class.create.initializeprototype.js:1550 (anonymous function)prototype.js:452 klassprototype.js:101 proxy.(anonymous function)bind.js:51 lockMismatch(index):107 onclickThere seems to be 2 reasons:
-somehow I'm passing too much data (how?!)- more possible: I'm doing something wrong ;-(Could you aid me, please?