title: Export to PDF in struts 2 : Calling different action class doesn't bind form values
body: <p>In my application, I select the user's name (using check box) and click "Export Data" button, which will open a pop-up (asking whether to export in <code>PDF</code> or <code>CSV</code>). I used <code>jQueryUI</code> to get the <code>modal-dialog</code></p>
  
  <p><strong>the checkbox is in different form and the "Export Data" is out of that form, So when i hit an action-class using document.location.href am not able to get the checkbox values</strong></p>
  
  <p>This is how the checkbox is formed in JSP</p>
  
  <pre><code>&lt;s:form action="dashboard" theme="simple"&gt;
  
  &lt;s:checkbox name="selectedStudents[%{#status.index}].studentId" id="student%{#status.index}" fieldValue="%{studentId}" value="0"/&gt;
  
  &lt;/s:form&gt;
  </code></pre>
  
  <p>on click of "Export Data" button, i call the method (written in struts-2 action) from jquery. Please look the jquery  code below</p>
  
  <pre><code>$(function() {
          $("#exportStudentReports").click(function(){
              $( "#exportModalWindow" ).dialog({
                  resizable: false,
                  height: 50,
                  width: 200,
                  modal: true,
                  hide: "explode",
                  buttons:{
                      "Export": function() {
                          var link = "/web/teacher/exportReport!exportStudentReports.action?exportType=pdf" ;
                          document.location.href=link;
                          $("#exportModalWindow").dialog("close");
                      }
                  }
              });
              var isOpened = $("#exportModalWindow").dialog("isOpen") ;
              if (!isOpened) {
                  $("#exportModalWindow").dialog("open");
              }
              $("#exportStuReportPDF").attr("checked","checked") ;
          });
  
      });
  </code></pre>
  
  <p>This is how my struts-action-configuration is</p>
  
  <pre><code>&lt;action name="exportReport" class="com.hmco.ssms.action.teacher.ExportReportAction"&gt;
              &lt;result name="studentReportPDF" type="stream"&gt;
                  &lt;param name="inputName"&gt;inputStream&lt;/param&gt;
                  &lt;param name="contentType"&gt;application/pdf&lt;/param&gt;
                  &lt;param name="contentDisposition"&gt;attachment;filename="sample.pdf"&lt;/param&gt;
                  &lt;param name="bufferSize"&gt;1024&lt;/param&gt;
              &lt;/result&gt;
          &lt;/action&gt;
  </code></pre>
  
  <p>Please help me on this. Thanks</p>