I'm writing a visualforce page and i want to hide <apex:outputfield>
tag label in visualforce page.
Need help to achieve this-
and If I want to show custom labels to this field how can I achieve the same ?
1 Answer
If you include an <apex:outputField>
or an <apex:inputField>
component in an <apex:pageBlockSectionItem>
, these components do not display with their label or custom help text as they do when they are children of an <apex:pageBlockSectionItem>
.
Also note that <apex:pageBlockSectionItem>
components cannot be rerendered; rerender the child components instead.
If you want to hide <apex:outputField>
values label in visualforce page, you can use either above mentioned note or you can go through following strategy.
Just include your <apex:outputField>
tags in <apex:panelGrid>
tag which will hide the field labels.
If you want to display labels of <apex:outputField>
values , simply remove <apex:panelGrid>
tag, or you can use <apex:outputLabel>
tag. Using “apex:outputLabel” tag you can give custom label to respective values.
To show default Labels of <apex:outputField>
values on the Visualforce pages simply put all the <apex:outputField>
tags in <apex:pageblocksection>
tag.