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

Key: LPP-4499
Type: Bug Bug
Status: Open Open
Priority: P1 P1
Assignee: P T Withington
Reporter: Josh Crowley
Votes: 0
Watchers: 0
Operations

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

Calling LzFocus.setFocus() on an object outside the visible canvas will shift the canvas to that object, in DHTML

Created: 14/Aug/07 09:59 PM   Updated: 24/Jan/08 09:17 AM
Component/s: Laszlo Foundation Classes (LFC)
Affects Version/s: Legals
Fix Version/s: DingDong (4.2)

Time Tracking:
Not Specified

Environment: OS X, FF2.0 (Also seen in IE)

Severity: Minor
Runtime: N/A
Fix in hand: False


 Description  « Hide
Discovered in LPP-4175:

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"/>
        <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...

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Amy Muntz - 27/Sep/07 09:50 AM
Making this a P1 because there is a workaround. If it continues to be a problem, bring it to attention on laszlo-dev and we'll consider escalating to p0 (a must fix for 4.1).