<apex:page extensions="MyController" standardController="Opportunity"> <apex:form> <apex:pageBlock> <apex:pageBlockButtons location="top"> <apex:commandButton value="Top" disabled="{!disableNextButton}" id="next_button1"/> </apex:pageBlockButtons> <apex:pageBlockButtons location="bottom"> <apex:commandButton value="Bottom" disabled="{!disableNextButton}" id="next_button2"/> </apex:pageBlockButtons> <apex:pageBlockSection> <apex:inputField value="{!Opportunity.amount}"> <apex:actionSupport event="onblur" action="{!selectAssetAction}" rerender="next_button1, next_button2"> </apex:actionSupport> </apex:inputField> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page> Apex Class public class MyController { Boolean disabled = false; public MyController(ApexPages.StandardController controller) {} public void selectAssetAction(){ this.disabled = true; } public Boolean getDisableNextButton() { return disabled; } }
No comments :
Post a Comment