dcsimg
The form is not submitted when I click on h:commandButton second time
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   shobha_barkur
Posted On:   Friday, February 2, 2007 09:31 AM

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="x"%> action="#{TestBean.onClickGo}" onclick="return setHiddenParameter('body:form1',this.id,this.form);" id="Go0" value="Load"> javascript: function setHiddenParameter(form,id,form1){ var value = id.substring(id.length - 1); document.getElementById(form+':hdnParam').value = value; return true; } when I click on Load button for the first tim   More>>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="x"%>



action="#{TestBean.onClickGo}" onclick="return setHiddenParameter('body:form1',this.id,this.form);" id="Go0"
value="Load">




javascript:

function setHiddenParameter(form,id,form1){
var value = id.substring(id.length - 1);
document.getElementById(form+':hdnParam').value = value;
return true;
}

when I click on Load button for the first time the javascript setHiddenParameter('body:form1',this.id,this.form); is called and the form getts submitted and TestBean.onClickGo method is called. (Javascript setHiddenParameter sets a hidden param goButtonId). But when I try clicking on the Load button 2nd time, the javascript is executed but the form is not getting submitted. Hence TestBean.onClickGo is not executed. Pls can any one tell me why is this not happening.    <<Less
About | Sitemap | Contact