I need to show/hide a dialog window on page load based on a cookie value. The $find function fails with 'null' is null or not an object.
Anyone done this? It seems like it should be pretty common.
Update after reviewing the forum: WebDialogWindow.initialize won't run when the design-time windowstate is hidden; and if the design time window state is normal, if i try to hide the window in the initialize function, it still flashes visible briefly before hiding - which is not acceptable behavior. Thanks in advance.
Hi,
That is correct, the Initialize event is raised after WebDialogWindow and all its subobjects are fully created. WebDialogWindow does a lot of adjustments on client which require offsetWidth/Height and before the first paint, most of child objects are not ready for public access.
However, instance of hidden dialog should be available within onload event (with some delay; down to 0ms) and some of properties can be modified. As I said, access to particular properties and objects may bring problems, and therefore that is not supported situation.
Below is example:
<body onload="setTimeout('findDialog()',0)"><form id="form1" runat="server"> <ig:WebDialogWindow ID="WebDialogWindow1" runat="server" WindowState="Hidden"></ig:WebDialogWindow>
I'm sorry Viktor but is your best recommendation that I throw up an alert or code a delay while I wait for the control to render? Really? I could create my own div and have access to it at page load but that's not why I spent the money buying your tool suite. I am asking for a better solution than that; could you please review it again?