Hi, I am having a problem with the dialog causing the page postbacks when I set the contenturl address in javascript on the client. Other Ajax behavior works OK (such as sorting, etc...), but as soon the call to dlg.get_contentPane().set_contentUrl("ViewonlyRecord.aspx?r=" + v); is executed the browser does a full page postback. I verified this by commenting only this line and no more postbacks.
The wanted behavior is to display a record view page when the record's row is double-clicked in the grid, how can I accomplish this without the full postback?
The below code is abbreviated but the basic structure is identical.
Thanks
Ali M.
function grdItems_DblClick() {
var grid = igtbl_getGridById("ctl00_ContentPlaceHolder1_grdResults"); var row = grid.getActiveRow(); if (row) { var dlg = $find("ctl00_ContentPlaceHolder1_dlgView"); try { if (dlg) { var v = row.getCell(1).getValue(); dlg.get_contentPane().set_contentUrl("ViewonlyRecord.aspx?r=" + v); dlg.show(); } } catch (e) { alert("Error in viewCurrent" + e); } return false; };
<igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" Width="100%">
<igtbl:UltraWebGrid ID="grdResults" runat="server" EnableAppStyling="True">
<DisplayLayout .... ClientSideEvents-DblClickHandler="grdItems_DblClick" />
</igtbl:UltraWebGrid>
<ig:WebDialogWindow ID="dlgView" runat="server" ..... >
<ContentPane ContentUrl="about:blank" .../>
</ig:WebDialogWindow>
</igmisc:WebAsyncRefreshPanel>
Hi Ali,
The CallBackManager (used by WebAsyncRefreshPanel and UltraWebTab) is not compatible with AJAX controls. They can not be nested in each other, but they may work within same page only side by side.
You should move dialog out of WARP or use UpdatePanel.
Thanks Viktor for the quick reply...
I was not aware of the incompatibility, so I followed your suggestion but still a postback is occurring. Here is my updated code... Any ideas? Thank you in advance..
function viewCurrent() { var grid = igtbl_getGridById("ctl00_ContentPlaceHolder1_grdResults"); var row = grid.getActiveRow(); if (row) { var dlg = $find("ctl00_ContentPlaceHolder1_dlgView"); dlg.get_contentPane().set_contentUrl("ViewonlyRecord.aspx?r=" + row.getCell(1).getValue()); dlg.show(); } };
<asp:UpdatePanel ID="UpdatePanel1" runat="server" EnableViewState="true" RenderMode="Inline" UpdateMode="Conditional"> <ContentTemplate> <igtbl:UltraWebGrid ID="grdResults" runat="server" Width="950px" EnableViewState="true"> <Bands>...
</Bands> <DisplayLayout AllowColSizingDefault="Free" AllowSortingDefault="Yes" ClientSideEvents-DblClickHandler="viewCurrent" ..... >...
</DisplayLayout> </igtbl:UltraWebGrid>
<ig:WebDialogWindow ID="dlgView" runat="server" Height="750px" Width="950px" WindowState="Hidden" Modal="true" InitialLocation="Centered" Resizer-Enabled="false" CssClass="confirmdialog" ModalBackgroundCssClass="modalbackground"> <Header Visible="true" CaptionText="View Record"></Header> <AutoPostBackFlags Moved="Async" Resized="Async" WindowStateChange="Async" /> <ContentPane ContentUrl="about:blank" FrameScrolling="False" ScrollBars="Hidden" FrameBorder="False"> </ContentPane> </ig:WebDialogWindow>
</ContentTemplate> </asp:UpdatePanel>