struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: s:select + ajax issue
Date Mon, 01 Oct 2007 12:15:57 GMT
--- Pablo Vázquez Blázquez <pvazquez@denodo.com>
wrote:
> Anyone knows why this code results in an increasing
> number of threads to "RefreshTree" action when I use

> the selector??

Because your submit button listens to the published
topic of the select?

> 
> <script type="text/javascript">
>    
> dojo.event.topic.subscribe("/submitSelectorForm",
> function(data, 
> type, e) {
>         if (type=="before") {
>             //do something before the form is
> submitted
>             if (document.forms.length > 1) {
>                
> dojo.event.topic.publish("/refreshContent");
>             }
>         }
>         if (type=="load") {
>             //do something after the form is
> submitted
>         }
>     });
> </script>
> 
> 
> <div id="selector">
>     <c:if test="${!empty currentProject.projects or
> !empty projects}">    
>         <s:form id="selectProject"
> name="selectProject" 
> action="RefreshTree">
>             <s:select name="projectId"
>                 list="projects"
>                 listKey="reference"
>                 listValue="name"
>                 required="true"
>                 headerKey="-1"
>                 headerValue="-- select --"
>                 value="-1"
>                
>
onchange="dojo.event.topic.publish('/changeProject');"/>
>                 
>             <s:submit cssStyle="display:none"
> theme="ajax" 
> targets="treeAndSelector"
>                 listenTopics="/changeProject" 
> notifyTopics="/submitSelectorForm"
>                 executeScripts="true" loadingText="
> "/>
>             
>         </s:form>        
>     </c:if>
> </div>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message