I noticed strange behaviour. I have multiselect picklist with action support. If one of values is selected 2 input fields in a page block should be rendered.
Everything works as expected when I open the page to edit existing objects. When I open the page to create an object this formula evaluates to true.

 <apex:inputField value="{!sobj__c.otherField__c}" 
                                    rendered="{!CONTAINS(sobj__c.multiselect__c ,'value A')}"/>

If I switch to IF statement the field is not visible re-rendering however doesn't work

<apex:inputField value="{!sobj__c.otherField__c}" 
                                    rendered="{!IF(CONTAINS(sobj__c.multiselect__c ,'value A'),true,false)}"/>

Howto make multiselect work for new object?

  • Are you rerendering the fields directly or surrounding page block?. There are some restrictions in using rendered and reRender targets as same elements – Victor May 11 '16 at 22:20
  • No the fields are in separate output panel containing 2 page block sections. The main issue is that the fields are visible on page load when the picklist is empty Contains evaluates to true while it shouldn't – user682217 May 12 '16 at 11:18

Your Answer

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

Browse other questions tagged or ask your own question.