struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Rodriguez Lopez <alo...@flordeutopia.pt>
Subject Re: Struts 2 and dynamics web page
Date Fri, 30 Apr 2010 09:16:57 GMT
This example proved helpful to me:

http://struts2inaction.com/SimpleAjax.html

In the end I ended up doing the same with jQuery:

<s:select ... onchange=" 
$('#divIDthatWillGetChanged').load('some.action?' + params ); "/>

You can get the selected option and pass as params to the called action.

The action has a result that is a jsp with just the content that will 
get loaded into the div (like a select).

Em 30-04-2010 05:02, Stephane Cosmeur escreveu:
> Hello Struts 2 Users,
>
> I would like to call an action when an envent onchange from a s:select
> component is dispatched. According to the selected value I would like to
> load data in a form in order to modify it after. To do that i would like to
> call a Struts 2 action with AJAX, is it posible and is it the best solution
> to perofrm it ?
>
> In the JSP what should i do ?
>
> Case 1: the action return a jsp page inside the main jsp page
> <s:select>
> @include page=form.jsp
>
> Case 2 : the AJAX request refresh div by calling an action
> <s:select>
> <div>
>
> Any help would be greatly appreciated
>
>
>
>


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


Mime
View raw message