struts2与struts2jquery ajax表单提交显示带有displaytag的分页表,分页不起作用

时间:2015-03-17 16:13:25

标签: ajax struts2 displaytag

我有一个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>

1 个答案:

答案 0 :(得分:0)

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

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