struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeromy Evans <jeromy.ev...@blueskyminds.com.au>
Subject Re: Ajax based implementation for Radio Button in Struts 2.0
Date Tue, 08 Jul 2008 13:41:56 GMT
AjaySrini wrote:
> Hi,
>
> Currently i'm developing a web application which consists of 4 radio buttons
> using Struts 2.0 written in div tag. Based on the selection of the radio
> buttons i need to display the other struts tags such as
> <s:optiontransferselect>, <s:groupbox>, <s:combobox>, etc...  using
ajax
> implementation.
>
> Looking forward to ur reply...
>
> Thanks,
> Srini.
>   

Simple solution (no ajax):
  include the s:optiontransferselect etc in hidden divs in the page.  
use javascript to show/hide the divs on radio button events.

Ajax solution:
Attach an event listener to the radio button (eg. with the onchange ).
Have the listener publish a topic. 
Struts2 will make the ajax request and insert the response into your 
target div.
Your response contains the s:optiontransferselect etc tags.

Topics are discussed here: 
http://struts.apache.org/2.0.11/docs/ajax-tags.html

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


Mime
View raw message