• Dennis Pyka
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
Hello Everyone,

I have a datatable based on the OpportunityLineItems Object that shows every Product in the Opportunity Record.
Now I want only the products to be shown that are selected by a checkbox.
Is there a possibility to render only specific rows in pure Visualforce? Something like <apex:DataTable renderrow="{!Oli.Checkbox == True}?

I only have a Professional licence, so Apex Code isnt available.
Is there a possibility to only do this in VF on clientside? Maybe JavaScript could also work..

Here is my Code:
<apex:variable var="index" value="{!1}"/>
                        <apex:dataTable width="100%" value="  !Opportunity.OpportunityLineItems}" var="oli"
                            <apex:column width="10%" headerClass="tableheaderleft"  styleClass="tablebodycenter">
                                <apex:outputLabel value="{!index}."/>
                                <apex:variable var="index" value="{!index+1}"/>
                                <apex:facet name="header"></apex:facet>
                             </apex:column>
                            <apex:column width="40%" headerClass="tableheaderleft"  styleClass="tablebodyleft">
                                <apex:facet name="header">Bezeichnung</apex:facet>
                                <apex:OutputField value="{!oli.Name}"/> <br/>
                                    <table border="0" width="100%" style="border-collapse: collapse; margin-bottom:10px">
                                        <tr><td width="30%" style="padding: 0px;line-height: 100%;"><strong>Leistungszeitraum:</strong>&nbsp;<br></br><apex:outputText value="{0, date, dd.MM.yyyy}">
                                            <apex:param value="{!oli.ServiceDate}" /> </apex:outputText>&nbsp;-&nbsp;<apex:outputText value="{0, date, dd.MM.yyyy}">
                                            <apex:param value="{!oli.Licensing_Period_Calculated__c}" /> </apex:outputText></td></tr>
                                    </table>
                             </apex:column>
                            <apex:column width="10%" headerClass="tableheadercenter" footerClass="tablefootercenter" styleClass="tablebodycenter">
                                <apex:facet name="header">Anzahl</apex:facet>
                                <apex:OutputField value="{!oli.Quantity}"/>
                                <apex:facet name="footer"></apex:facet>
                            </apex:column>
                            <apex:column width="20%" headerClass="tableheadercenter"  styleClass="tablebodycenter">
                                <apex:facet name="header">Einzelbetrag</apex:facet>
                                <apex:OutputField value="{!oli.UnitPrice}"/>
                                <apex:facet name="footer"></apex:facet>
                            </apex:column>
                            
                            <apex:column rendered="{!Opportunity.TotalDiscount__c != 0}" headerClass="tableheadercenter" footerClass="tablefootercenter" styleClass="tablebodycenter">
                                <apex:facet name="header">Rabatt</apex:facet>
                                <apex:OutputField value="{!oli.Discount}"/>
                                <apex:facet name="footer"></apex:facet>
                            </apex:column>  
                            
                            <apex:column width="20%" headerClass="tableheaderright"  styleClass="tablebodyright">
                                <apex:facet name="header">Gesamtbetrag</apex:facet>
                                <apex:OutputField value="{!oli.TotalPrice}"/>
                                <apex:facet name="footer"></apex:facet>
                            </apex:column>                                                                                            
                        </apex:dataTable>

 
Hi everyone,

I want to set the rendered attribute of datatable column with an if-statement, depending wether the .Discount variable has a value or not.

I tried the following code, which had absolutly no effect:
<apex:column rendered="{!If(oli.Discount!=null,If((oli.Discount>0),"True","False"),"False")}")" width="10%" headerClass="tableheadercenter" footerClass="tablefootercenter" styleClass="tablebodycenter">
                                <apex:facet name="header">Rabatt</apex:facet>
                                <apex:OutputField value="{!oli.Discount}"/>
                                <apex:facet name="footer"></apex:facet>
                            </apex:column>
Then I tried this code, which also had no effect:
<div style= "display: {!If(oli.Discount != null,'','none') }"
                           <apex:column width="10%" headerClass="tableheadercenter" footerClass="tablefootercenter" styleClass="tablebodycenter">
                                <apex:facet name="header">Rabatt</apex:facet>
                                <apex:OutputField value="{!oli.Discount}"/>
                                <apex:facet name="footer"></apex:facet>
                            </apex:column>  
                           </div>

Does anybody has an idea how such a surely simple statement can be realized? Do I have a syntax issue?
 
