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?

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')}"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy