How can I make an apex:inputField disabled?

apex:inputField does not have an attribute called disabled.
How can I get an apex:inputField to be disabled?


An easy and always work workaround:

<apex:outputPanel rendered="{!onOff}">
    <apex:inputField value="{!someField}"/>
<apex:outputPanel rendered="{!NOT(onOff)}">
    <apex:outputField value="{!someField}"/>

With a {!onOff} variable and reRender behavior, the field behavior can be controlled just as you actually need.

Source : Link , Question Author : phoenix7788 , Answer Author : Pittsburgh DBA

Leave a Comment