You need to sign in to do that
Don't have an account?

Newbie Apex help - display div in page on quote if any Quote Line Item has certain picklist value
I'm new to salesforce.com and VisualForce/Apex. I have developed a custom Page that renders a PDF, but I need to conditionally display content based on a field value set on a product - if that product is a line item on the quote.
Specifically when I load this page from the quote and display quote information and line item detail (already done), I need to display a div if any of those products' "Agreement_Supplement__c" picklist field contains the value "Supplement A" - but I have another div that needs displayed if that same picklist field contains the value "Supplement B". It seems that I need to create a function that takes in the orderid and supplement name and returns a true/false.
Esentially in my page I would like to be able to do something similar to if(hassupplement(theorderid, thesupplementname),"display:block;","display:none;"). I've read through the documentation and tried a few things, but haven't been able to acomplish this yet.
1) Use apex:outputPanel instead of Div.
2) Use the "rendered=<your formula>" in the apex:outputPanel.
-Andy
In addition to techman97s answer:
Please note the 'layout' attribute that comes with the <apex:outputpanel/> tag:
So, if you especially need to have a div-tag, you could set layout="block".