title: Regarding Struts2 jquery double select box
body: <p>Has anyone tried implementing Struts2-jQuery example?</p>
  
  <p>I am able to do setup for example given at below link but no values are populated in the page</p>
  
  <p><a href="http://struts.jgeppert.com/struts2-jquery-showcase/index.action" rel="nofollow">http://struts.jgeppert.com/struts2-jquery-showcase/index.action</a></p>
  
  <p>and no error is show in console not able to guess wat is the problem?</p>
  
  <p>SELECTLIST.jsp</p>
  
  <pre><code>    &lt;%@ taglib prefix="sx" uri="/struts-dojo-tags" %&gt; 
  &lt;%@ taglib prefix="sj" uri="/struts-jquery-tags" %&gt; 
  &lt;%@ taglib prefix="s" uri="/struts-tags"%&gt;
  
  &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Home&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  Reload example with two select boxes.
       &lt;s:form id="formSelectReload" action="echo" theme="simple" cssClass="yform"&gt;
          &lt;fieldset&gt;
              &lt;legend&gt;AJAX Form&lt;/legend&gt;
              &lt;div class="type-text"&gt;
                  &lt;label for="language"&gt;Language: &lt;/label&gt;
                  &lt;s:url id="remoteurl" action="jsonsample"/&gt; 
                  &lt;sj:select 
                      href="%{remoteurl}" 
                      id="language" 
                      onChangeTopics="reloadsecondlist" 
                      name="language" 
                      list="languageObjList" 
                      listKey="myKey" 
                      listValue="myValue" 
                      emptyOption="true" 
                      headerKey="-1" 
                      headerValue="Please Select a Language"
                  /&gt;
              &lt;/div&gt;
              &lt;div class="type-text"&gt;
                  &lt;label for="echo"&gt;Framework: &lt;/label&gt;
                  &lt;s:url id="remoteurl" action="jsonsample"/&gt; 
                  &lt;sj:select 
                      href="%{remoteurl}" 
                      id="selectWithReloadTopic" 
                      formIds="formSelectReload" 
                      reloadTopics="reloadsecondlist" 
                      name="echo" 
                      list="reloadList" 
                      emptyOption="true" 
                      headerKey="-1" 
                      headerValue="Please Select a Framework"
                  /&gt;
              &lt;/div&gt;
              &lt;div class="type-button"&gt;
                  &lt;sj:submit 
                      id="submitFormSelectReload"
                      targets="result" 
                      value="AJAX Submit" 
                      indicator="indicator" 
                      button="true"
                      /&gt;
                      &lt;img id="indicator" 
                          src="images/indicator.gif" 
                          alt="Loading..." 
                          style="display:none"
                      /&gt;
              &lt;/div&gt;
          &lt;/fieldset&gt;
      &lt;/s:form&gt;
      &lt;br/&gt;
      Reload example with one select box and an buttonset.
       &lt;s:form id="formSelectCheckBox" action="echo" theme="xhtml"&gt;
          &lt;s:url id="remoteurl" action="jsonsample"/&gt; 
          &lt;sj:select 
              href="%{remoteurl}" 
              id="languageSelect" 
              onChangeTopics="reloadcheckboxes" 
              name="language" 
              list="languageObjList" 
              listKey="myKey" 
              listValue="myValue" 
              emptyOption="true" 
              headerKey="-1" 
              headerValue="Please Select a Language"
              label="Language"
              required="true"
          /&gt;
          &lt;s:url id="remoteurl" action="jsonsample"/&gt; 
          &lt;sj:checkboxlist 
              href="%{remoteurl}" 
              id="frameworkCheckboxes" 
              formIds="formSelectCheckBox" 
              reloadTopics="reloadcheckboxes" 
              name="echo" 
              list="reloadList" 
              label="Framework"
              required="true"
              onChangeTopics="submitCheckboxForm"
          /&gt;
          &lt;sj:submit 
              id="submitFormSelectCheckBox"
              listenTopics="submitCheckboxForm"
              targets="result" 
              value="AJAX Submit" 
              indicator="indicator2" 
              cssStyle="display : none;"
          /&gt;
      &lt;/s:form&gt;
      &lt;img id="indicator2" 
          src="images/indicator.gif" 
          alt="Loading..." 
          style="display:none"
      /&gt;
  
      &lt;strong&gt;Result Div :&lt;/strong&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>ACTION CLASS:</p>
  
  <pre><code>package showcase;
  
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.apache.struts2.convention.annotation.*;
  import org.apache.struts2.convention.annotation.Action;
  import org.apache.struts2.convention.annotation.Actions;
  import org.apache.struts2.convention.annotation.ParentPackage;
  
  import com.opensymphony.xwork2.ActionSupport;
  
  @ParentPackage(value = "showcase")
  public class JsonSample extends ActionSupport {
  
    private static final long   serialVersionUID = -2223948287805083119L;
    private static final Log    log              = LogFactory.getLog(JsonSample.class);
    private List&lt;String&gt;        languageList;
    private List&lt;ListValue&gt;     languageObjList;
    private Map&lt;String, String&gt; languageMap;
    private List&lt;String&gt;        reloadList;
    private String              language;
  
    @Actions( {
      @Action(value = "/jsonsample", results = {
        @Result(name = "success", type = "json" , location="/web/SelectList.jsp")
      })
    })
    public String execute()
    {
  
      log.info("build json lists language : " + language);
  
      languageList = new ArrayList&lt;String&gt;();
      languageObjList = new ArrayList&lt;ListValue&gt;();
      languageMap = new HashMap&lt;String, String&gt;();
  
      languageList.add("Java");
      languageList.add("PHP");
      languageList.add("C#");
  
      languageMap.put("J", "Java");
      languageMap.put("P", "PHP");
      languageMap.put("C", "C#");
  
      languageObjList.add(new ListValue("J", "Java"));
      languageObjList.add(new ListValue("P", "PHP"));
      languageObjList.add(new ListValue("C", "C#"));
  
      reloadList = new ArrayList&lt;String&gt;();
      if (language != null &amp;&amp; language.equalsIgnoreCase("J"))
      {
        reloadList.add("Struts2");
        reloadList.add("MyFaces");
        reloadList.add("Tapestry");
      }
      else if (language != null &amp;&amp; language.equalsIgnoreCase("P"))
      {
        reloadList.add("CakePHP");
        reloadList.add("Symfony");
        reloadList.add("Zend");
      }
      else if (language != null &amp;&amp; language.equalsIgnoreCase("C"))
      {
        reloadList.add("NStruts");
        reloadList.add("ProMesh.NET");
        reloadList.add("Websharp");
      }
  
      return SUCCESS;
    }
  
    public String getJSON()
    {
      return execute();
    }
  
    public List&lt;String&gt; getLanguageList()
    {
      return languageList;
    }
  
    public Map&lt;String, String&gt; getLanguageMap()
    {
      return languageMap;
    }
  
    public List&lt;ListValue&gt; getLanguageObjList()
    {
      return languageObjList;
    }
  
    public List&lt;String&gt; getReloadList()
    {
      return reloadList;
    }
  
    public void setLanguage(String language)
    {
      this.language = language;
    }
  }
  </code></pre>