History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-4175
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: P1 P1
Assignee: Unassigned
Reporter: Frisco Del Rosario
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

DHTML calendar demo wigs out on opening Event Info

Created: 20/Jun/07 03:03 PM   Updated: 05/Oct/07 12:43 PM
Component/s: SA - Calendar
Affects Version/s: 4.0.2
Fix Version/s: RingDing, 4.0.6/Jujube

Time Tracking:
Not Specified

File Attachments: 1. File lpp-4175.lzx (2 kb)


Severity: Minor
Fixed in Change#: 6,676
Fixed in branch: trunk
Runtime: N/A
Fix in hand: False


 Description  « Hide
/demos/calendar/calendar.lzx?lzr=dhtml

Click on an event (i slider opens)
Click 'i' to open Event Info

Expect
Nothing weird

Got
Calendar panel shifting 500 pixels to the left

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Josh Crowley - 06/Jul/07 02:33 AM
Weird. This was something Max had fixed, having to do with how DHTML apps are embedded in pages in IE.

Josh Crowley - 14/Aug/07 09:57 PM
I've managed to narrow this one down. It's a problem with calling LzFocus.setFocus() on something outside the viewable canvas area in DHTML. Try running the following test case in DHTML:

<canvas width="400" height="600">

    <view width="${canvas.hat.expanded ? 265 : 390}" x="5" height="550"
        y="5" bgcolor="0x00FF00">
        <button width="10" height="10" x="30" y="30">
            <handler name="onclick">
                canvas.hat.setAttribute('expanded', !canvas.hat.expanded);
            </handler>
        </button>
    </view>
    
    <view name="hat" width="120" x="400" height="550" y="5" bgcolor="0xFF00FF">
        <attribute name="expanded" type="boolean" value="false"/>
        <event name="onexpanded"/>
        <handler name="onexpanded">
            if(this.expanded == true){
                this.slideit.doStart();
            } else {
                this.slideback.doStart();
            }
            LzFocus.setFocus(this.focustext);
        </handler>
        
        <edittext name="focustext" width="${parent.width - 20}" x="10" text="Focus on me."/>
        
        <animator name="slideit" attribute="x" from="400" to="280" duration="5000" start="false"/>
        <animator name="slideback" attribute="x" from="280" to="400" duration="5000" start="false"/>
    </view>

</canvas>

Clicking the button will, for some reason, shift the visible canvas area over to whatever is being focused on off-canvas. The culprit in this case (the Calendar) was:

LzFocus.setFocus(summary.content.title);

Commenting this line out resulted in no weird shifting in the app. Weird...

I'll probably use a workaround on this particular case, where I call LzFocus.setFocus(); in the onstop of one of the expanding animators, to be sure it's not called until the object is fully on canvas. I'm going to create a new bug, though, for Max, addressing this larger issue.

Amy Muntz - 28/Sep/07 09:31 AM
David has requested that this be fixed for jujube, if it is isolated to the app. Please merge to wafflecone for jujube upon review/resolution.

Josh Crowley - 28/Sep/07 02:00 PM
Approved by Phil. Checkin transcript follows:

Author: jcrowley
Date: 2007-09-28 13:26:36 -0700 (Fri, 28 Sep 2007)
New Revision: 6676

Modified:
  openlaszlo/trunk/demos/calendar/infopanel.lzx
Log:
Change 20070928-jcrowley-u by jcrowley@doctormanhattan.mshome.net on 2007-09-28 16:24:50 EDT
   in /Users/jcrowley/src/svn/openlaszlo/trunk-a
   for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: [repackaging for trunk - this was approved by Phil]
       DHTML calendar demo wigs out on opening Event Info

New Features:

Bugs Fixed: LPP-4175 - DHTML calendar demo wigs out on opening
       Event Info

Technical Reviewer: pbr
QA Reviewer: max
Doc Reviewer:

Documentation:

Release Notes:

