我正在使用 spring portlet mvc 和 JQuery。问题是,当我单击 displayTag 中的分页链接时(例如,当我尝试转到第二页时),我需要提交表单
<form:form id="myForm" action="${formAction}" method="post" modelAttribute="myBean" enctype="multipart/form-data">
<portlet:actionURL var="viewListURL" portletMode="view">
<portlet:param name="action" value="${ServletContextKeys.MY_ACTION}"/>
</portlet:actionURL>
<display:table id="displayImpGasto"
name="${myList}"
requestURI="${viewListURL}"
htmlId="impList"
class="displayTagTable"
uid="imp"
pagesize="10">
<display:column>
//Whatever
</display:column>
</display:table>
</form:form>
只是这样做,不提交表单。任何想法..?提前致谢。
最佳答案
要在分页链接上提交表单,您需要覆盖显示标记的属性,您可以通过创建名为 displaytag.properties 的自定义属性文件并将其放置在应用程序类路径中(通常放入 WEB-INF/classes )。您需要定义属性 paging.banner.first、paging.banner.last、paging.banner.page.link 了解更多信息,请浏览此 link 。 例如:
paging.banner.page.link :<a onclick="this.form.action='{1}';this.form.submit();" title="Go to page {0}">{0}</a>
关于jsp - 在显示标签分页中提交表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15769473/