views:

396

answers:

1

Hello

I have the following refreshing timer:

<s:url id="getDeployQueue" action="deploymentQueue" >
    <s:param name="readonly" value="readonly" />
</s:url>

<sx:div id="deploymentQueue" href="%{#getDeployQueue}" errorText="Oh wait, I couldn't get the queue right now!" 
    formId="queueForm" executeScripts="false" preload="true" listenTopics="refreshqueue" 
    autoStart="true" updateFreq="8000" startTimerListenTopics="/startDeployQueue" stopTimerListenTopics="/stopDeployQueue" />

The problem I have is that it waits 8000 millis before loading the content even though I have preload="true". After this it functions as I would expect, reloading the content every 8000 millis. Removing updateFreq="8000" causes the div to preload correctly but then my timer does not start.

Is this expected behaviour? If so is there a workaround?

I used to get around this by embedding html inside the sx:div tag, but Firefox 3.5 now throws security errors with this approach due to the the html containing a form, and the ajax trying to write over the top of it.

A: 

Seem like nobody has an answer, I worked around this with the following

<sx:div id="combinedQueue" href="%{#getCombinedQueue}" errorText="Awww Snap I can't get the queue" formId="queueForm" executeScripts="false" 
    autoStart="false" updateFreq="15000" preload="false" showLoadingText="false" listenTopics="refreshqueue" startTimerListenTopics="/startDeployQueue" stopTimerListenTopics="/stopDeployQueue"> 

    <noscript>
     <tiles:insertAttribute name="queue" />
    </noscript>

    <!-- Preload the deployment queue, this is done to avoid security precautions new to firefox 3.5 -->
    <sx:div id="combinedQueuePreload" href="%{#getCombinedQueue}" errorText="Awww Snap I can't get the queue" 
     executeScripts="false" preload="true" showLoadingText="false" afterNotifyTopics="/startDeployQueue" />

</sx:div>

It seemed to be failing with a security exception in the latest firefox. I worked around it by duplicating my code :(. I preload with the nested sx:div and when that is finished it notifies the div with a timer to start. Very strange.

Neil Foley