title: jqGrid combobox: how to add values Dynamically
body: <p>I am developing a web application using JSP &amp; Servlet (IDE: Eclipse, Database: Oracle10).
  I am using jqGrid to display records in tabular format.</p>
  
  <p>I want to get values for combobox in <code>jqGrid</code> from servlet, so far I have done following.</p>
  
  <p>I am accessing the array passed by Servlet in JSP scriplet.</p>
  
  <pre><code>&lt;%
      String[] stageIDs = (String[])request.getAttribute("combo");
  %&gt;
  </code></pre>
  
  <p>Following is my colModel:</p>
  
  <pre><code>jQuery("#list10_d").jqGrid({
              height: "100%",
              url:'ProtocolJGridServChild?q=2&amp;action=protAction',
              datatype: "xml",
  colNames:['Sr. No.','PID',  'SID'],
  colModel:[{name:'srNo',index:'srNo', width:35,sortable:true},
  {name:'PID',index:'PID', width:100,sortable:false,editable:true,hidden:true},
  {name:'SID',index:'SID', width:100, sortable:false, editable:true, edittype:"select",editoptions:{value:&lt;%for(int i=0;i&lt;stageIDs.length;i++)%&gt;&lt;%="ID:"+ stageIDs[i]+";"%&gt;}}
  ],
              rowNum:2,
              rowList:[2,4,6],
              pager: '#pager10_d',
              sortname: 'PID',
              viewrecords: true,
              sortorder: "asc",
              multiselect: true,
              editurl: "MyServletName",
              caption:"CRM_PROT_ACTIONS",
  }).navGrid('#pager10_d',{edit:true,add:true,del:true});
  </code></pre>
  
  <p>But I am getting an exception in <code>for loop line</code> where I am assigning the editoptions to the combobox. Please let me know is there any mistake in code.</p>
  
  <p>My another question is that is there any better way of assigning values to combobox in jqGrid from servlet (without using scriplet)?</p>