0

Below is my vf page code:

I want to render logics "renderlogic1" and "renderlogicforCustomParts" together to make the field displayed. Please suggest.

Below is the vf page code:

<apex:column style="vertical-align:top; width:280px;" headerValue="Donor Requirements" 
             rendered="{!renderlogic1}" >
    <apex:outputPanel rendered="{!renderlogicforCustomParts}"> <!-- Show this field for any custom + 70047.* and 70048.* -->
     <apex:outputText value="{!$ObjectType.OpportunityLineItem.Fields.ADCC_Status__c.Label}"  /><br />
     <apex:inputField value="{!olineWrap.oline.ADCC_Status__c}" />
                        <br /> 
    </apex:outputPanel>

Below is Apex code for logic renderlogic1 and renderlogicforCustomParts

for(Part_IDs__c Pid : CustParts.values()) {
if(Pid.Part_ID_1__c == searchString ||Pid.Part_ID_2__c == searchString){ 
renderlogicforCustomParts = true;}     } 

    RecordTypeName = 

Schema.SObjectType.Opportunity.getRecordTypeInfosById().get(thisOpportunity.recordtypeid).getname(); 
    System.debug('ProductObject');  
          OpportunityRecordTypes__c  OppRecType;
          OppRecType =[SELECT PrimaryCellsOpportunity__c,CustomOrderOpportunity__c,Fresh_Blood_cells__c,ProductFamily__c FROM OpportunityRecordTypes__c];            
    System.debug('OppRecTypeName');    
        if (RecordTypeName==OppRecType.PrimaryCellsOpportunity__c)
  {
                renderlogic=true;
        }
  • the question is not clear; please use edit and give examples of how you want the output to look like – cropredy Nov 17 '17 at 5:31
  • Hi Mate, All I am trying to check is if I can render <apex:outputPanel rendered="{!renderlogicforCustomParts} && {!renderlogic1} at sametime to display the field. – user31302 Nov 17 '17 at 6:00
0

Multiple conditions in a rendered="..." expression are done this way:

<apex:outputPanel rendered="{!renderlogicforCustomParts && renderlogic1}"/> or

<apex:outputPanel rendered="{!AND(renderlogicforCustomParts, renderlogic1)}"/> 

The formula expression starts with {!. Everything inside the {! ...} should not have a merge field expression {!..} as SFDC evaluates all expressions within the outer {!..} to their relevant fields/methods in the controller

0

you can use visualforce "AND" operator in render condition.

<apex:column style="vertical-align:top; width:280px;" headerValue="Donor Requirements" 
         rendered="{! AND(renderlogic1, renderlogicforCustomParts) }" >

you can also use below link for further detail.

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_functions.htm

Thanks

Your Answer

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