Details: I found a larger bug with this one, which was auto-
       assigned to Tucker. It's LPP-4499. The issue here is
       really that calling LzFocus.setFocus() on something
       off-canvas in DHTML will slide the canvas over so that
       the focused item is visible. I worked around it in
       this case by moving it into an onstop event for one
       of the animators called by the same method, to ensure
       it didn't get called until after the object was fully
       on-screen.

Tests: Run modified Calendar versus unmodified in DHTML; note
       the modified version doesn't slide over all crazy-like
       when the info panel is opened by clicking the 'i' on
       a selected event tag.



Modified: openlaszlo/trunk/demos/calendar/infopanel.lzx
===================================================================
--- openlaszlo/trunk/demos/calendar/infopanel.lzx 2007-09-28 20:26:11 UTC (rev 6675)
+++ openlaszlo/trunk/demos/calendar/infopanel.lzx 2007-09-28 20:26:36 UTC (rev 6676)
@@ -280,7 +280,7 @@
        <animator start="false" name="slideopen1old" attribute="width" to="204"
            duration="500" relative="false"/>
        <animator start="false" name="slideopen1" attribute="x" to="602" from="830"
- duration="500"/>
+ duration="500" onstop="LzFocus.setFocus(parent.summary.content.title);"/>
        <animator start="false" name="slideopen2" attribute="opacity" to="1" from="0"
            duration="500" relative="false"/>

@@ -319,7 +319,6 @@
            this.setOpacity(1);
            this.slideopen1.doStart();
            this.slideopen2.doStart();
- LzFocus.setFocus(summary.content.title);
            this.opened = true;

        </method>

Josh Crowley - 28/Sep/07 02:01 PM
Reopening for merge into Jujube.

Josh Crowley - 28/Sep/07 02:51 PM
This is now also checked into Jujube, as revision 6682. Approved by Phil. Transcript follows:

Author: jcrowley
Date: 2007-09-28 14:49:13 -0700 (Fri, 28 Sep 2007)
New Revision: 6682

Modified:
  openlaszlo/branches/wafflecone/demos/calendar/infopanel.lzx
Log:
Change 20070928-jcrowley-u by jcrowley@doctormanhattan.mshome.net on 2007-09-28 17:07:30 EDT
   in /Users/jcrowley/src/svn/openlaszlo/wafflejujube
   for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: [this has been fixed in trunk; Amy wants this integrated
       into Jujube] HAND-MERGE: DHTML calendar demo wigs out on
       opening Event Info

New Features:

Bugs Fixed: LPP-4175 - DHTML calendar demo wigs out on opening Event Info

Technical Reviewer: pbr
QA Reviewer: max
Doc Reviewer:

Documentation:

Release Notes:

Details: Hand-merging r6676 from trunk into jujube.

Tests: Run modified Calendar versus unmodified in DHTML; note
       the modified version doesn't slide over all crazy-like
       when the info panel is opened by clicking the 'i' on
       a selected event tag.



Modified: openlaszlo/branches/wafflecone/demos/calendar/infopanel.lzx
===================================================================
--- openlaszlo/branches/wafflecone/demos/calendar/infopanel.lzx 2007-09-28 21:13:02 UTC (rev 6681)
+++ openlaszlo/branches/wafflecone/demos/calendar/infopanel.lzx 2007-09-28 21:49:13 UTC (rev 6682)
@@ -280,7 +280,7 @@
        <animator start="false" name="slideopen1old" attribute="width" to="204"
            duration="500" relative="false"/>
        <animator start="false" name="slideopen1" attribute="x" to="602" from="830"
- duration="500"/>
+ duration="500" onstop="LzFocus.setFocus(parent.summary.content.title);"/>
        <animator start="false" name="slideopen2" attribute="opacity" to="1" from="0"
            duration="500" relative="false"/>

@@ -319,7 +319,6 @@
            this.setOpacity(1);
            this.slideopen1.doStart();
            this.slideopen2.doStart();
- LzFocus.setFocus(summary.content.title);
            this.opened = true;

        </method>

Steve O'Sullivan - 05/Oct/07 12:42 PM
I was wrong. This has been verified against the Calendar, and the bad behavior does NOT occur.

Steve O'Sullivan - 05/Oct/07 12:43 PM
See above.