【问题标题】:Struts2 with struts2jquery ajax form submit display paginated table with displaytag , pagination not workingStruts2 与 struts2jquery ajax 表单提交显示分页表与 displaytag ,分页不起作用
【发布时间】:2015-03-17 16:13:24
【问题描述】:

我有一个可以使用 struts2 的显示标签。 我有一个使用 ajax 提交的表单,结果显示在结果 div 上, 现在,在结果 div 上显示的显示标签辅助表格一切正常,但是, 当我尝试在显示标签分页选项卡上选择下一步时,会刷新整个页面并显示结果页面。

调用--主jsp

<s:form method="post" action="MenuSubmit" id="form"
                                theme="simple">
                                <table>
                                    <tr>
                                        <td><s:label>Select Category</s:label></td>
                                        <td><s:select label="Select Category" list="categoryList"
                                                listKey="id" listValue="category" name="category"
                                                tooltip="Choose Category" /></td>
                                    </tr>
                                    <tr><td></td>
                                        <td><sj:submit id="btn" align="center" value="Submit"
                                                targets="res" indicator="indicator" button="true"
                                                onCompleteTopics="complete" onBeforeTopics="before" /></td>
                                    </tr>
                                </table>
                            </s:form>
                            </fieldset>

                            <img id="indicator" src="images/indicator.gif" alt="Loading..."
                                style="display: none" />
                        </div>

                        <div id=res></div>

ajax调用jsp

<display:table export="true" id="data" name="menu"
        pagesize="10" keepStatus="true" uid="one" requestURI="MenuSubmit.action">
        <display:column property="name" title="Name" sortable="true" />
        <display:column property="price" title="Price" sortable="true" />
    </display:table>

【问题讨论】:

    标签: ajax struts2 displaytag


    【解决方案1】:

    您需要阻止事件默认行为及其传播:

    event.preventDefault();
    event.stopPropagation();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-29
      • 2017-11-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多