in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

webdialog bug on centering the dialog when parent is not maximized

Last post 12-04-2007 2:59 PM by C1_GregL. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-29-2007 3:48 PM

    webdialog bug on centering the dialog when parent is not maximized

    Hi,

       I am not sure if this is a bug or I am doing something wrong. When I call the web dialog from a page and if that is not maximized, then I am not able to see the whole dialog. Even when I maximize the parent window it is still not showing the whole dialog.

    <c1d:C1WebDialog ID="C1WebDialog1" runat="server" Height="600px" Width="800px" Style="position: absolute" BackColor="White" BorderColor="DarkSlateGray" BorderStyle="Solid" BorderWidth="1px" StartPosition="CenterParent" StartX="510" StartY="225"

    ContentUrl="" Text="Report Details" AllowResize=true>

    <CaptionButtons>

    <CloseButton Visible="true" />

    <MaximizeButton Visible="true" />

    <MinimizeButton Visible="false" />

    </CaptionButtons>

    <CaptionStyle BackColor="DarkSlateGray" BorderColor="DarkSlateGray" BorderStyle="Solid" BorderWidth="2px" CssClass="skin2_titlebar" />

    </c1d:C1WebDialog>

    Thanks,

    sridhar.

  • 12-04-2007 2:59 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 431

    Re: webdialog bug on centering the dialog when parent is not maximized

    If your aim is to center the dialog for both maximized and restored-down states I would use StartPosition="CenterPage"

    I haven't found a good use yet for "CenterParent" for C1WebDialog.  Centerparent centers the dialog in relation to the content on the page it seems.  So if the content of the parent is small in vertical display height, the dialog could get cut off if it's too big.

    But with CenterPage if the window is smaller than the dialog, then it gets centered off screen and becomes unusable.  here is code that checks if the dialog is too small it uses the default positioning, otherwise it will center the dialog.

    dialog = $get("C1WebDialog1").control;
    var width = document.getElementById("C1WebDialog1").style.width
    width = width.substring(0, width.length - 2) //remove 'px'
    if(width > document.body.offsetWidth)
    {
    dialog.set_startPosition(0); //default
    }
    else
    {
    dialog.set_startPosition(1); //centerpage
    }
    dialog.show();

     

    Regards,
    Greg L

Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.