function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

How can we bind inputFieldValue of user.IsActive in VF page by negating it.


     i have staff page using User object internally(in controller staff= new User();).

    I would like to negate the value       staff.IsActive  and want to bind with inputfileld.

becouse in Staff form i have  a Lable InActive. and i can not changed that cos of UI specification.





<td class="clsPanelInputCheckboxTD">

 <apex:inputField value="{!staff.IsActive}" />

<apex:outputLabel styleClass="clsPanelCheckBoxLabel" value="{!$Label.inactive}" />







Could you please suggest me the way so I can bind Active user with Inactive Lable in UI.


I dont know if this will help but you could use an IF statement:


value="{!IF(staff.IsActive, 'true', 'false')}"


Here, depending if staff.IsActive is true or false, value will equal "true" or "false".


'true' or 'false' are just string so you could do:


value="{!IF(staff.IsActive, 'Active', 'Not Active')}"


You could also use the rendered attribute to show/hide depeneding if it was active or not.