You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@rave.apache.org by Chris Geer <ch...@cxtsoftware.com> on 2012/05/11 01:16:07 UTC

Error with gadgets.window.adjustHeight()

I'm trying to call gadgets.window.adjustHeight(); from within my gadget and
sometime it works and others it doesn't. When it has problems it's because
of an error in this method:

/*
 RPC Callback handlers
 */
/**
 * Resizes the iFrame when gadgets.window.adjustHeight is called
 *
 * @param args the RPC event args
 */
function resizeIframe(args) {
var max = 0x7FFFFFFF;
var height = args.a > max ? max : args.a;
args.gs.setHeight(height);
 }

When I debug the method what I see is that args.a is an Array with a single
value so that causes height to be null. I'm not sure what would cause that
though.

Any thoughts?

Re: Error with gadgets.window.adjustHeight()

Posted by Chris Geer <ch...@cxtsoftware.com>.
Hmmm, nvm, I sent the wrong code below...that piece of code doesn't work :)

should have been  height = height > max ? max : height;

On Fri, May 11, 2012 at 7:56 AM, Chris Geer <ch...@cxtsoftware.com> wrote:

> It happens to me all the time with the gadgets I'm currently working on
> but those would be hard to share due to all their dependencies. Let me see
> if I can recreate a sample where it happens.
>
> For the time being I've changed it to this in my version.
>
> function resizeIframe(args) {
>         var max = 0x7FFFFFFF;
>
>         var height = typeof(args.a) == 'number' ? args.a : args.a[0];
>         height = args.a > max ? max : args.a;
>         args.gs.setHeight(height);
>     }
>
> Chris
>
>
> On Fri, May 11, 2012 at 5:44 AM, Franklin, Matthew B. <mfranklin@mitre.org
> > wrote:
>
>> >-----Original Message-----
>> >From: Chris Geer [mailto:chris@cxtsoftware.com]
>> >Sent: Thursday, May 10, 2012 7:16 PM
>> >To: users
>> >Subject: Error with gadgets.window.adjustHeight()
>> >
>> >I'm trying to call gadgets.window.adjustHeight(); from within my gadget
>> and
>> >sometime it works and others it doesn't. When it has problems it's
>> because
>> >of an error in this method:
>> >
>> >/*
>> > RPC Callback handlers
>> > */
>> >/**
>> > * Resizes the iFrame when gadgets.window.adjustHeight is called
>> > *
>> > * @param args the RPC event args
>> > */
>> >function resizeIframe(args) {
>> >var max = 0x7FFFFFFF;
>> >var height = args.a > max ? max : args.a;
>> >args.gs.setHeight(height);
>> > }
>> >
>> >When I debug the method what I see is that args.a is an Array with a
>> single
>> >value so that causes height to be null. I'm not sure what would cause
>> that
>> >though.
>>
>> Interesting.  Sounds like something is going on in the Shindig common
>> container.
>>
>> Are there any cases that you can reliably reproduce the error under?
>>
>> >
>> >Any thoughts?
>>
>
>

Re: Error with gadgets.window.adjustHeight()

Posted by Chris Geer <ch...@cxtsoftware.com>.
It happens to me all the time with the gadgets I'm currently working on but
those would be hard to share due to all their dependencies. Let me see if I
can recreate a sample where it happens.

For the time being I've changed it to this in my version.

function resizeIframe(args) {
        var max = 0x7FFFFFFF;

        var height = typeof(args.a) == 'number' ? args.a : args.a[0];
        height = args.a > max ? max : args.a;
        args.gs.setHeight(height);
    }

Chris

On Fri, May 11, 2012 at 5:44 AM, Franklin, Matthew B.
<mf...@mitre.org>wrote:

> >-----Original Message-----
> >From: Chris Geer [mailto:chris@cxtsoftware.com]
> >Sent: Thursday, May 10, 2012 7:16 PM
> >To: users
> >Subject: Error with gadgets.window.adjustHeight()
> >
> >I'm trying to call gadgets.window.adjustHeight(); from within my gadget
> and
> >sometime it works and others it doesn't. When it has problems it's because
> >of an error in this method:
> >
> >/*
> > RPC Callback handlers
> > */
> >/**
> > * Resizes the iFrame when gadgets.window.adjustHeight is called
> > *
> > * @param args the RPC event args
> > */
> >function resizeIframe(args) {
> >var max = 0x7FFFFFFF;
> >var height = args.a > max ? max : args.a;
> >args.gs.setHeight(height);
> > }
> >
> >When I debug the method what I see is that args.a is an Array with a
> single
> >value so that causes height to be null. I'm not sure what would cause that
> >though.
>
> Interesting.  Sounds like something is going on in the Shindig common
> container.
>
> Are there any cases that you can reliably reproduce the error under?
>
> >
> >Any thoughts?
>

RE: Error with gadgets.window.adjustHeight()

Posted by "Franklin, Matthew B." <mf...@mitre.org>.
>-----Original Message-----
>From: Chris Geer [mailto:chris@cxtsoftware.com]
>Sent: Thursday, May 10, 2012 7:16 PM
>To: users
>Subject: Error with gadgets.window.adjustHeight()
>
>I'm trying to call gadgets.window.adjustHeight(); from within my gadget and
>sometime it works and others it doesn't. When it has problems it's because
>of an error in this method:
>
>/*
> RPC Callback handlers
> */
>/**
> * Resizes the iFrame when gadgets.window.adjustHeight is called
> *
> * @param args the RPC event args
> */
>function resizeIframe(args) {
>var max = 0x7FFFFFFF;
>var height = args.a > max ? max : args.a;
>args.gs.setHeight(height);
> }
>
>When I debug the method what I see is that args.a is an Array with a single
>value so that causes height to be null. I'm not sure what would cause that
>though.

Interesting.  Sounds like something is going on in the Shindig common container. 

Are there any cases that you can reliably reproduce the error under?

>
>Any thoughts?

RE: Error with gadgets.window.adjustHeight()

Posted by "Franklin, Matthew B." <mf...@mitre.org>.
>-----Original Message-----
>From: Franklin, Matthew B. [mailto:mfranklin@mitre.org]
>Sent: Friday, May 11, 2012 8:45 AM
>To: users@rave.apache.org
>Subject: RE: Error with gadgets.window.adjustHeight()
>
>>-----Original Message-----
>>From: Chris Geer [mailto:chris@cxtsoftware.com]
>>Sent: Thursday, May 10, 2012 7:16 PM
>>To: users
>>Subject: Error with gadgets.window.adjustHeight()
>>
>>I'm trying to call gadgets.window.adjustHeight(); from within my gadget and
>>sometime it works and others it doesn't. When it has problems it's because
>>of an error in this method:
>>
>>/*
>> RPC Callback handlers
>> */
>>/**
>> * Resizes the iFrame when gadgets.window.adjustHeight is called
>> *
>> * @param args the RPC event args
>> */
>>function resizeIframe(args) {
>>var max = 0x7FFFFFFF;
>>var height = args.a > max ? max : args.a;
>>args.gs.setHeight(height);
>> }
>>
>>When I debug the method what I see is that args.a is an Array with a single
>>value so that causes height to be null. I'm not sure what would cause that
>>though.
>
>Interesting.  Sounds like something is going on in the Shindig common
>container.

It looks like Shindig added their own RPC handler for adjustHieght, so the Rave implementation can just go away.  I will create a ticket to remove it.  It is quite possible that they have logic to handle the various conditions, since they create them : )

>
>Are there any cases that you can reliably reproduce the error under?
>
>>
>>Any thoughts?