You need to sign in to do that
Don't have an account?
Gray out a Custom Button on VF Page
Hi,
I have a VF page that has a custom button called "Send Email".
I have embedded this VF on the custom object page layout.
I am able to send an email and the functionality is working fine.
I need to only enable this button based on a field value of the custom object called Status__c.To certain extent i was able to do so using "Rendered" property of the "form" tag(code in red, below). This will either render the button or does not render.
But i want this button to be grayed out when it does not match the criteria so that users know that they cannot click this and still be able to see the button.
Any help on this is highly appreciated. If i am not clear , pls feel free to ask your questions. Thanks!
VF Page:
<apex:page standardController="echosign_dev1__SIGN_Agreement__c" extensions="sendEmail"> <apex:form rendered="{!(echosign_dev1__SIGN_Agreement__c.echosign_dev1__Status__c!='Signed')}" > <apex:commandButton Value="Send Email" action="{!SendEmail}" /> </apex:form> </apex:page>
Hi,
Command Button tag is having special attribute 'disabled'.
Declare a Member variable.
Do the logic in your controller code and assign the Value to the member variable either TRUE OR FALSE.
And reRender the VF page.
Thanks,
Kodisana
All Answers
Hi,
Command Button tag is having special attribute 'disabled'.
Declare a Member variable.
Do the logic in your controller code and assign the Value to the member variable either TRUE OR FALSE.
And reRender the VF page.
Thanks,
Kodisana
Kodisana,
Thanks for your pointer.It helped me.
Sales4ce
I mean i have replaced button with an image..and since the disable option working with the normal button and the same funtionalty(disabling the funtionality of calling the method) working with image too but the image is not disabling/grayout from the VF Page