Can anyone explain this Struts 2 AJAX Strange Refresh Behavior?

Our JSP has the following code (listed below). We can see that the action configured in the href

div gets id=pwcercontainer

called twice. Can't figure out exactly why. Replacing the containing sx:div label="Admin Record Deployment"

div with a simple non-struts div triggers an action that is called only once. We don't see anything in the documentation for sx:div

that that explains this behavior.

Does anyone know anything about this or have a similar experience?

Thank. NCF

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/tags/c.tld" prefix="c" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/tags/arcade.tld" prefix="arcade" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

<s:url id="pwcerAjax" action="pwcerajax" method="start" includeParams="none"/>
<s:url id="pwAjax" action="pwajax" method="start" includeParams="none"/>
<s:url id="listPendingDeploymentsLink" action="listPendingDeployments" namespace="/"/>
<s:url id="record" action="recordDeploymentFragment" method="showAdminRecord" namespace="/"/>



    <sx:div label="Admin Record Deployment" >

        <!-- Div where content will be displayed --> 
        <sx:div id="pwcercontainer" href="%{pwcerAjax}" showLoadingText="false" indicator="recordImage" preload="true">
        </sx:div>

        <div id="loadingContainer"><img id="recordImage" src="images/ajaxLoadingAnimation.gif" style="display:none" alt="loading animation"/></div>

    </sx:div>

      

0


source to share


1 answer


I have faced this problem many times already and there is always an error on my end. Return the snippet containing the calling code snippet:

<s:url id="getDeployQueue" action="deploymentQueue"  />

<sx:div href="%{#getDeployQueue}" formId="queueForm" executeScripts="true" autoStart="true" updateFreq="3000" preload="false" showLoadingText="false" listenTopics="refreshqueue" id="deploymentQueue" >



    THE CODE RETURNED in HERE CONTAINS THE s:url id="getDeployQueue" duplicating it and resulting in double calls

</sx:div>

      

Or, I was setting the target attribute of another ajax tag as sx: div when I really should update it using the dojo theme.



Hope this helps someone.

Neil

0


source







All Articles