Hi. I have developed several gadgets and never had problems with saving userprefs. Yesterday I noticed that hidden userprefs are saved in none of my gadgets. This was very strange as I haven't changed my code. I wrote a little code to test how userprefs work generally. Here is the code: <input type='button' value='click' onclick='kuku()' /> <script> var prefs = new _IG_Prefs(); var userId = prefs.getString("userId"); function kuku(){ alert(prefs.getString("userId")); userId++; prefs.set("userId", userId);
} </script>
In case I put this code in a gadget of urlcontent-type, it works fine. When calling prefs.set() function, a request to the Google server is sent. But when I put it in a jsp file and link to this jsp from my gadget's xml (content-type is url), it doesn't work. No request is sent to Google when calling the prefs.set() method. Can someone tell me what's going on?
Looks like the environment changes for gadgets of that content type. The libraries aren't automatically incorporated like the other content types, check out this link for a reference the developer API
> Hi. > I have developed several gadgets and never had problems with saving > userprefs. Yesterday I noticed that hidden userprefs are saved in none > of my gadgets. This was very strange as I haven't changed my code. > I wrote a little code to test how userprefs work generally. > Here is the code: > <input type='button' value='click_jsp' onclick='kuku()' /> > <script> > var prefs = new _IG_Prefs(); > var userId = prefs.getString("userId"); > function kuku(){ > alert(prefs.getString("userId")); > userId++; > prefs.set("userId", userId);
> } > </script>
> In case I put this code in a gadget of html content-type, it works > fine. When calling prefs.set() function, a request to the Google > server is sent. > But when I put it in a jsp file and link to this jsp from my gadget's > xml (content-type is url), it doesn't work. No request is sent to > Google when calling the prefs.set() method. > Can someone tell me what's going on?
I checked the url you advised me. I've done what was written and my gadgets have been working fine for a long time (several months). I checked via firebug the src of the iframe containing my widget. It is http://mydomain.com/test.jsp?up_userId=0&upt_userId=hidden&lang=en&co... You see that the urls of required js files come within the parameter 'libs'. And I also saw that the script files are included. Othercase it would throw an exception on the line var prefs = new _IG_Prefs(); but it doesn't.
So, I think that smth has happened to Google's code.
Here is my source code. You can check it. This is my xml: <?xml version="1.0" encoding="UTF-8"?> <Module> <ModulePrefs title="Test"> <Require feature="setprefs"/> </ModulePrefs> <UserPref name="userId" default_value="0" datatype="hidden"/> <Content type="url" href='http://mydomain.com/test.jsp'></Content> </Module>
and this is the test.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:// www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Test</title> <% String [] libraries = request.getParameter("libs").split(","); for (String script : libraries) { if (script.endsWith("js")) %> <script src='http://www.google.com/ig/f/<%=script%>'></ script> <% } %>
</head> <body> <input type='button' value='click' onclick='kuku()' /> <script> var prefs = new _IG_Prefs(); var userId = prefs.getString("userId"); function kuku(){ alert(prefs.getString("userId")); userId++; prefs.set("userId", userId);
Today I had this exact problem in my Countdown gadget which is of content-type="url" (Iframed). This gadget has been for 3 months and I haven't changed any code. People who are already using this gadget had no problem. But new users complained about this problem and I can reproduce it my self.
user preference is of type "hidden" and I am sure that the preference is not saved.
> I checked the url you advised me. I've done what was written and my > gadgets have been working fine for a long time (several months). > I checked via firebug the src of the iframe containing my widget. > It ishttp://mydomain.com/test.jsp?up_userId=0&upt_userId=hidden&lang=en&co... > You see that the urls of required js files come within the parameter > 'libs'. > And I also saw that the script files are included. > Othercase it would throw an exception on the line > var prefs = new _IG_Prefs(); > but it doesn't.
> So, I think that smth has happened to Google's code.
> Here is my source code. You can check it. > This is my xml: > <?xml version="1.0" encoding="UTF-8"?> > <Module> > <ModulePrefs title="Test"> > <Require feature="setprefs"/> > </ModulePrefs> > <UserPref name="userId" default_value="0" datatype="hidden"/> > <Content type="url" href='http://mydomain.com/test.jsp'></Content> > </Module>
> Today I had this exact problem in my Countdown gadget which is of > content-type="url" (Iframed). This gadget has been for 3 months and I > haven't changed any code. People who are already using this gadget had > no problem. But new users complained about this problem and I can > reproduce it my self.
> user preference is of type "hidden" and I am sure that the preference > is not saved.
> On Nov 2, 5:39 am, Nare <naregaspar...@rambler.ru> wrote:
> > I checked the url you advised me. I've done what was written and my > > gadgets have been working fine for a long time (several months). > > I checked via firebug the src of the iframe containing my widget. > > It ishttp://mydomain.com/test.jsp?up_userId=0&upt_userId=hidden&lang=en&co... > > You see that the urls of required js files come within the parameter > > 'libs'. > > And I also saw that the script files are included. > > Othercase it would throw an exception on the line > > var prefs = new _IG_Prefs(); > > but it doesn't.
> > So, I think that smth has happened to Google's code.
> > Here is my source code. You can check it. > > This is my xml: > > <?xml version="1.0" encoding="UTF-8"?> > > <Module> > > <ModulePrefs title="Test"> > > <Require feature="setprefs"/> > > </ModulePrefs> > > <UserPref name="userId" default_value="0" datatype="hidden"/> > > <Content type="url" href='http://mydomain.com/test.jsp'></Content> > > </Module>
> did anyone find solution to save preference for URL content-type > gadgets ? still I am not able to save preference in my url content- > type gagets.
> Thanks, > Mahin.
> On Nov 2, 10:49 pm, Mahin <screeperz...@gmail.com> wrote:
> > "User preference not saved in content type URL"
> > Today I had this exact problem in my Countdown gadget which is of > > content-type="url" (Iframed). This gadget has been for 3 months and I > > haven't changed any code. People who are already using this gadget had > > no problem. But new users complained about this problem and I can > > reproduce it my self.
> > user preference is of type "hidden" and I am sure that the preference > > is not saved.
> > On Nov 2, 5:39 am,Nare<naregaspar...@rambler.ru> wrote:
> > > I checked the url you advised me. I've done what was written and my > > > gadgets have been working fine for a long time (several months). > > > I checked via firebug the src of the iframe containing my widget. > > > It ishttp://mydomain.com/test.jsp?up_userId=0&upt_userId=hidden〈=en&co... > > > You see that the urls of required js files come within the parameter > > > 'libs'. > > > And I also saw that the script files are included. > > > Othercase it would throw an exception on the line > > > var prefs = new _IG_Prefs(); > > > but it doesn't.
> > > So, I think that smth has happened to Google's code.
> > > Here is my source code. You can check it. > > > This is my xml: > > > <?xml version="1.0" encoding="UTF-8"?> > > > <Module> > > > <ModulePrefs title="Test"> > > > <Require feature="setprefs"/> > > > </ModulePrefs> > > > <UserPref name="userId" default_value="0" datatype="hidden"/> > > > <Content type="url" href='http://mydomain.com/test.jsp'></Content> > > > </Module>
Hello, fellow programmers.
I also am very interested in this issue since, because of it, I'm
having a hard time maintaining a Google Gadget that I developed at my
University (http://www.educ.di.unito.it/infostudenti/orari/index.php).
It has been working fine since about March 2007, until November. Then
suddenly it started to programmatically fail at saving its state on
iGoogle. Since it uses only 1 hidden userpref for saving its state as
a JSON object, I assume this suggestion doesn't apply:
http://groups.google.com/group/Google-Gadgets-API/browse_thread/threa...
For the sake of simplicity, I tried a simple test case like Nare's
one.
After calling "prefs.set(...)" I couldn't see any outgoing HTTP
package when checking via Ethereal and (on Firefox) "Live HTTP
Headers", nor I could find any error in Firefox error console (I was
also able to reproduce the same test cases on Opera 9.23 and IE 7).
> Hello, fellow programmers.
> I also am very interested in this issue since, because of it, I'm
> having a hard time maintaining a Google Gadget that I developed at my
> University (http://www.educ.di.unito.it/infostudenti/orari/index.php).
> It has been working fine since about March 2007, until November. Then
> suddenly it started to programmatically fail at saving its state on
> iGoogle. Since it uses only 1 hidden userpref for saving its state as
> a JSON object, I assume this suggestion doesn't apply:http://groups.google.com/group/Google-Gadgets-API/browse_thread/threa...
> For the sake of simplicity, I tried a simple test case like Nare's
> one.
> After calling "prefs.set(...)" I couldn't see any outgoing HTTP
> package when checking via Ethereal and (on Firefox) "Live HTTP
> Headers", nor I could find any error in Firefox error console (I was
> also able to reproduce the same test cases on Opera 9.23 and IE 7).
> I thought I would let you all know that this issue is being
> investigated, and I will let you all know when I have any updates.
> Best,
> Dan
> On Nov 19, 9:47 am, manatree <gbi...@gmail.com> wrote:
> > Hello, fellow programmers.
> > I also am very interested in this issue since, because of it, I'm
> > having a hard time maintaining a Google Gadget that I developed at my
> > University (http://www.educ.di.unito.it/infostudenti/orari/index.php).
> > It has been working fine since about March 2007, until November. Then
> > suddenly it started to programmatically fail at saving its state on
> > iGoogle. Since it uses only 1 hidden userpref for saving its state as
> > a JSON object, I assume this suggestion doesn't apply:http://groups.google.com/group/Google-Gadgets-API/browse_thread/threa...
> > For the sake of simplicity, I tried a simple test case like Nare's
> > one.
> > After calling "prefs.set(...)" I couldn't see any outgoing HTTP
> > package when checking via Ethereal and (on Firefox) "Live HTTP
> > Headers", nor I could find any error in Firefox error console (I was
> > also able to reproduce the same test cases on Opera 9.23 and IE 7).
> Is there any workaround or a quick fix for this issue ?. I still have
> this issue in my gadget.
> Thanks,
> Mahin
> On Nov 19, 12:23 pm, "Dan (Google Employee)" <api....@google.com>
> wrote:
> > Hello everyone,
> > I thought I would let you all know that this issue is being
> > investigated, and I will let you all know when I have any updates.
> > Best,
> > Dan
> > On Nov 19, 9:47 am, manatree <gbi...@gmail.com> wrote:
> > > Hello, fellow programmers.
> > > I also am very interested in this issue since, because of it, I'm
> > > having a hard time maintaining a Google Gadget that I developed at my
> > > University (http://www.educ.di.unito.it/infostudenti/orari/index.php).
> > > It has been working fine since about March 2007, until November. Then
> > > suddenly it started to programmatically fail at saving its state on
> > > iGoogle. Since it uses only 1hiddenuserpref for saving its state as
> > > a JSON object, I assume this suggestion doesn't apply:http://groups.google.com/group/Google-Gadgets-API/browse_thread/threa...
> > > For the sake of simplicity, I tried a simple test case like Nare's
> > > one.
> > > After calling "prefs.set(...)" I couldn't see any outgoing HTTP
> > > package when checking via Ethereal and (on Firefox) "Live HTTP
> > > Headers", nor I could find any error in Firefox error console (I was
> > > also able to reproduce the same test cases on Opera 9.23 and IE 7).
> This feature is very critical for me. Could you provide some update
> for this issue?
> Thanks,
> Dmitry
> On Dec 11, 10:11 am, Mahin <screeperz...@gmail.com> wrote:
> > Hi Dan,
> > Is there any workaround or a quick fix for this issue ?. I still have
> > this issue in my gadget.
> > Thanks,
> > Mahin
> > On Nov 19, 12:23 pm, "Dan (Google Employee)" <api....@google.com>
> > wrote:
> > > Hello everyone,
> > > I thought I would let you all know that this issue is being
> > > investigated, and I will let you all know when I have any updates.
> > > Best,
> > > Dan
> > > On Nov 19, 9:47 am, manatree <gbi...@gmail.com> wrote:
> > > > Hello, fellow programmers.
> > > > I also am very interested in this issue since, because of it, I'm
> > > > having a hard time maintaining a Google Gadget that I developed at my
> > > > University (http://www.educ.di.unito.it/infostudenti/orari/index.php).
> > > > It has been working fine since about March 2007, until November. Then
> > > > suddenly it started to programmatically fail at saving its state on
> > > > iGoogle. Since it uses only 1hiddenuserpref for saving its state as
> > > > a JSON object, I assume this suggestion doesn't apply:http://groups.google.com/group/Google-Gadgets-API/browse_thread/threa...
> > > > For the sake of simplicity, I tried a simple test case like Nare's
> > > > one.
> > > > After calling "prefs.set(...)" I couldn't see any outgoing HTTP
> > > > package when checking via Ethereal and (on Firefox) "Live HTTP
> > > > Headers", nor I could find any error in Firefox error console (I was
> > > > also able to reproduce the same test cases on Opera 9.23 and IE 7).
There is a fix for this issue in progress. I don't have an estimate
for when it will be released, but we are aware of the issue, and what
needs to be done to correct it.
Best,
Dan
On Jan 9, 10:32 am, Phil <philippe.gra...@gmail.com> wrote:
It's my current understanding that a fix for this issue has been
pushed into production. Is everyone still seeing the buggy behavior?
It's possible that the push hasn't rolled out everywhere yet. Please
let me know.
Thanks,
Dan
On Jan 29, 1:10 pm, "rpe...@gmail.com" <rpe...@gmail.com> wrote:
> It's my current understanding that a fix for this issue has been > pushed into production. Is everyone still seeing the buggy behavior? > It's possible that the push hasn't rolled out everywhere yet. Please > let me know.
> Thanks, > Dan
> On Jan 29, 1:10 pm, "rpe...@gmail.com" <rpe...@gmail.com> wrote: > > Hi Dan,
Hi Phil,
I m also facing this issue. As you said its working fine for you even
in case of content-type="url". Please let me know if any changes I
have to made while setting the preferences.
Thanks
On Feb 2, 12:36 am, "GRANET Philippe" <philippe.gra...@gmail.com>
wrote:
> On Feb 1, 2008 8:24 PM, Dan (Google Employee) <api....@google.com> wrote:
> > Hello,
> > It's my current understanding that a fix for this issue has been
> > pushed into production. Is everyone still seeing the buggy behavior?
> > It's possible that the push hasn't rolled out everywhere yet. Please
> > let me know.
> > Thanks,
> > Dan
> > On Jan 29, 1:10 pm, "rpe...@gmail.com" <rpe...@gmail.com> wrote:
> > > Hi Dan,