简体   繁体   English

struts2 s:display标签在显示表中的调用动作

[英]struts2 s:display tag calling action in display table

Im using displaytable with tiles. 我在瓷砖上使用了displaytable。 Problem is in my crud application, when I search something its loading data into display table, It will load the data correctly my display table it self having edit option so that I can go to the next action from the edit. 问题出在我的原始应用程序中,当我搜索将其加载数据显示到显示表中的东西时,它将正确地将数据加载到我的显示表中,该显示表具有编辑选项,这样我就可以从编辑转到下一个动作。 Then I call Edit and after edit it goes to the that edit.action ande open new jsp.after updating the contents I am again coming to the listing page. 然后我调用Edit,然后在编辑后转到那个edit.action并在更新内容后打开新的jsp。我再次进入列表页面。 till here its fine.But after that if I am pressing next option od display table.then again its taking the control to the edited jsp instead going to the next pag pagination. 直到这里一切正常为止。 please help me to resolve this. 请帮助我解决此问题。

Jsp code: Jsp代码:

<display:table id="regionListTable" name="regionList" pagesize="10" class="dataTable" requestURI="" cellpadding="2px;" cellspacing="2px;" style="width:100%;text-align:left;">

    <display:setProperty name="paging.banner.full" value='<span class="pagelinks"><a href="{1}" onclick="return false"></a> <a href="{2}"><span class="pagenation_LeftAro"/></a>  <a href="{3}"><span class="pagenation_RightAro"/></a><a href="{4}" onclick="return false"></a></span>' />
    <display:setProperty name="paging.banner.first" value='<span class="pagelinks"><a href="{1}"  onclick="return false"></a> <a href="{2}" onclick="return false"></a> <a href="{3}"><span class="pagenation_RightAro"/></a><a href="{4}" onclick="return false"></a></span>' />
    <display:setProperty name="paging.banner.last" value='<span class="pagelinks"><a href="{1}" onclick="return false"></a> <a href="{2}"><span class="pagenation_LeftAro"/></a> <a href="{3}" onclick="return false"></a><a href="{4}"  onclick="return false"></a></span>' /> 
    <display:setProperty name="paging.banner.some_items_found" value='<span class="pagelinks"> {2}-{3} of {0}</span>'/>
    <display:setProperty name="paging.banner.all_items_found" value='<span class="pagelinks">1-{0} of {0}</span>' />
    <display:setProperty name="paging.banner.onepage" value='<span class="pagelinks"></span>'></display:setProperty>    

            <div class="tableContCorner tableCorTL"></div>
            <div class="tableContCorner tableCorTR"></div>

            <s:set var="regName" value="%{getText('label.region.addedit.regionName')}" />
            <s:set var="mscSer" value="%{getText('label.region.addedit.mscSeries')}" />
            <s:set var="msisdnSer" value="%{getText('label.region.addedit.msisdnSeries')}" />
            <s:set var="hlrSer" value="%{getText('label.region.addedit.hlrSeries')}" />
            <s:set var="edit" value="%{getText('label.Common.Edit')}" />
            <s:set var="del" value="%{getText('label.Common.Delete')}" />


    <display:column style="text-align:center;"
        title="<input type='checkbox' name='del' onClick='selectAll(this, regionIDArray)' />"
        media="html">
        <s:checkbox name="regionIDArray" cssClass="mulDel"
            fieldValue="%{#attr.regionListTable.regionId}"
            id="%{#attr.regionListTable.regionId}" value="false"
            theme="simple" class="selectableCheckbox" />
    </display:column>

    <display:column style="word-break:break-all;text-align:center;" property="regionName"
        title="${regName}" />
    <display:column style="word-break:break-all;text-align:center;" property="mscSeries"
        title="${mscSer}" />
    <display:column style="word-break:break-all;text-align:center;"
        property="msisdnOrImsiSeries" title="${msisdnSer}" />
    <display:column style="word-break:break-all;text-align:center;" property="hlrSeries"
        title="${hlrSer}" />

    <display:column title="${edit}" style="text-align:center;">

                <s:a
                href="javascript:editRegion('%{#attr.regionListTable.regionId}')">
                <span class="pen_paper" onclick="alert('Row id: ' + %{#attr.regionListTable.regionId})"></span>
            </s:a></display:column>



        <display:column class="center noRitBdr" title="${del}" style="text-align:center;">
            <s:a href="javascript:deleteRegion('%{#attr.regionListTable.regionId}')">
                <span class="mR10" onclick="return delConfirm();">
                    <s:text name="label.Common.Delete"></s:text>
                </span>
             </s:a> 
        </display:column>
</display:table>

this is display table. 这是显示表。

By default, the table tag tries to figure out what the URL is for the page it is on by calling the request.getRequestURI() method, but this will not always return a correct answer in environment where you are forwarding a request around before arriving at the JSP that is to be displayed (like Struts). 默认情况下,table标记会尝试通过调用request.getRequestURI()方法来找出其所在页面的URL,但这在您到达之前转发请求的环境中并不一定会返回正确的答案。在要显示的JSP上(例如Struts)。 In those cases, you need to tell the table tag what it's URL is via the "requestURI" attribute. 在这种情况下,您需要通过“ requestURI”属性告诉表标签其URL是什么。

<s:url var="actionUrl"/>

You can set the requestURI="${actionUrl}" to the table tag. 您可以将requestURI="${actionUrl}"到表标记。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM