i want to asynchronously update the content of a panel, say div, in my application.

the panel should display "info" (default), "help" or "filter" information. there are to links/buttons to toggle the content. if the "help" link has been clicked the help content should be displayed and analogously with the "filter" link. if nothing is selected the "info" content should be displayed. the links act as toggle buttons so if the "filter" link is clicked when already active the panel should switch back to the info mode.

the state is managed by the corresponding action:

<action name="switch/*" method="{1}"
        class="at.synergy.cheese.view.struts.action.TestAction">
        <result name="{1}" type="freemarker">/snippets/{1}.ftl</result>
</action>

here is my freemarker template:

<@s.url id="info" value="/switch/info.action" />
<@s.url id="filter" value="/switch/filter.action" />
<@s.url id="help" value="/switch/help.action" />

<@s.a id="filterLink" theme="ajax" href="%{filter}"
        notifyTopics="switch"
        errorText="An Error ocurred">
        filter
</@s.a>

<@s.a id="helpLink" theme="ajax" href="%{help}"
        target="weather,info_content"
        notifyTopics="switch"
        errorText="An Error ocurred">
        help
</@s.a>

<@s.div id="infoPanel" href="%{info}"
        loadingText="Loading ..."
        errorText="Refresh error!"
        listenTopics="switch">
        <#include /snippets/info.ftl>
</@s.div>


the "filter" and "help" methods update the internal toggle state of the action and the "info" method diplays the result according to the current state.

but i cannot guarantee that the div will be rerendered after the links action updated the toggle state. any solution for this? is there another way to implement this in S2?

thanks in advance
~~~kULO;

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to