You need to sign in to do that
Don't have an account?
Jonathan Spink
How can the visibility of a button in a VF column be made to depend on the field value for that row?
I have rows of data to display on a VF form and on some rows I want to hide the button based on a field value for that row. Everything I try hides the entire column, e.g.
<apex:dataTable value="data" var="c">
<apex:column>
<apex:outputText value="{!c.field}/>
<apex:outputPanel rendered="{!c.rowBoolean}">
<button type="button">process...</button>
</apex:outputPanel>
</apex:column>
</apex:dataTable>
<apex:dataTable value="data" var="c">
<apex:column>
<apex:outputText value="{!c.field}/>
<apex:outputPanel rendered="{!c.rowBoolean}">
<button type="button">process...</button>
</apex:outputPanel>
</apex:column>
</apex:dataTable>
Create a wrapper class. Instead of the data, loop on wrapper.
Inside wrapper, set a avariable for each row (true/false) and use the variable to hide/show the button inside datatable.
All Answers
Create a wrapper class. Instead of the data, loop on wrapper.
Inside wrapper, set a avariable for each row (true/false) and use the variable to hide/show the button inside datatable.