Welcome Guest Search | Active Topics | Sign In | Register

Dialog Control position on large vertical page Options
Darren
Posted: Monday, June 22, 2009 8:55:16 AM
Rank: Newbie
Groups: Member

Joined: 5/13/2009
Posts: 4
Hi

I have used your Dialog control successfully on an ongoing project but have recently run into a strange problem I'm hoping you can assist with.

I am using VB.Net. The dialog is created in the aspx file and made visible from the codebehind file.

I have until now not explicitly set the AnchorElementID, XOffset, YOffset and ShowDirection properties and opted for the default location. This was fine until I have added new functionality that dynamically adds new controls based on a dropdown value. When the new controls are rendered on the page, the vertical size of the page increases significantly. The control that triggers the dialog to appear is near the bottom of the page.

Now when the dialog is triggered and made visible, the screen scrolls to the top, and then scrolls slightly down so that only a small part of the dialog shows. To show the full dialog, the user would have to scroll the page up to the top manually.

To try to overcome this I tried calling the following Javascript from the ClientSideOnInitDialog property.
Code: JavaScript
function DialogScroll() { window.scroll(0, 0);alert('test');}


As you can see I dropped in a test alert and this definitely fires successfully. However the window scrolls to the top and back down again still cutting off the top of the dialog.

I also then tried experimenting with the AnchorElementID, XOffset, YOffset and ShowDirection properties. What I seemed to discover is that within the first 'screenful' of the page, these values seem to make a diffence but if the values entered fall beyond the height of one screen, they are ignored and it defaults to the edge of the first 'screenful'

What I am hoping I can do when the dialog is made visible is either:

1) Scroll to the top of the page and then show the dialog centered on the screen. When the dialog is dismissed I would then set focus on the original form control and set the window scroll position separately

or

2) Have the dialog anchored to the control that effectively triggered it, regardless of the window height.

Code example is below:

Aspx page

Code: HTML/ASPX
<eo:Dialog ID="NoRecords" runat="server" BorderStyle="Solid" BorderWidth="1px" BackShadeColor="LightGray"
    BackShadeOpacity="50" BorderColor="#728EB8" ControlSkinID="None" ShadowColor="LightGray"
    ShadowDepth="4" HeaderHtml="Savings Account Application Message" Height="120px"
    Width="268px" BackColor="White">
    <HeaderStyleActive CssText="padding-right: 10px; padding-left: 10px; font-size: 12px; font-weight: bold; background-image: url(00070202); padding-bottom: 2px; padding-top: 2px; font-family: arial" />
    <ContentStyleActive CssText="padding-right: 10px; padding-left: 10px; font-size: 11px; padding-bottom: 10px; padding-top: 10px; font-family: verdana; background-color: #f8fafd" />
    <FooterStyleActive CssText="padding-right: 10px; padding-left: 10px; font-size: 11px; padding-bottom: 10px; padding-top: 4px; font-family: verdana; background-color: #f8fafd" />
    <ContentTemplate>
        <p>
            No records have been found for the entered Sortcode and Account Number.</p>
        <p>
            Please check for errors and try entering the Sortcode and Account Number again.</p>
        <p>
            Alternatively you may enter your bank details manually. Please ensure you enter
            your Sortcode and Account Number exactly as they appear on your bank card or chequebook.</p>
    </ContentTemplate>
    <FooterTemplate>
        <asp:Button ID="NoRecordsOkButton" runat="server" Text="OK" CausesValidation="false" />
    </FooterTemplate>


Code behind page:

Code: Visual Basic.NET
If dsBankValidate.Tables.Count = 0 Then
                    NoRecords.InitialState = EO.Web.DialogState.Visible

......

    Protected Sub NoRecordsOkButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles NoRecordsOkButton.Click

        'Close Dialog and return focus to Sortcode field
        NoRecords.InitialState = EO.Web.DialogState.Hidden
        SetFocusOnLoad(Sortcode_TextBox)

    End Sub


Sorry for the long post....hopefully I've described the problem sufficiently.

Many thanks in advance.

Darren

eo_support
Posted: Monday, June 22, 2009 9:39:56 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We are not able to reproduce the problem. Please check the following:

1. Whether you have ASP.NET maintainScrollPositionOnPostBack set to true. That will automatically scroll the page when the page is reloaded after post back;

2. Whether you are running the latest version. The latest version will automatically re-center the dialog after the window scrolls;

I am not sure whether the VB code you posted (NoRecordsOkButton_Click) has anything to do with the problem. My understanding is that the problem occurs when the dialog is displayed, where as the code you posted is invoked when you wish to close the dialog.

If the problem continue, a full test page that can reproduce the problem would very helpful. Once we can see the problem, we should be able to find out the root cause.

Thanks!
Darren
Posted: Monday, June 22, 2009 10:45:25 AM
Rank: Newbie
Groups: Member

Joined: 5/13/2009
Posts: 4
Hi

Thanks for the quick response.

I've not specifically set the MaintainScrollPositionOnPostback anywhere so I dont think it is that. I will experiment with that and see how I go. The dialog is in a Master/Page/User Control hierarchy. I'll need to try setting this property at different points to see if it makes any difference.

I'll also upgrade my version to the latest one and see if that helps. The current Dll I'm using is 6.0.63.2

I'll post again and let you know the outcome. Thanks again

Darren


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.