Hello Everyone,

I have a datatable based on the OpportunityLineItems Object that shows every Product in the Opportunity Record.
Now I want only the products to be shown that are selected by a checkbox.
Is there a possibility to render only specific rows in pure Visualforce? Something like <apex:DataTable renderrow="{!Oli.Checkbox == True}?

I only have a Professional licence, so Apex Code isnt available.
Is there a possibility to only do this in VF on clientside? Maybe JavaScript could also work..

Here is my Code:
<apex:variable var="index" value="{!1}"/>
                        <apex:dataTable width="100%" value="  !Opportunity.OpportunityLineItems}" var="oli"
                            <apex:column width="10%" headerClass="tableheaderleft"  styleClass="tablebodycenter">
                                <apex:outputLabel value="{!index}."/>
                                <apex:variable var="index" value="{!index+1}"/>
                                <apex:facet name="header"></apex:facet>
                             </apex:column>
                            <apex:column width="40%" headerClass="tableheaderleft"  styleClass="tablebodyleft">
                                <apex:facet name="header">Bezeichnung</apex:facet>
                                <apex:OutputField value="{!oli.Name}"/> <br/>
                                    <table border="0" width="100%" style="border-collapse: collapse; margin-bottom:10px">
                                        <tr><td width="30%" style="padding: 0px;line-height: 100%;"><strong>Leistungszeitraum:</strong>&nbsp;<br></br><apex:outputText value="{0, date, dd.MM.yyyy}">
                                            <apex:param value="{!oli.ServiceDate}" /> </apex:outputText>&nbsp;-&nbsp;<apex:outputText value="{0, date, dd.MM.yyyy}">
                                            <apex:param value="{!oli.Licensing_Period_Calculated__c}" /> </apex:outputText></td></tr>
                                    </table>
                             </apex:column>
                            <apex:column width="10%" headerClass="tableheadercenter" footerClass="tablefootercenter" styleClass="tablebodycenter">
                                <apex:facet name="header">Anzahl</apex:facet>
                                <apex:OutputField value="{!oli.Quantity}"/>
                                <apex:facet name="footer"></apex:facet>
                            </apex:column>
                            <apex:column width="20%" headerClass="tableheadercenter"  styleClass="tablebodycenter">
                                <apex:facet name="header">Einzelbetrag</apex:facet>
                                <apex:OutputField value="{!oli.UnitPrice}"/>
                                <apex:facet name="footer"></apex:facet>
                            </apex:column>
                            
                            <apex:column rendered="{!Opportunity.TotalDiscount__c != 0}" headerClass="tableheadercenter" footerClass="tablefootercenter" styleClass="tablebodycenter">
                                <apex:facet name="header">Rabatt</apex:facet>
                                <apex:OutputField value="{!oli.Discount}"/>
                                <apex:facet name="footer"></apex:facet>
                            </apex:column>  
                            
                            <apex:column width="20%" headerClass="tableheaderright"  styleClass="tablebodyright">
                                <apex:facet name="header">Gesamtbetrag</apex:facet>
                                <apex:OutputField value="{!oli.TotalPrice}"/>
                                <apex:facet name="footer"></apex:facet>
                            </apex:column>                                                                                            
                        </apex:dataTable>

 
Hi everyone,

I want to set the rendered attribute of datatable column with an if-statement, depending wether the .Discount variable has a value or not.

I tried the following code, which had absolutly no effect:
<apex:column rendered="{!If(oli.Discount!=null,If((oli.Discount>0),"True","False"),"False")}")" width="10%" headerClass="tableheadercenter" footerClass="tablefootercenter" styleClass="tablebodycenter">
                                <apex:facet name="header">Rabatt</apex:facet>
                                <apex:OutputField value="{!oli.Discount}"/>
                                <apex:facet name="footer"></apex:facet>
                            </apex:column>
Then I tried this code, which also had no effect:
<div style= "display: {!If(oli.Discount != null,'','none') }"
                           <apex:column width="10%" headerClass="tableheadercenter" footerClass="tablefootercenter" styleClass="tablebodycenter">
                                <apex:facet name="header">Rabatt</apex:facet>
                                <apex:OutputField value="{!oli.Discount}"/>
                                <apex:facet name="footer"></apex:facet>
                            </apex:column>  
                           </div>

Does anybody has an idea how such a surely simple statement can be realized? Do I have a syntax issue?