If you would like to create a helper class for your ajax stuff, here is a link
to show you what your Java code would look like. Follow Setup Configuration to
see how to set it up.
http://www.xoscript.org/opencms/opencms/documentation/aboutjava.html
Here is what the JavaScript code would look like.
var combo = myHelperClass.getSomeData(intValue);
//where intValue represents the argument expected by your Java method.
//combo is now a Map so....
var iterator = combo.keySet().iterator();
while(iterator.hasNext()){
var theKey = iterator.next();
someDropDownBox.options[someDropDownBox.options.length] =
new Option(theKey,combo.get(theKey));
}
I am testing a new version of xoscript with Struts integration so you can push
action forwards through a method call, I hope to have it ready soon.
Bryan LaPlante
---------- Original Message -----------
From: "Madhav Bhargava" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[email protected]>
Sent: Thu, 6 Apr 2006 12:48:04 +0530
Subject: Struts and Ajax
> Hi All,
>
> I have 2 drop downs in my JSP. One drop down gets populated based on the
> value selected in the other drop down. At present this is done using a Tag
> handler call. The control goes to a rendering action which then forwards the
> call to the JSP. From within the JSP the tag handler is invoked passing all
> the necessary arguments. This all works fine except that now the client
> wants to introduce Ajax so that a page refresh is avoided.
>
> I do not want to put any Html generating logic inside my action class. Is
> there any other elegant way in which i can generate the HTML for the drop
> down.
>
> I can very well write different methods to generate the HTML code and then
> call these methods from within my action class. But somehow this does not
> look very elegant to me.
>
> Any help will be appreciated.
>
> --Madhav
>
> --
> When I tell the truth, it is not for the sake of convincing those who do not
> know it, but for the sake of defending those that do
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]