You need to sign in to do that
Don't have an account?
Simple javascript problem
Apologies, but this is probably a really simple javascript / VF issue, but I have been going around in circles
I want to conditionally render a column in a pageBlockTable based on the value of another column in the table. I have written a javascipt function which should return true / false according to the value of the field.
My Javascript function is:
<script type="text/javascript"> function renderStatus(attendeeRole) { if (attendeeRole == "Minutes Only") { return false; } else { return true; } } </script>
The excerpt from the table is:
<apex:column headerValue="Invite Status" styleClass="{!att.Status__c}" > <apex:inputField value="{!att.Invite_Status__c}" rendered="return(renderStatus('{!att.Role__c}'))" /> </apex:column>
I have tried many different variations of trying to fire the js function but just cannot seem to make it work.
The result is always a column that does not render regardless of the value of the field att.Roler__c
Thanks in advance
PS: I always struggle with javascript in VF. Is there a decent reference document / book out there that can help?
All Answers
Works perfectly, thanks