title: Jquery Select box values using Struts2 UI tags
body: <p>In a jsp page i have a select Input which gets the values from a Struts2 action, and i am using Struts2 iterator tag to get the values.</p>
  
  <pre><code>&lt;select id="package-type-input" name="packageTypeId"&gt;
      &lt;gs:iterator var="package" value="" id="test-iterator"&gt;
         &lt;option value='&lt;gs:property value="#package.id"/&gt;'  
         &lt;gs:property value="#package.packagename"/&gt;&lt;/option&gt;
      &lt;/gs:iterator&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I am getting values from the struts2 action as List packagesList. I am trying to add those values to the iterator using the below line. But its not working</p>
  
  <pre><code>$("#test-iterator").val(packageList). 
  </code></pre>
  
  <p>The ajax call is  </p>
  
  <pre><code>_getAccountDetails: function () {
      var self = this;
      var organizationId = self.id;
      $.ajax({
          type: "POST",
          url: self.url.getOrgPackageDetails,
          dataType: 'json',
          traditional: true,
          data: "organizationId=" + organizationId,
          success: function (response) {
              self._setData(response.data,response.packageList);
          },
          error: function (response) {}
      });
  },
  </code></pre>
  
  <p>the response.packageList is the jsonified form of java Array list.
  setData method sets the data from response.data into its respective fields.</p>
  
  <pre><code>_setData: function (data, packageList) {
      var self = this;
      self.dom.currentPackageType.val(data.CurrentPackage);
      self.dom.currentUsersLimit.val(data.Users);
      self.dom.currentEntityLimit.val(data.Entities);
      self.dom.CurrentRenewalDate.val(moment(data.RenewDate).calendar());
      self.dom.currentQEntityLimit.val(data.QEntity);
      self._bindGUIEvents()
  },
  </code></pre>