0

Can someone please let me know what is my error here in the render condition?

rendered="{!IF(AND(Counting != 0,Inquiry=='Inquiry'),true,false)}"

Please note Inquiry is a param value set in apex page as below,

<apex:pageblocksection > 
          <apex:pageBlockSectionItem >  
                <apex:actionfunction name="Inquiry">    
                   <apex:outputText value="Written Inquiry/Referral" styleClass="pbtitle" />
                   <apex:commandbutton value="Add" action="{!Changecount}"/>
                     <apex:param name="Inquiry" assignto="{!Inquiry}" value="Inquiry"></apex:param>

                  </apex:actionfunction> 
               </apex:pageBlockSectionItem>  

        </apex:pageblocksection>  

        <apex:pageBlockSection title="Select Files" rendered="{!IF(AND(Counting != 0,Inquiry=='Inquiry'), true , false)}">  
            <apex:repeat value="{!allFileList}" var="AFL">  
                <apex:inputfile value="{!AFL.body}" filename="{!AFL.Name}"/> 
        </apex:repeat>  

      </apex:pageblocksection>  

This param is assigned as below in controller,

 public String Inquiry {
        get;
        // *** setter is NOT being called ***
        set {
            Inquiry = value;
            System.debug('value: '+value);
 }

Can someone please tell me what is wrong here that Inquiry param value not getting set?

                  </apex:actionfunction> 
               </apex:pageBlockSectionItem>  
  • What is the error you are getting? – snehakem Apr 1 '15 at 10:53
  • 1
    Try change the name in the apex:param to something other than Inquiry as you already have that variable defined in your controller. Have you tried displaying the Counting and Inquiry variables on you page to see what values they contain? – BarCotter Apr 1 '15 at 10:54
  • The Inquiry value is not getting set with "Inquiry". Can you please suggest a wayout? – Testing_SFDC Apr 1 '15 at 11:39
1

Set Inquiry value outside of the setter method. Maybe in a constructor of the controller.

  • It is getting error to define in a constructor. – Testing_SFDC Apr 1 '15 at 11:50
  • 1
    Don't define in constructor. Only assign value to Inquiry in constructor. – Poonam Apr 2 '15 at 4:17
1

Use below instead,

rendered="{!AND(Counting != 0,Inquiry=='Inquiry')}"

Update property as below,

public String Inquiry {
                get;
                set {
                    Inquiry = ApexPages.currentPage().getParameters().get('Inquiry');
                    System.debug('Inquiry : '+Inquiry);
         }
    }
  • Yes a better way ! – Testing_SFDC Apr 1 '15 at 11:40
  • Did it work for you? – snehakem Apr 1 '15 at 11:47
  • No this was not the problem. problem is the value is not getting set by setter method. Can you please help here? – Testing_SFDC Apr 1 '15 at 11:48
  • what does "value" mean in setter method? – snehakem Apr 1 '15 at 11:52
  • It is the param value in page that I want to set. – Testing_SFDC Apr 1 '15 at 11:53

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.