Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Height problem on modal Window when loading an external HTML

    Hi all,

    I'm facing a problem when creating a modal window and loading an external HTML. Note: This external resource is not an SmartClient based window.

    This issue is reproducible in the SC's demo page.

    I've modified the Window/modality example (http://www.smartclient.com/#modality)

    Code:
    isc.IButton.create({
        ID: "touchButton",
        width: 120,
        title: "Touch This"
    });
    
    isc.Label.create({
        left: 150,
        height: 20,
        contents: "<a href='http://www.google.com' target='_blank'>Open Google</a>"
    });
    
    isc.IButton.create({
        title: "Show Window",
        top: 35,
        left: 75,
        click : function () {
            touchButton.setTitle("Can't Touch This");
            modalWindow.show();
        }
    });
    
    isc.Window.create({
        ID: "modalWindow",
        title: "Modal Window",
        autoSize:true,
        autoCenter: true,
        isModal: true,
        showModalMask: true,
        width: "600",
        height: "400",
        autoDraw: false,
        closeClick : function () { touchButton.setTitle('Touch This'); this.Super("closeClick", arguments)},
        src: "http://www.google.com",
        canDragResize: true
    });
    As you can see in the attachment (modal-window1.jpg) the height is set to about 40px, instead of the full window. If you resize the window (modal-window2.jpg), it gets fixed and gets the 100% of the window.

    This issue is reproducible in the following configurations:
    - Windows: IE8 / Firefox 3.6 / Chrome
    - Linux: Firefox 3.6 / Chromium

    Any ideas how can I solve this issue?


    Best Regards,

    Iván
    Attached Files
    Last edited by iperdomo; 11 Aug 2010, 00:20.

    #2
    Hi,
    The problem is the autoSize property. If is set to true, it renders like the attached image.
    Remove the property from the Window and you'll get the full height.

    smartclientSDK/source/client/widgets/Window.js
    Code:
    // ... more code
    // create the body canvas
        var bodyProps = ("body", {
                contents : contents || "&nbsp;",
    
                // XXX watch tab can't handle showing non-generated children of generated components.
                // We should fix that.  For now, just flag the body as non-generated
                _generated: false,
                defaultHeight : this.autoSize ? 50 : 100,
    // more code ...
    Cheers,

    Iván

    Comment

    Working...
    X