Hi James !

You forgot to use an input param on showSent function.

function showSent(data){
}

Why dont you send your parameters and then concatenate data to make your url
? It´s safer than doing what you did.

Example:

postdata_array={ uid: 1, size: "middle", type: "virtual"}
var postdata = gadgets.io.encodeValues(postdata_array);
var params = {};
params[gadgets.io.RequestParameters.METHOD] =gadgets.io.MethodType.POST;
params[gadgets.io.RequestParameters.POST_DATA]= postdata;
gadgets.io.makeRequest(url, showSent, params);

on your index.jsp, use request.getParameter("uid"),
request.getParameter("size") and request.getParameter("type")  to
concatenate and make your url.

If you can, install firebug on your firefox to see the async call and input
params. You can see if there´s a bug on encodeValues function.

Let me know if you have any doubt.

cheers,

-Robson Dantas




2009/2/26 James Zhang <jmszh...@gmail.com>

>
> gadget.xml:
>
>                <script>
>                        gadgets.util.registerOnLoadHandler(init);
>
>                        function init() {
>                                var url = "
> http://localhost:8080/test/index.jsp";;
>                                var postdata_array = {};
>                                postdata_array["field"] = "
> http://localhost/ucenter/avatar.php?
> uid=1&size=middle&type=virtual<http://localhost/ucenter/avatar.php?%0Auid=1&size=middle&type=virtual>
> ";
>                                var postdata =
> gadgets.io.encodeValues(postdata_array);
>                                var params = {};
>                                params[gadgets.io.RequestParameters.METHOD]
> =
> gadgets.io.MethodType.POST;
>
>  params[gadgets.io.RequestParameters.POST_DATA]= postdata;
>                                gadgets.io.makeRequest(url, showSent,
> params);
>                        }
>
>                        function showSent(){
>
>                        }
>
>                </script>
>
> index.jsp
> <%
> String field = request.getParameter("field");
> System.out.println("field is ["+field+"]");
> %>
>
> ---------------
>
> In index.jsp,you will never get this field value.
>
> but :"field is [null]"
>
> I think makerequest can't get post_data with "=".
>
> Very disappointed for these days!
>
> The data style "http://localhost/ucenter/avatar.php?
> uid=1&size=middle&type=virtual<http://localhost/ucenter/avatar.php?%0Auid=1&size=middle&type=virtual>"
> means ThumbnailUrl in lots of SNS site
> here!
>
> --James
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenSocial Application Development" group.
To post to this group, send email to opensocial-api@googlegroups.com
To unsubscribe from this group, send email to 
opensocial-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to