Hi James,
the code You have shown is generating java script on server side,
and then on browser side you run it in browser.
For example You can't do this:
var myList = '<s:property value="zipCodes"/>';
myList.toUpperCase();
and expect that on server side inside action, zipCodes variable is
updated with new uppereCased value.

Also there is nothing bad in generating js on server side,
i do it all the time. It's just worth knowing that server != browser
in terms of execution space.

Best greetings,
Paweł Wielgus.


2009/12/17 james billa <jambi...@gmail.com>:
> Pawel,
>
> I am doing something like shown below and it works good for me. Isn't it
> calling the values from model/stack value from java script?  zipCodes is in
> my model. Please tell me ur option. that would help me underst it better.  I
> am using struts 2.1.6. Thanks.
>
> function showmylist() {
>  var myList = '<s:property value="zipCodes"/>';
>  var seletedzipcodelist = new Array();
>  seletedzipcodelist = myList.split(",");
>  if (seletedzipcodelist != null && seletedzipcodelist != "") {
>   for (i in seletedzipcodelist) {
>    document.getElementById(seletedzipcodelist[i]).className = "showzip";
>   }
>  }
>  document.getElementById("something").value = '<s:property
> value="NewDate"/>';
>  }
>
>
>
> 2009/12/17 Paweł Wielgus <poulw...@gmail.com>
>
>> Hi Jim,
>> action is on server side and javascript is on browser side,
>> they don't interact, You can generate js server side but that's it.
>> Js will be run in browser so it has no access to stack or action variables.
>>
>> Best greetings,
>> Paweł Wielgus.
>>
>>
>>
>> 2009/12/17 Jim Collings <jlistn...@gmail.com>:
>> > So I have two actions and one jsp.  The idea is that one is for the
>> > entire page and another is for putting into a <div> via a JavaScript
>> > method.
>> >
>> > Question:  How do I get items off of the value stack for use in
>> JavaScript?
>> >
>> >
>> > Jim C.
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> > For additional commands, e-mail: user-h...@struts.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>

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

Reply via email to