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
Chittineni SandeepChittineni Sandeep 

Can you guys please help out these problem how to write rendered syntax exactly

Apex Code------------------------
public class questions {
    
     public list<Questionn__c> questions{get;set;}
    public map<string,list<SelectOption>> options{set;get;}
      Public List<wrapperservay> wrp{get;set;} 
    
    public list<Answer__c> useranswers  = new list<Answer__c>();
    public Answer__c pat;
    

    public Answer__c getpat(){
        return pat;
    }   
    public questions()
    {
        options=new map<string,list<SelectOption>>();
         pat= new Answer__c(); 
          
        questions = new list<Questionn__c>();
        
         wrp = new List<wrapperservay>();
        
        questions = [select id,name,Status__c, Quest__c,option_types__c,(select PicklistValue__c from DynamicPicklists__r) from Questionn__c];

        
        for(Questionn__c w:questions){
            
            
             wrapperservay w1 = new wrapperservay();
                                                    w1.qs = w ;
                                                    w1.QuestionId = w.id;
                                                    wrp.add(w1);
            
            
            if (options.containskey(w.Name)){
                 for(DynamicPicklist__c op:w.DynamicPicklists__r){
                    options.get(w.Name).add(new selectoption(op.PicklistValue__c,op.PicklistValue__c));
                
            }
            }else
            {
                options.put(w.Name,new list<SelectOption>());
                for(DynamicPicklist__c op:w.DynamicPicklists__r){
                    options.get(w.Name).add(new selectoption(op.PicklistValue__c,op.PicklistValue__c));
                        
                }
            }
        }
       

            
            
        }
    
    

    public void Save()
    {
        insert pat;
        for(wrapperservay wl : wrp)
        {
            
            
            
            //wl.qs
            
            
            
            Answer__c ua = new Answer__c();
            
            ua.Name = wl.Name;
             ua.Questionn__c = wl.QuestionId;       
            
            useranswers.add(ua);
            insert ua;                                    system.debug('#####################'+wl.QuestionId+'%%%%%%%%%%%%%%%%%%%%%'+wl.qs);                                                
        }                
     }                
      public class wrapperservay
        {
            
            public Id QuestionId{get;set;}
            
                        public String Name{get;set;}
                        public String Qtype{get;set;}
                        Public Questionn__c qs{get;set;}
                        
                        public wrapperservay()
                        {
                        
                            qs = new Questionn__c();
                              
                        }                                                                                                                                                          
        }        
    }

VF Page-----------------------------
<apex:page Controller="questions" showHeader="false">
<apex:form style="border:20px single #800080;">
  
  <center><apex:sectionHeader title="HOSPITAL FEEDBACK FORM " /> </center> 
    
    <style>
    
body { background-image: url("https://c.ap2.content.force.com/servlet/servlet.FileDownload?file=01528000002yz1C") } 

  body .bPageTitle .ptBody h1.noSecondHeader{
    font-size: 60px;
        
  }
        
        
  .body .bPageBlock, body #bodyCell .bResource .secondaryPalette, body .secondaryPalette.bPageBlock, body .individualPalette .secondaryPalette.bPageBlock, body .bodyDiv .genericTable, body .genericPageBlockTable, body .bodyDiv .bSubBlock, body .bComponentBlock .bPageBlock, body .bMyDashboard .bPageBlock, body.rlHoverFrame .bPageBlock, body.subjectSelectionPopup div.choicesBox, body.lookupTab .secondaryPalette.bPageBlock, body.popupTab .secondaryPalette.bPageBlock, body.UserTagStatsPage .secondaryPalette.bPageBlock{
        background-color: transparent !important;
        }
</style>
    
    <apex:pageBlock title=" PAITIENT DETAILS" >
        <div style="display: block;min-height: 5in;padding: 15px;">
        
        
            
       <apex:pageBlockSection columns="1" >
<apex:inputField value="{!pat.Name_of_the_paitient__c}"/>
 <apex:inputField value="{!pat.Phone_Number__c}"/>
   <apex:inputField value="{!pat.Email_Address__c}"/> 
  
           
       <apex:pageBlockSectionItem > GENDER:
               
        <apex:selectRadio label="Gender" value="{!pat.Gender__c}" >
                    <apex:selectOption itemLabel="Male" itemValue="male"/>
                    <apex:selectOption itemLabel="Female" itemValue="female"/>           
                </apex:selectRadio> 
    
           </apex:pageBlockSectionItem>
           
           
           </apex:pageBlockSection>
           
       
        
        
        <apex:repeat value="{!wrp}" var="q">
  
<font color='#b22222'>  
<apex:outputLabel value="{!q.qs.Quest__c}" style="font-family:Times New Roman;font-size: 20px;" ></apex:outputLabel><br/>
</font>
<apex:selectList value="{!q.Name}" multiselect="false" size="1"  style="font-size: 20px;"  >
    <apex:actionSupport event="onchange" rendered="{!(q.qs.option_types__c=='picklist',TRUE,FALSE)}" />
<apex:selectOptions value="{!options[q.qs.Name]}"/>
</apex:selectList><p/>
            
        
          <apex:selectCheckboxes value="{!q.Name}">
              <apex:actionSupport event="onchange" rendered="{!IF(q.qs.option_types__c=='checkboxes',TRUE,FALSE)}" />
          <apex:selectOptions value="{!options[q.qs.Name]}"></apex:selectOptions>
              
        </apex:selectCheckboxes><br/>        
           
</apex:repeat>
            
    
<apex:pageBlockButtons location="bottom"  >
    <apex:outputPanel style="float:Centre">
<apex:commandButton action="{!save}" value="Submit" style="font-size: 18px;color:red"  />
        </apex:outputPanel>
</apex:pageBlockButtons>
      
</div>
     

      </apex:pageBlock>
     
      
        </apex:form>
</apex:page>

Thanks In Advance.
Amit Chaudhary 8Amit Chaudhary 8
Please check below post fore actionSupport tag
1) https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_actionSupport.htm

Your code should be like below
<apex:actionSupport event="onchange" rendered="{!if(q.qs.option_types__c=='picklist',TRUE,FALSE)}" />

Let us know if this will help you