You need to sign in to do that
Don't have an account?
Joe Hayes
apex:dataTable rendered attribute to filter certain results
Hi,
I am comiling a visualforce page at the moment that displays a certain related lists on a custom object.
What I need to do is only display results (rows) where the status__c field equals "booked". This status field is a picklist field with "booked", "transferred" and "cancelled" values.
I have tried the rendered attribute rendered {!status__c} = "booked" but cannot seem to get it to work.
Please can someone have a look at my code below and give me a hand.
I am comiling a visualforce page at the moment that displays a certain related lists on a custom object.
What I need to do is only display results (rows) where the status__c field equals "booked". This status field is a picklist field with "booked", "transferred" and "cancelled" values.
I have tried the rendered attribute rendered {!status__c} = "booked" but cannot seem to get it to work.
Please can someone have a look at my code below and give me a hand.
<apex:pageBlock title="Delegates"> <apex:dataTable value="{!Courses__c.Delegates__r}" var="item" border="1" cellpadding="5" cellspacing="1"> <apex:column style="width:20%"> <apex:facet name="header">Name</apex:facet> {!item.Name} </apex:column> <apex:column style="width:30%"> <apex:facet name="header">Signature</apex:facet> </apex:column> <apex:column style="width:20%"> <apex:facet name="header">Company Name</apex:facet> {!item.Contact__r.Account.Name} </apex:column> <apex:column style="width:30%"> <apex:facet name="header">Email Address</apex:facet> </apex:column> <apex:column > <apex:facet name="header">Exam Board</apex:facet> {!item.Exam_Board__c} </apex:column> <apex:column > <apex:facet name="header">Number of Days</apex:facet> <table border="1" cellpadding="5" cellspacing="0"> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> </table> </apex:column> </apex:dataTable> </apex:pageBlock>Thanks very much
for all the apex:column elements.
All Answers
for all the apex:column elements.
Please use the below code:
Please do let me know if it helps.
Regards,
Mahesh
Both of those work perfectly!