I am trying to make the apex:inputField
of the records that meets a certain criteria readOnly when the condition is met.
<script>
function isTooLate(status) {
console.log('yo');
const validStatus = ['New Request', 'Technical Validation', 'Waiting for Customer Approval'];
return validStatus.includes(status);
}
</script>
<apex:pageBlockTable value="{!wrappers[fieldSetKey]}" var="wrapper" id="table" style="color:blue">
<apex:inputField value="{!wrapper.product[field]}" html-disabled="{isTooLate('{!wrapper.product.Status}')}" >
</apex:pageBlockTable>
this doesn't work, the function is not called and all the rows are disabled
Is there a way to dynamically change the apex:inputField
for a apex:outputField
or achieve what I want?