When do we use '!' symbol in visualforce page.
Let understand this clearly with a small example.
Consider the 'Rendered' property in Visualforce page. This property is used when we have to display/hide a field on the visualforce page. And how we do that?
Like this: <apex:form Rendered="True">
The above line means that the specific form should be displayed when the value is True. This is more like hardcoding and this remains same unless we change it to "false".
Now lets say we have a criteria where user decides if the form should be displayed or not which would mean we cannot gauge what user would choose at the run time. Hence we would need some mechanism where we can get the value dynamically, How do we do that?
Like this: <apex:form Rendered="{!checkStatusValue}">
So Which means that when we have to fetch a Variables value in the run time/dynamically we use '!' in front of the variable in visualforce
Let understand this clearly with a small example.
Consider the 'Rendered' property in Visualforce page. This property is used when we have to display/hide a field on the visualforce page. And how we do that?
Like this: <apex:form Rendered="True">
The above line means that the specific form should be displayed when the value is True. This is more like hardcoding and this remains same unless we change it to "false".
Now lets say we have a criteria where user decides if the form should be displayed or not which would mean we cannot gauge what user would choose at the run time. Hence we would need some mechanism where we can get the value dynamically, How do we do that?
Like this: <apex:form Rendered="{!checkStatusValue}">
So Which means that when we have to fetch a Variables value in the run time/dynamically we use '!' in front of the variable in visualforce
This content is very helpful.Good job
ReplyDelete