0

I'd like to have the title attribute of pageblocksection tag based on a condition, that is something like this (not working so):

<apex:pageBlockSection title="{!IF (TheQuotation.Fake_Amount__c == null, "Quotation Overview", "Quotation Summary")}" id="sezioneSopra" columns="2">

So I would have the title of this section to be Quotation Summary or Quotation Overview depending on the value of the field Fake_Amount.

How could I do?

1 Answer 1

0

Assuming you have exposed a property in your controller called TheQuotation (or have a getTheQuotation method), the only problem is the type of quotes you have used.

In your version the double quotes are being paired like this and so generating an error:

 v                                           v
="{!IF (TheQuotation.Fake_Amount__c == null, "Quotation Overview", "Quotation Summary")}"

Changing to single quotes results in the correct pairing and single quotes are valid string quotes in Visualforce expressions:

 v                                                                                      v
="{!IF (TheQuotation.Fake_Amount__c == null, 'Quotation Overview', 'Quotation Summary')}"

You must log in to answer this question.