function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Iceman123Iceman123 

Can rendered attributes handle Set .contains method?

Hi there,

 

Can rendered attributes handle Set .contains method?

 

I have the following rendering code that works in a simple string comparison case.

 

String myId ...

<apex:outputPanel id="editPanel" layout="none" rendered="{!o.Id == myId}">

 

But I have a requirement to only render the panel if o.Id is contained in a predefined String Set, but the call fails with the error "Unknown function myListOfIDs.contains...." when I try using the rendered code below.

 

Set<String> myListOfIds ....

 

<apex:outputPanel id="editPanel" layout="none" rendered="{!myListOfIds.contains(o.Id)}">

 

Is there a way around this other than creating a bunch of separate variables and use AND to come up with a long comparison string clause? :)

 

thanks and happy holidays!

Pi

FromCRMWonderlandFromCRMWonderland

Try this...

 

<apex:outputPanel id="editPanel" layout="none" rendered="{!booleanVar}">

 

Here "booleanVar"  is var of type boolean declared in controller class.

 

insider controller class u can set this boolean val.....

 

booleanVar = mySet.contains(ID);

 

-- alok