When my javascript function recieves a value from a controller boolean, it gets "false" instead of "true". Meanwhile, a System.log debug states that the boolean is "true". What could be causing this? There is much more code inside of the apex controller than I show below, so I'm thinking that possibly the javascript runs before the apex function is finished.
Here is the gist of the code:
VisualPage and Javascript
<apex:actionSupport event="onchange" action="{!myAction}" reRender="something" oncomplete="myFunction();" />
<script type="text/javascript">
function myFunction(){
window.alert({!myBoolean});
}
</script>
Apex Controller
public void myAction(){
myBoolean = true;
System.debug(myBoolean);
}
something
rerendered portion of the page?