+ Start a Discussion
surasura 

How to Assign Visualforce Components Dynamically

hi guys I am having trouble Assignning unique ids dynamically to visaul force page components inside a pageblock table since id element only allow String Literals as values ,

 

Does any one have work around for this ????

 

my code is as follows

<apex:pageblock id="pb2" rendered="{!employeesSearched}">           
               <apex:pageBlockTable id="feedbacktable" value="{!feedbackList}" var="item" rendered="{!employeesSearched}">
               <apex:column >
                  <apex:facet name="header">Employee Name</apex:facet>
                  <apex:outputField value="{!item.Employee__r.First_Name__c}"/>&nbsp;
                  <apex:outputField value="{!item.Employee__r.Last_Name__c}"/>
              </apex:column>
              <apex:column headerValue="Rating">
                 
                  
                <!--  <apex:inputHidden id="rating" value="{!item.Rating__c}" >
                  </apex:inputHidden>-->
                  
                  <input type="hidden" id="{!item.Employee__r.Id}" onfocus="testHidden(this)"/>
                  
                  <c:slider2 eId="{!item.Employee__r.Id}" width="100" />
                 
              </apex:column>   
              <apex:column >
                  <apex:facet name="header">Comment</apex:facet>
                  <apex:inputTextArea value="{!item.Comment__c}"></apex:inputTextArea>
              </apex:column>                
               </apex:pageBlockTable>

 <input type="hidden" id="{!item.Employee__r.Id}" onfocus="testHidden(this)"/> 

I have problem with above line

 

hemantgarghemantgarg

Try like following :-

 

<input type="hidden" id="Hidden_{!item.Employee__r.Id}" onfocus="testHidden(this)"/>