You need to sign in to do that
Don't have an account?
Viktor Bakanov
Empty rows after rendered
Hello!
I have a related list on my vf page called Account Number. This page uses standard controller - Account. So on this page i show Account Numbers related list for Account.
To show necessary record, i add the render component. My code below:
This is work for me pretty good, but the table shows now empty rows. See the picture:
It seems there two records, that doesn't meet the criteria of rendered component.
So how can i hide this empty rows from the related list?
I have a related list on my vf page called Account Number. This page uses standard controller - Account. So on this page i show Account Numbers related list for Account.
To show necessary record, i add the render component. My code below:
<apex:page standardController="Account" showHeader="true"> <apex:pageBlock title="{!account.name}"> <apex:pageBlockSection title="Account Numbers" columns="1"> <apex:pageBlockTable title="Account Numbers" var="acnum" value="{!account.Account_Numbers__r}" border="1" cellpadding="4" cellspacing="1" width="100%"> <apex:column > <apex:facet name="header">Action</apex:facet> <apex:OutputLink value="{!$Action.Account_Number__c.Edit}" rendered="{!acnum.Status__c ='Created'}">Edit</apex:outputLink> <apex:OutputText value=" | " rendered="{!acnum.Status__c ='Created'}"> </apex:OutputText> <apex:OutputLink value="{!$Action.Account_Number__c.Delete}" rendered="{!acnum.Status__c ='Created'}">Del</apex:outputLink> </apex:column> <apex:column > <apex:facet name="header">Name</apex:facet> <apex:OutputLink value="https://cs87.salesforce.com/{!acnum.id}" rendered="{!acnum.Status__c ='Created'}">{!acnum.Name}</apex:OutputLink> </apex:column> <apex:column > <apex:facet name="header">Account #</apex:facet> <apex:OutputText value="{!acnum.Account_No__c}" rendered="{!acnum.Status__c ='Created'}"/> </apex:column> <apex:column > <apex:facet name="header">Status</apex:facet> <apex:OutputText value="{!acnum.Status__c}" rendered="{!acnum.Status__c ='Created'}"/> </apex:column> <apex:column > <apex:facet name="header">Trading Account</apex:facet> <apex:OutputText value="{!acnum.Account_Number_Old__c}" rendered="{!acnum.Status__c ='Created'}"/> </apex:column> <apex:column > <apex:facet name="header">Account #</apex:facet> <apex:OutputText value="{!acnum.Account_No__c}" rendered="{!acnum.Status__c ='Created'}"/> </apex:column> <apex:column > <apex:facet name="header">Markets</apex:facet> <apex:OutputText value="{!acnum.Markets__c}" rendered="{!acnum.Status__c ='Created'}"/> </apex:column> <apex:column > <apex:facet name="header">TCA Settlement Account</apex:facet> <apex:OutputText value="{!acnum.TCA_Settlement_Account__c}" rendered="{!acnum.Status__c ='Created'}"/> </apex:column> <apex:column > <apex:facet name="header">Trading Account Type</apex:facet> <apex:OutputText value="{!acnum.Trading_Account_Type__c}" rendered="{!acnum.Status__c ='Created'}"/> </apex:column> <apex:column > <apex:facet name="header">Account Setup With</apex:facet> <apex:OutputText value="{!acnum.Account_Setup_With__c}" rendered="{!acnum.Status__c ='Created'}"/> </apex:column> <apex:column > <apex:facet name="header">Record Type</apex:facet> <apex:OutputText value="{!acnum.RecordType.Name}" rendered="{!acnum.Status__c ='Created'}"/> </apex:column> <apex:column > <apex:facet name="header">Login</apex:facet> <apex:OutputText value="{!acnum.Login__c}" rendered="{!acnum.Status__c ='Created'}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlockSection>
This is work for me pretty good, but the table shows now empty rows. See the picture:
It seems there two records, that doesn't meet the criteria of rendered component.
So how can i hide this empty rows from the related list?
what is the output aftrer your update?
Let's make you code more simple.
All Answers
on your page you're hiding only fields not whole rows. That's why there are empty rows. To filter list of records you need to have extension controller and do it in APEX i.e. quering out only those with status = 'Created'.
Thanks for response!
I have write apex class and put it as extension, but it doesn't works
what is the output aftrer your update?
Let's make you code more simple.
Thank you a lot, Stefan! It work's!