Did you try publishing a topic onchange and having the div have that topic in 
its listenTopics?

Dave


--- On Thu, 8/7/08, Markus Doring <[EMAIL PROTECTED]> wrote:

> From: Markus Doring <[EMAIL PROTECTED]>
> Subject: struts2 select onchange to trigger ajax call
> To: user@struts.apache.org
> Date: Thursday, August 7, 2008, 3:37 PM
> I would like to have an onchange event from a select element
> to trigger an
> AJAX call that replaces a div.
> 
> I was trying to use the struts 2.0.11 ajax theme, but I
> cant find a why to
> bind the select element to my div. In struts 2.1 I should
> be able to use
> sx:bind, but that is not available in 2.0.11 unfortunately.
> 
> If I use a simple s:a anchor to trigger the call all works
> well:
> 
>       <s:form id="regionClassForm"
> theme="ajax" action="statsByTaxon"
> namespace="/ajax">
>               <s:select id="rank" name="rank"
> list="ranks" value="rank"
> theme="ajax"/>
>               <s:a id ="myBelovedAnchor"
> targets="imgByTaxon" theme="ajax">
> </s:a>
>       </s:form>
>       <s:div id="imgByTaxon">
>               <s:action name="statsByTaxon"
> namespace="/ajax"
> executeResult="true"/>
>       </s:div>
> 
> 
> Any ideas how I can bind the select onChange() event to...
> well, to what
> really?
> I also tried to use dojo.connect() to bind the onchange to
> the onclick of
> the anchor like this without success:
> 
>               function init() {
>                       var sel = dojo.byId("rank");
>                       var anch = dojo.byId("myBelovedTrigger");
>                       dojo.event.connect(sel, "onChange", anch,
> "onClick");
>               }
> 
> 
> thanks,
> Markus
> 
> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/struts2-select-onchange-to-trigger-ajax-call-tp18878122p18878122.html
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]

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

Reply via email to