This tag generates an HTML div that loads its content using an XMLHttpRequest call, via the dojo framework. When the "updateFreq" is set the built in timer will start automatically and reload the div content with the value of "updateFreq" as the refresh period(in milliseconds). Topics can be used to stop(stopTimerListenTopics) and start(startTimerListenTopics) this timer.
When used inside a "tabbedpanel" tag, each div becomes a tab. Some attributes are specific to this use case, like:
- refreshOnShow: div content is realoded when tab is selected
- closable: Tab will have close button
- preload: load div content after page is loaded
Examples
<sx:div href="%{#url}">Initial Content</sx:div> <img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" style="display:none"/> <sx:div href="%{#url}" updateFreq="2000" indicator="indicator"> Initial Content </sx:div> <form id="form"> <label for="textInput">Text to be submited when div reloads</label> <input type=textbox id="textInput" name="data"> </form> <sx:div href="%{#url}" updateFreq="3000" listenTopics="/refresh" startTimerListenTopics="/startTimer" stopTimerListenTopics="/stopTimer" highlightColor="red" formId="form"> Initial Content </sx:div>