简体   繁体   中英

struts2 s:display tag calling action in display table

Im using displaytable with tiles. 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. 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:

<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). In those cases, you need to tell the table tag what it's URL is via the "requestURI" attribute.

<s:url var="actionUrl"/>

You can set the requestURI="${actionUrl}" to the table tag.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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