</apex:column>
<apex:column headerValue="Grant" rendered="{!if(AND(wrp.oppContRole.contact.Portal_Access_Granted__c == null , wrp.oppContRole.contact.Portal_Access_Grant_Request__c == null),true,false)}">
<apex:inputCheckbox value="{!wrp.grant}" disabled="false"/>
</apex:column>
<apex:column headerValue="Grant" rendered="{!if(AND(wrp.oppContRole.contact.Portal_Access_Granted__c == null, wrp.oppContRole.contact.Portal_Access_Grant_Request__c == null),true,false)}">
<apex:inputCheckbox value="{!wrp.grant}" disabled="true"/>
</apex:column>
<apex:column headerValue="Revoke" rendered="{!if(AND(wrp.oppContRole.contact.Portal_Access_Revoked__c == null , wrp.oppContRole.contact.Portal_Access_Revoke_Request__c == null),true,false)}">
<apex:inputCheckbox value="{!wrp.revoke}" disabled="false" onchange="var theTextBox = document.getElementById('{!$Component.check}'); theTextBox.disabled = theTextBox.disabled ? false : true;"/>
</apex:column>
<apex:column headerValue="Revoke" rendered="{!if(AND(wrp.oppContRole.contact.Portal_Access_Revoked__c == null , wrp.oppContRole.contact.Portal_Access_Revoke_Request__c == null),true,false)}">
<apex:inputCheckbox value="{!wrp.revoke}" disabled="true" onchange="var theTextBox = document.getElementById('{!$Component.check}'); theTextBox.disabled = theTextBox.disabled ? false : true;"/>
</apex:column>
If Portal_Access_Grant_Request__c(field in contact&& and working over opp.Contact Roles ) is filled in the appropriate contact then the checkbox(created by wrapper class and showen over vf) must be checked true and must be greyed out(read only)
and some more condition in vf
right now it showing two grant row as well as revoke bt i want one and c
Best Answer
You can't directly disable a checkbox in Visualforce using Apex. One is on the client-side, the other is on the server. As such, if you want them to interact, you have to send Visualforce the data it needs to make the decision to disable the checkbox. Here's a trivial example of this:
Note that this page is kind of... well, slow. Visualforce wasn't really meant to do this sort of thing, so if you click really quickly, you might see some strange behavior. Nevertheless, this should cover the basics of what you're trying to accomplish.