title: how to stop reloading parent window while child window gets open
body: <blockquote>
    <p>I have a form submit, where it get the values from the form and goes
    to next page... here I have a hyperlink to open a child window, while
    I click, it opens the child window and simultaneously it reloads the
    parent window. I have a action configured to the parent window which
    has a Database insert statement too. </p>
    
    <p>The problem is that while I click the link it call my action
    again(because of page reload), in this action I wrote if condition to
    check null/empty string from the previous page form submit. since this
    is the second time the action loads it looks of the fields(but
    actually those fields are in my previous page form). so it take null
    while checking my if condition.</p>
    
    <p>Another problem is that when I solve the above problem here comes the
    SQL insert statement, which is about to execute 2nd time. I dont want
    this to happen or I dont want my action to execute while I open the
    popup window and I want to populate the selected value from the popup
    to the parent window.</p>
  </blockquote>
  
  <p><strong>code used for opening the popup</strong></p>
  
  <pre><code> function select_reactant()
      {
          window.open ("SeriesTab.action?component=reactant",
              "mywindow","scrollbars=1,resizable=1,width=1000,height=1000");  
          };
  </code></pre>
  
  <p><strong>This is the place where I open the popup and want to populate the value selected from the popup to the textfiled here</strong></p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt;&lt;a href="" onclick="select_reactant();"&gt;reactant&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;s:textfield name="reactant" id="reactantId" readonly="true" theme="simple"/&gt;&lt;/td&gt;
    &lt;/tr&gt;
  </code></pre>
  
  <p><strong>jquery to get back the value form popup to parent window</strong></p>
  
  <pre><code>$(window.opener.document).find('#reactantId').val(rxn);
  </code></pre>
  
  <p><strong>the code inside action below is what the action that I mention at the beginning</strong> </p>
  
  <pre><code>if(Rxn!=null||!Rxn.equals(""))  //Rxn is the field variable for previous page
  { 
  //my insert statement
  }
  </code></pre>
  
  <p>while I run I get nullpointer error since the value for Rxn is reset to null by the page reload due to popup opening done by </p>
  
  <pre><code>window.open 
  </code></pre>