Hello,
I want to change the CaptionText of Header on WebDialogWindow, from client-side in a function BLOCKED SCRIPT
function GridViewData_Grid_AJAXResponse(sender, eventArgs) {//some code ...//.//.//.
var dialog = $find("WebDialogWindowMensaje");
dialog._header.setCaptionText('Error');
dialog.show();
}
But, I am getting an exception, Error: 'this._elems.7' is null or not an object...
I put a breakpoint and the exception is thrown on the line: dialog._header.setCaptionText('Error'); in the javascript function.
The version of NetAdvantage for ASP.Net is 11.1.20111.1006. In my page.aspx I have the following code:
<ig:WebDialogWindow ID="WebDialogWindowMensaje" runat="server" Height="200px" Width="500px" InitialLocation="Centered" Modal="True" Moveable="False" WindowState="Hidden"> <ContentPane BackColor="White"> <Template> <div style="padding: 20px; position: relative; text-align: justify;"> <div style="float: left; display: block; margin-right: 15px;"> <asp:Image ID="ImageMsg" runat="server" ImageUrl="" Height="50px" /> </div> <asp:Label ID="LblMensaje" runat="server" Text="PRUEBA"></asp:Label> <br /> <br /> <br /> <br /> <div style="float: right; display: block;"> <input id="BttnMsgOk" type="button" onclick="BttnMsgOk_onClick()" value="OK" style="background-color: #8AC4EA; color: #FFFFFF; font-size: small; font-weight: bold; width: 50px;" /> </div> </div> </Template> </ContentPane> <Header CaptionText="SomeText"> </Header> </ig:WebDialogWindow>
Is this error a bug of the WebDialogWindow object? or Am I making some wrong?
Thanks for your help.
Geovanny Domínguez
Hello Geovanny,
You could get the ClientID of the dialog window in your JavaScript function.
var dialog = $find('<%= WebDialogWindowMensaje.ClientID %>');
Please let me know if you have any other questions.
Elizabeth AlbertLocalization Engineer
Hello Elizabeth,
Yes, your advice solves the error, thank you so much! But, I don't get to change the header text of the WebDialogWindow object. My JavaScript function:
var dialog = $find('<%= WebDialogWindowMensaje.ClientID %>'); dialog._header.setCaptionText("Error"); dialog.show();
How I can get this? May you help me, please?
Thanks.
I found this similar forum post that answers the question:
http://ko.infragistics.com/community/forums/t/6551.aspx
The dialog should be shown first. Try to switch the setCaptionText and show() lines. The linked post offers a couple of alternate solutions.
Yeah!. I switched the setCaptionText and show() lines, now it works like I want.
That was all. Until next time!
Geovanny Domínguez.