You need to sign in to do that
Don't have an account?

CommandButton & oncomplete ..
Folks,
Have anyone ever tried to use the oncomplete attribute on a command button ? I am facing one weird issue.
<apex:commandButton styleClass="btn" value="Save" action="{!saveAction}" id="save" oncomplete="checkError();"/>
Now on click of the button when the save action fails as a result of some required fields not filled in, the fields are not getting highlighted as they would typically. When I remove the oncomplete definition, they get highlighted. My gut feeling is that our own definition of oncomplete overrides something that salesforce has defined for commandButton on completion of an ajax request. Any takers ??
Thanks.
Message Edited by Arun Bala on 12-30-2008 08:14 PM
Have anyone ever tried to use the oncomplete attribute on a command button ? I am facing one weird issue.
<apex:commandButton styleClass="btn" value="Save" action="{!saveAction}" id="save" oncomplete="checkError();"/>
Now on click of the button when the save action fails as a result of some required fields not filled in, the fields are not getting highlighted as they would typically. When I remove the oncomplete definition, they get highlighted. My gut feeling is that our own definition of oncomplete overrides something that salesforce has defined for commandButton on completion of an ajax request. Any takers ??
Thanks.
Message Edited by Arun Bala on 12-30-2008 08:14 PM
All Answers
I am putting the question in this thread only since its almost related to the above.
I am using <apex:commandButton value="Next" action="{!method1}" rerender="test" oncomplete="complete1();"/>
Once the method1 executes, it updates a boolean variable to 'true' and in the constructor this variable value is set as false
public void method1(){
fieldstatus='true';
//system.debug('fieldstatus:'+fieldstatus);
}
Now on VF page , i want to access this variable value so used oncomplete, but in the oncomplete function i always got the value as false.
function complete1() {
var check1= '{!fieldstatus}';
alert(check1);
}
Any idea why this wierd behaviour?
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BCRW