You need to sign in to do that
Don't have an account?
Dennis Pyka
Set rendered-attribute with if-statement doesnt work
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:
Does anybody has an idea how such a surely simple statement can be realized? Do I have a syntax issue?
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?
Thanks for ypur reply. I tried yout solution but I'm getting the same error again. When I try to render the page the error " incorrect argumenttype for operator '>' occurs. Somehow there must be a issue in this tag:
<apex:column rendered="NOT{!ISBLANK(oli.Discount)}" width="10%" headerClass="tableheadercenter" footerClass="tablefootercenter" styleClass="tablebodycenter">
Is it possible that the error is caused by the Discount field?