+ Start a Discussion
swain 10swain 10 

How to put two parameter in rendered in visualforce ,its little different situation then AND OR condition.

One is a condition another one is Apex function, how to put them in one rendered:-
1. rendered="{!massEdit}"
2.rendered="{!IF(selectedProductLine.item.RecordTypeId = ICRecTypeId),true,false )}"

This Syntax not working:-
rendered="{!IF(((selectedProductLine.item.RecordTypeId = ICRecTypeId)&&(!massEdit)),true,false )}"
Even I tried with AND OR Operator not working. I need to render a section on picklist value change for the same, so i have to put the two condition in one rendered.
Best Answer chosen by swain 10
sachin kadian 5sachin kadian 5
rendered="{!IF(AND(selectedProductLine.item.RecordTypeId = ICRecTypeId,massEdit) , true,false)}"

try this

All Answers

sachin kadian 5sachin kadian 5
rendered="{!IF(AND(selectedProductLine.item.RecordTypeId = ICRecTypeId,massEdit) , true,false)}"

try this
This was selected as the best answer
swain 10swain 10
User-added image
Thanks for your response sachin.
But I tried this you can how the page looks. I need to hide the input field after save . All input fields are hidden and output fields are displaying , but only for this both showing. If I will use only single condition that is massEdit its working fine but not rendering. But I need both.
sachin kadian 5sachin kadian 5
Are you reRendering after save? can you post the code so that i can have a look
 
swain 10swain 10
Hi Sachin , I want am rendering a section on selection of value from input picklist at the same time i need to use massEdit. Please let me know if you need whole code.

 <apex:pageBlockSection rendered="{!selectedProductLine.item.RecordTypeId = ICRecTypeId}"> 
              
                         
                        <apex:pageBlockSectionItem helpText="{!$ObjectType.ProductLineItem__c.fields.CBG_Pricing_Strategy__c.InlineHelpText}" dataStyleClass="wrapperClass" >
                        <apex:outputLabel value="{!$ObjectType.ProductLineItem__c.fields.CBG_Pricing_Strategy__c.Label}" for="PricingStrategy"/>
                        <apex:outputPanel styleClass="requiredInput" layout="block">                 
                            <apex:outputPanel styleClass="requiredBlock" layout="block"/>               
                        <apex:outputField id="PricingStrategy" value="{!selectedProductLine.item.CBG_Pricing_Strategy__c}" title="{!$ObjectType.ProductLineItem__c.fields.CBG_Pricing_Strategy__c.InlineHelpText}" rendered="{!!massEdit}">
                                
                                <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton"/>
                                
                                
                        </apex:outputField> 
                         
                            <apex:inputField id="PricingStrategyInput" value="{!selectedProductLine.item.CBG_Pricing_Strategy__c}"  rendered="{!IF(AND(selectedProductLine.item.RecordTypeId = ICRecTypeId, massEdit) , true,false)}"  onkeypress="return fireSave(event);">
                            <apex:actionSupport event="onchange" rerender="Priceless"/>
                          
                            </apex:inputField>
                                                        
                        </apex:outputPanel>
                        </apex:pageBlockSectionItem>
                    </apex:pageBlockSection> 
                    
                    
                  <apex:pageBlockSection columns="2"  rendered="{!IF(selectedProductLine.item.CBG_Pricing_Strategy__c== 'Price Less',true,false  )}" collapsible="false" >
                   <apex:pageBlockSectionItem >
                        <apex:outputLabel value="{!$ObjectType.ProductLineItem__c.fields.CBG_ManufacturingCostsM__c.Label}" for="manCost"/>
                          <apex:outputPanel styleClass="requiredInput" layout="block" >                 
                            <apex:outputPanel styleClass="requiredBlock" layout="block"/>           
                              
                            <apex:outputField id="manCost" value="{!selectedProductLine.item.CBG_ManufacturingCostsM__c}" rendered="{!!massEdit}">
                                <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" />
                            </apex:outputField>
                            <apex:inputField id="manCostInput"  value="{!selectedProductLine.item.CBG_ManufacturingCostsM__c}" rendered="{!massEdit}" onkeypress="return fireSave(event);"/>
                        </apex:outputPanel>
                   </apex:pageBlockSectionItem>
                   </apex:pageBlockSection>
            
                   
                
sachin kadian 5sachin kadian 5
I think you need to rerender this pageBlockSection when you are selecting value on picklist.