gigaZhang / struts2-jquery

Automatically exported from code.google.com/p/struts2-jquery
0 stars 0 forks source link

Default action in grid #883

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

   My problem is 
when my welcome page(index.jsp) loading the grid is build dynamically?
For that i write the following code
<html>
<body>
index.jsp
------------
$(document).ready(function(){
     document.myform.submit();
});

</script>

<body>

//titles getting from titleAction as a arraylist

<s:from action="titleAction" name="myfrom" id="myform">
</s:from>
<s:url var="gridid" action="gridAction"/>
<s:url var="editid" action="EditAction"/>

<sjg:grid gridModel="grid"
          id="reloadgrid"
          loadonce="true"
          href="%{gridid}"
          dataType="json"
          rowNum="5"
          gridview="true"
          width="600"
          viewrecords="true"
          editinline="true"
          editurl="%{editid}"
          onDblClickRowTopics="rowselect"
          caption="jQuery Inline Grid Editing"
          pager="true"
          rowList="5,10,15,20"
          reloadTopics="reloadgrid">
  <s:iterator value="al" var="key" status="status">
     <s:if test="#status.count==1">
        <sjg:gridColumn name="%{key}" title="%{key}"/>
     </s:if> 
     <s:else>   
        <sjg:gridColumn name="%{key}" title="%{key}" editable="true"/>
     </s:else>
     <s:if test="#status.last">
          <sjg:gridColumn name="editoperation" title="" formatter="formatLink" />
     </s:if>   
  </s:iterator>
 </sjg:grid>
   <sj:submit button="true" onclick="return sample()" name="save" label="sample" value="Save"></sj:submit>
     <sj:submit button="true" onclick="return Add()" name="Add" label="Add"  value="Add" ></sj:submit>

    </body>
</html>

when i am starting server the titleAction performed continuously infinite times.

what is the problem please check it once. 

Original issue reported on code.google.com by p.sagars...@gmail.com on 31 Aug 2012 at 4:56

GoogleCodeExporter commented 9 years ago
Sorry I don't understand your Issue, why do you need to submit an form for 
building your grid?

Original comment by johgep on 8 Sep 2012 at 4:40