No i want to get this arraylist using YUI Ajax functionality
i have a drop down in my jsp page and i am calling the ajax function with
onChange event the code which i have used for calling my action class is
working fine and even i am able to hot my action class using YUI APIbut what
i want is that i should be able to use the Arraylilst which my action is
populating using only YUI so can anybody tell me how can i use the YUI to
get access to this Arraylist which is being populated by my action class so
that i can use this arraylist for my other work using the ajax function
On Thu, Oct 16, 2008 at 4:08 PM, Hardik Shah <[EMAIL PROTECTED]> wrote:
>
> hi
>
> you can use
> <s:iterator>
> <s:property>
> </S:iterator>
>
> for getting array list of valuestack
>
> but you should setter and getter for this arraylist for accessing it from
> jsp side
>
>
> shekher awasthi wrote:
> >
> > Hi All,
> >
> > I am trying to integrate struts2 with YUI ,but facing some problems with
> > this. I want that when my action get called by YUI it must return a
> > arrayList of string which i must be able to handle using the YUI.
> >
> > For this i took the help of example from YUI site and able to hit the
> > action
> > but my problem is that how can i get the access to the arraylist which my
> > action is populating when its execute methos is called .below i m pasting
> > the code from my action calss as well as the YUI code.
> > Plaese let me know how can i get this arraylist in my YUI code
> > *
> > YUI CODE*
> >
> > <div id="container"></div>
> > <script type="text/javascript" language="javascript">
> >
> > var div = document.getElementById('container');
> >
> > var handleSuccess = function(o){
> > alert("pass");
> >
> >
> > if(o.responseText !== undefined){
> > alert("test11");
> >
> > div.innerHTML = "<li>Transaction id: " + o.tId + "</li>";
> > div.innerHTML += "<li>HTTP status: " + o.status + "</li>";
> > div.innerHTML += "<li>Status code message: " + o.statusText +
> > "</li>";
> > div.innerHTML += "<li>HTTP headers: <ul>" +
> > o.getAllResponseHeaders
> > + "</ul></li>";
> > div.innerHTML += "<li>Server response: " + o.getList().toString +
> > "</li>";
> > div.innerHTML += "<li>Argument object: Object ( [foo] => " +
> > o.argument.foo +
> > " [bar] => " + o.argument.bar +" )</li>";
> > }
> >
> >
> > }
> >
> > var handleFailure = function(o){
> > alert("fail");
> > YAHOO.log("The failure handler was called. tId: " + o.tId + ".",
> > "info", "example");
> >
> > if(o.responseText !== undefined){
> > div.innerHTML = "<ul><li>Transaction id: " + o.tId + "</li>";
> > div.innerHTML += "<li>HTTP status: " + o.status + "</li>";
> > div.innerHTML += "<li>Status code message: " + o.statusText +
> > "</li></ul>";
> > }
> > }
> >
> > var callback =
> > {
> > success:handleSuccess,
> > failure:handleFailure,
> > argument: { foo:"foo", bar:"bar" }
> > };
> >
> > var sUrl = "YUITestAction.action";
> >
> >
> >
> > function makeRequest(){
> > alert("test");
> >
> > var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);
> >
> >
> >
> > }
> > </script>
> >
> > *MY ACTION CLASS*
> >
> > public class YUITestAction extends ActionSupport{
> >
> > /**
> > *
> > */
> > private static final long serialVersionUID = 1926031204500756104L;
> > ArrayList<String> list=new ArrayList<String>();
> > public String execute() throws Exception{
> > System.out.println("inside the execute method");
> >
> > return SUCCESS;
> > }
> >
> > public ArrayList<String> getList(){
> >
> > list.add("test1");
> > list.add("test2");
> > list.add("aum");
> > list.add("arun");
> > list.add("mannu");
> > list.add("umesh");
> >
> > return list;
> > }
> > }
> >
> > any help in this regard is much appricaited
> >
> > --shekher
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Struts2%2BYUI-tp20010680p20011032.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]
>
>