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

Actionsupport - oncomplete not working properly
Hi everyone,
I have a problem with the apex:actionsupport.
Here I have an actionsupport within a radio input:
<input type="radio" name="selectedRadio">
<apex:actionsupport action="{!function1}" oncomplete="jsFunc();" event="onclick" rerender="someId">
<apex:param name="someName" value="{!acc.ID}" assignTo="{!Account}" >
</apex:param>
</apex:actionsupport>
</input>
when a radio button is clicked, the actionsupport is started and the function1 (apex) has to be executed. The account in apex from the apex:param is successfully assigned.
void function1(){
booleanValue = true;
}
the oncomplete function - jsFunc() is also called:
jsFunc(){
var bool = {!booleanValue};
if(bool)
alert('Here is the problem');
}
The problem is that the "bool" variable is here false and so the alert is not started, although it had to be previosly set to true by the function1 in apex. I guess that the oncomplete is not started at the right time?
Could someone tell me, what the problem is?
Looks like there is problem with the Syntax,
See below,
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_actionSupport.htm
See the sample,
<apex:actionsupport event="onclick" action="{!Upload_Attachment}" oncomplete="ReloadParent();"
<apex:actionSupport event="onchange" oncomplete="makeRowInit();" reRender="exportPanel" />
<apex:actionSupport event="onchange"
action="{!updateStartDate}"
rerender="fooOutputPanel"
oncomplete="setTimeout('setupValidation()',100)"
status="statusStart">
</apex:actionSupport>
Regards,
Ashish