Hi All,

For those who are following this thread, it appears that there may be
a bug in the latest Google Gadget Designer - this is suggested by
Stefan vd, who reported (in a private email) that my problem does not
occur in an older version (May 18, 2008) version.

This will be reported on http://code.google.com/p/google-desktop-sdk/issues/list

Many thanks to Stefan vd, who took the time to test my gadget. This is
very much appreciated.

Kind regards
Colin Goldberg



On Apr 22, 2:13 pm, Colin <[email protected]> wrote:
> Hi Stefan,
>
> I'm sorry - I don't mean to be confusing - I just left out code that I
> thought was not immediately relevant, so as to not clutter up my
> message.
>
> As I showed before, in my lb_onchange() function I had:
> var alert = lfuUserInfo.allAlerts[alert_ix];
>
> and also:
> var lfuUserInfo;
>
> I have constructor functions as follows:
>
> function constructUserInfo(username, password) {
>   this.username = username;
>   this.password = password;
>   this.user_id = null;
>   this.allAlerts = new Array();
>   this.isLoggedIn = false;
>
> }
>
> and for constructing alerts that are received in a XmlHttpResponse.
>
> function constructAlert(alertItem) {//used with SimpleXmlParser
> ...
> //Gets values such as this.alert_id, this.contact_name, etc.
> ...
>
> }
>
> As I can see from debug trace, these values are received properly.
>
> So using SimpleXmlParser I place values in array lfuUserInfo.allAlerts
> - such as in:
>
> function getAlertsResponse(parser, alertList) {//used with
> SimpleXmlParser
>         debug.trace("getAlertsResponse()");
>         if (alertList.length > 0) {
>                 for (var i = 0; i < alertList.length ; i++) {
>                         lfuUserInfo.allAlerts[lfuUserInfo.allAlerts.length] = 
> new
> constructAlert(alertList[i]);
>                 }
>                 var newAlert = showAlerts();
>         }
>         else {
>                 var newAlert = view.appendElement('<div>No new 
> alerts...</div>');
>         }
>
> }
>
> function showAlerts() {
>         debug.trace("showAlerts()");
>         for (var i=0; i<lfuUserInfo.allAlerts.length; i++) {
>                 var alert = lfuUserInfo.allAlerts[i];
>                 var alert_txt = alert.contact_name + '-' + alert.action_type;
>                 var alert_item = '<item height="24" name="item0"><label 
> height="24"
> align="center" valign="middle">' + alert_txt + '</label></item>';
>                 var newAlert = listbox.appendElement(alert_item);
>         }
>         return newAlert;
>
> }
>
> So my question still remains - What is causing the detailsview to not
> appear even though the
> detailsView_onOpen() function is clearly being executed?
>
> If you like I can send you a zip file of the gadget privately - that
> may make it easier.
>
> (Also, I did read the article 
> athttp://code.google.com/apis/desktop/articles/e12.htm
> - I based some of my gadget on it).
>
> Kind regards
> Colin Goldberg
>
> On Apr 22, 10:51 am, Stefan vd <[email protected]> wrote:
>
> > Hi Colin,
>
> > I check this part of code and ...
>
> > detailsView.detailsViewData.putValue("alert", alert);
> > // Set a reference to the "closeDetailsView" function in the
> > detailsViewData
> > detailsView.detailsViewData.putValue("closeDetailsView",
> > closeDetailsView);
>
> > function closeDetailsView() {plugin.CloseDetailsView();}
>
> > Is there not missing this code for the alert?
> > function alert() {something}
>
> > Kind Regards,
> > Stefan Van Damme (aka Stefan vd)
> > Gadget Developer
>
> > On 22 apr, 16:23, Colin <[email protected]> wrote:
>
> > > Hi,
>
> > > Yes, I have declared the variables upfront
> > > eg.
> > > var lfuUserInfo;
>
> > > and in function view_onOpen() I have:
> > > ...
> > > lfuUserInfo = new constructUserInfo(username, password); //Constructor
> > > exists and seems to be fine
> > > ...
>
> > > That all seems to be working.
>
> > > It is the statement:
> > > plugin.showDetailsView(detailsView, "Alert",
> > > gddDetailsViewFlagToolbarOpen, onDetailsViewFeedback);
>
> > > and related issues which seem to be missing something.
>
> > > So, for example, in the following action sequence:
>
> > > 1. I click on the first listbox entry (identified by name 'Paul
> > > McQuade')
> > > - no detailsview appears
> > > - debug trace shows:
> > > 10:07:42.978 - Trace: lb_onchange: alert ix=0
> > > 10:07:42.980 - Trace: lb_onchange: detailsView done
> > > 10:07:43.78 - Trace: lb_onchange: detailsView SetContent done
> > > 10:07:43.83 - Trace: detailsView_onOpen()
> > > 10:07:43.85 - Trace: detailsView_onOpen: label1_txt 1=Paul McQuade
>
> > > 2. I click on the second listbox entry ('Michael Vinal')
> > > - the detailsview appears
> > > - debug trace shows:
> > > 10:08:12.173 - Trace: lb_onchange: alert ix=1
> > > 10:08:12.175 - Trace: lb_onchange: detailsView closed
> > > 10:08:12.176 - Trace: lb_onchange: detailsView done
> > > 10:08:12.196 - Trace: lb_onchange: detailsView SetContent done
> > > 10:08:12.202 - Trace: detailsView_onOpen()
> > > 10:08:12.204 - Trace: detailsView_onOpen: label1_txt 1=Michael Vinal
>
> > > 3. I click on the third listbox entry ('Joe Ciavatta')
> > > - no detailsview appears
> > > -debug trace shows:
> > > 10:16:29.761 - Trace: lb_onchange: alert ix=2
> > > 10:16:29.763 - Trace: lb_onchange: detailsView closed
> > > 10:16:29.765 - Trace: lb_onchange: detailsView done
> > > 10:16:29.806 - Trace: lb_onchange: detailsView SetContent done
> > > 10:16:29.812 - Trace: detailsView_onOpen()
> > > 10:16:29.813 - Trace: detailsView_onOpen: label1_txt 1=Joe Ciavatta
>
> > > 4. I click on the first listbox entry again ('Paul McQuade')
> > > - the detailsview appears
> > > - debug trace shows:
> > > 10:18:08.916 - Trace: lb_onchange: alert ix=0
> > > 10:18:08.919 - Trace: lb_onchange: detailsView closed
> > > 10:18:08.921 - Trace: lb_onchange: detailsView done
> > > 10:18:08.975 - Trace: lb_onchange: detailsView SetContent done
> > > 10:18:08.984 - Trace: detailsView_onOpen()
> > > 10:18:08.985 - Trace: detailsView_onOpen: label1_txt 1=Paul McQuade
>
> > > What is causing the detailsview to not appear even though the
> > > detailsView_onOpen() function is clearly being executed?
>
> > > Kind regards
> > > Colin Goldberg
>
> > > On Apr 22, 4:01 am, Stefan vd <[email protected]> wrote:
>
> > > > Hi,
>
> > > > Do have named this variabele with a action? (declare a variable to
> > > > specify its name and characteristics)
> > > > var lfuUserInfo = ...
> > > > var allAlerts =...
>
> > > > And do you also read this article about 
> > > > DetailsView:http://code.google.com/apis/desktop/articles/e12.html
>
> > > > Kind Regards,
> > > > Stefan Van Damme (aka Stefan vd)
> > > > Gadget Developer
>
> > > > On Apr 22, 4:18 am, Colin <[email protected]> wrote:
>
> > > > > That didn't help. Clicking on a listbox item produced no activity at
> > > > > all.
>
> > > > > Kind regards
> > > > > Colin Goldberg
>
> > > > > On Apr 21, 4:06 pm, Stefan vd <[email protected]> wrote:
>
> > > > > > Hi,
>
> > > > > > If you want to show the DetailsView on a click. You must change the
> > > > > > 'onchange' to 'onclick' in you listbox object.
>
> > > > > > <listbox height="150" name="listbox" width="100%" x="0" y="20"
> > > > > > background="#FFFFFF"
> > > > > >     itemHeight="24" itemOverColor="#CCFFCC" onclick="lb_onchange()"
> > > > > >     autoscroll="true" itemSelectedColor="#99FF99"/>
>
> > > > > > Kind Regards,
> > > > > > Stefan Van Damme (aka Stefan vd)
> > > > > > Gadget Developer
>
> > > > > > On Apr 21, 5:32 pm, Colin <[email protected]> wrote:
>
> > > > > > > Hi,
>
> > > > > > > As a newbie to gadget development, I have a question relating to 
> > > > > > > the
> > > > > > > behavior opening a DetailsView window. Basically, the DetailsView
> > > > > > > window appears (ie. is visible) for alternate clicks in the 
> > > > > > > listbox in
> > > > > > > my main view - and not each time. But debug.trace shows me that 
> > > > > > > the
> > > > > > > detailsView_onOpen() function is being called every time. Is it
> > > > > > > something to do with the flags (gddDetailsViewFlagToolbarOpen, 
> > > > > > > etc.)?
>
> > > > > > > in My main view, I have:
> > > > > > > <listbox height="150" name="listbox" width="100%" x="0" y="20"
> > > > > > > background="#FFFFFF"
> > > > > > >     itemHeight="24" itemOverColor="#CCFFCC" 
> > > > > > > onchange="lb_onchange()"
> > > > > > >     autoscroll="true" itemSelectedColor="#99FF99"/>
>
> > > > > > > I initialize detailsView at the top:
> > > > > > > var detailsView = new DetailsView();
>
> > > > > > > And function lb_onchange is:
>
> > > > > > > function lb_onchange() {
> > > > > > >   var selectedItem = listbox.selectedItem;
> > > > > > >         var alert_ix = listbox.selectedIndex;
> > > > > > >         var alert = lfuUserInfo.allAlerts[alert_ix];
> > > > > > >         debug.trace("lb_onchange: alert ix="+alert_ix);
> > > > > > >         //var detailsView = new DetailsView(); //done on 
> > > > > > > initialization
> > > > > > >         debug.trace("lb_onchange: detailsView done");
> > > > > > >         detailsView.SetContent( "", undefined, "details.xml", 
> > > > > > > false, 0);
> > > > > > >         debug.trace("lb_onchange: detailsView SetContent done");
> > > > > > >         detailsView.detailsViewData.putValue("alert", alert);
> > > > > > >         // Set a reference to the "closeDetailsView" function in 
> > > > > > > the
> > > > > > > detailsViewData
> > > > > > >   detailsView.detailsViewData.putValue("closeDetailsView",
> > > > > > > closeDetailsView);
> > > > > > >   // Show the details view
> > > > > > >         plugin.showDetailsView(detailsView, "Alert",
> > > > > > > gddDetailsViewFlagToolbarOpen, onDetailsViewFeedback);
> > > > > > >         detailsViewIsOpen = true;
> > > > > > >         debug.trace("lb_onchange: showDetailsView done");
>
> > > > > > > }
>
> > > > > > > Also, in my main view:
>
> > > > > > > function closeDetailsView() {
> > > > > > >   plugin.CloseDetailsView();
>
> > > > > > > }
>
> > > > > > > function onDetailsViewFeedback(detailsViewFlags) {
> > > > > > >   if (detailsViewFlags == gddDetailsViewFlagNone) {
> > > > > > >     // User closed the details view
> > > > > > >   } else if (detailsViewFlags == gddDetailsViewFlagToolbarOpen) {
> > > > > > >     // User clicked on the title of the details view
> > > > > > >   }
>
> > > > > > > }
>
> > > > > > > My DetailsView xml is:
>
> > > > > > > <view height="150" width="450" onopen="detailsView_onOpen()">
> > > > > > >   <img height="150" width="450" x="0" y="0" src="stock_images
> > > > > > > \background.png"
> > > > > > >    />
> > > > > > > <img cursor="hand" enabled="true" name="imgClose" x="320" y="8"
> > > > > > > onclick="detailsView_Close()"
> > > > > > >       src="images\closeBtn.png"/>
> > > > > > >   <label enabled="true" height="15" name="label1" x="20" y="25"
>
> ...
>
> read more »
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Desktop Developer Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Desktop-Developer?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to