PDA

View Full Version : [CLOSED] itemdblclick event redirect request failure



redi
Sep 05, 2014, 3:46 AM
I have a grid with row expander, the row expander has before expand direct events, calling a function on code behind.

The expanded grid also has itemdblclick and itemclick direct events. itemdblclick calls redirect function from code behind.

When I double-click on the row to activate the itemdblclick event, there's an error communication failure pop up, but the pop up will close immediately and redirect the page (as what the event should be doing).

So it pop up error, but there's no actual error happens. Is there something I am doing wrong? Please help me with this. Thanks.

Here's my aspx code




<ext:FormPanel
ID="Panel1"
runat="server"
Frame="true"
BodyPadding="10"
Anchor="100% 100%">
<FieldDefaults LabelWidth="120"/>
<TopBar>
<ext:Toolbar ID="ToolbarButton" runat="server" ClassicButtonStyle="true">
<Items>
<ext:Button ID="btnOpen" name="btnOpen" runat="server" Text="Open" Icon="Magnifier" Hidden="True">
</ext:Button>
<ext:ToolbarSeparator Hidden="True"/>
<ext:TextField ID="TextSearch" name ="TextSearch" runat="server" FieldLabel="Search" LabelWidth="50" Width="350">
</ext:TextField>
<ext:Button ID="search" name="search" runat="server" Icon="Magnifier" OnClientClick="SearchButton_Click">
</ext:Button>
<ext:ToolbarSeparator/>
<ext:ToolbarFill ID="ToolbarFill2" runat="server" />
<ext:Label runat="server" ID="DocNode" Name="DocNode" Width="300" cls="labelcolor"/>
<ext:Button ID="btnRaised" name="btnRaised" runat="server" Text="Raised Proposal" Icon="Accept">
<DirectEvents>
<Click OnEvent="btnRaised_Click">
<EventMask ShowMask="true" Msg="Please wait..." MinDelay="50"/>
</Click>
</DirectEvents>
</ext:Button>

</Items>
</ext:Toolbar>
</TopBar>

<Items>
<ext:TextField runat="server" ID="HidFilename" Name="HidFilename" Hidden="True"/>
<ext:TextField runat="server" ID="HidrIdx" Name="HidrIdx" Hidden="True"/>
<ext:TextField runat="server" ID="HidIdx" Name="HidIdx" Hidden="True"/>
<ext:Label runat="server" ID="lbMsg" Name="lbMsg" cls="labelcolor" />
<ext:GridPanel ID="GridPanel1" runat="server" fittoframe="true" AutoScroll="True" anchor="100% 100%" DisableSelection="true" Height="350">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model runat="server" ID="Model1">
<Fields>
<ext:ModelField Name="Node" Type="String" />
<ext:ModelField Name="Description" Type="String" />
<ext:ModelField Name="Level" Type="String" />
<ext:ModelField Name="Upline" Type="String" />
<ext:ModelField Name="FileName" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ID="Column1" runat="server" Text="Node" Width="50" DataIndex="Node" Hidden="True"/>
<ext:Column ID="Column2" runat="server" Text="Description" DataIndex="Description" width="200" flex="1" >
</ext:Column>
<ext:Column ID="Column3" runat="server" Text="Level" DataIndex="Level" Width="50" Hidden="True">
</ext:Column>
<ext:Column ID="Column4" runat="server" Text="Upline" DataIndex="Upline" Width="50" Hidden="True">
</ext:Column>
<ext:Column ID="Column5" runat="server" Text="Doc No" DataIndex="FileName" >
</ext:Column>
</Columns>
</ColumnModel>
<DirectEvents>
<ItemDblClick OnEvent="CellDblClickHandler" isUpload="True">
<ExtraParams>
<ext:Parameter Name="GUIDName" value="record.data.GUIDName" Mode="Raw" />
<ext:Parameter Name="DocName" value="record.data.DocName" Mode="Raw" />
<ext:Parameter Name="FileName" value="record.data.FileName" Mode="Raw" />
<ext:Parameter Name="Ext" value="record.data.Ext" Mode="Raw" />
</ExtraParams>
</ItemDblClick>
<ItemClick OnEvent="CellClickHandler" >
<ExtraParams>
<ext:Parameter Name="FileName" value="record.data.FileName" Mode="Raw" />
</ExtraParams>
</ItemClick>
</DirectEvents>
<Plugins>
<ext:RowExpander ID="RowExpander1" runat="server" SwallowBodyEvents="false" Collapsible="true"
AnimCollapse="false" Icon="Table" Width="600" AutoScroll="True" Border="True"
Header="false" TrackMouseOver="true" Layout="FitLayout" StripeRows="true" >
<DirectEvents>
<BeforeExpand OnEvent="BeforeExp">
<EventMask ShowMask="true" MinDelay="3"/>
<ExtraParams>
<%--<ext:Parameter Name="record" value="Ext.encode(#{GridPanel1}.getRowsValues({selectedOn ly:true}))" Mode="Raw" Encode="true" />--%>
<ext:Parameter Name="Node" Value="record.data.Node" Mode="Raw" />
<ext:Parameter Name="Level" Value="record.data.Level" Mode="Raw" />
<ext:Parameter Name="Upline" Value="record.data.Upline" Mode="Raw" />
</ExtraParams>
</BeforeExpand>
</DirectEvents>
<Component>
<ext:GridPanel ID="GridPanel2" runat="server" fittoframe="true" AutoScroll="True" DisableSelection="true" MaxHeight="500" MinHeight="250">
<Store>
<ext:Store ID="Store2" runat="server">
<Model>
<ext:Model runat="server" ID="Model2">
<Fields>
<ext:ModelField Name="Node2" Type="String" />
<ext:ModelField Name="Description2" Type="String" />
<ext:ModelField Name="Level2" Type="String" />
<ext:ModelField Name="Upline2" Type="String" />
<ext:ModelField Name="FileName2" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel2" runat="server">
<Columns>
<ext:Column ID="Column21" runat="server" Text="Node" Width="50" DataIndex="Node2" Hidden="True"/>
<ext:Column ID="Column22" runat="server" Text="Description" DataIndex="Description2" width="200" flex="1" >
</ext:Column>
<ext:Column ID="Column23" runat="server" Text="Level" DataIndex="Level2" Width="50" Hidden="True">
</ext:Column>
<ext:Column ID="Column24" runat="server" Text="Upline" DataIndex="Upline2" Width="50" Hidden="True">
</ext:Column>
<ext:Column ID="Column25" runat="server" Text="Doc No" DataIndex="FileName2" >
</ext:Column>
</Columns>
</ColumnModel>
<DirectEvents>
<ItemDblClick OnEvent="CellDblClickHandler" isUpload="True">
<ExtraParams>
<ext:Parameter Name="DocName" value="record.data.DocName2" Mode="Raw" />
<ext:Parameter Name="FileName" value="record.data.FileName2" Mode="Raw" />
<ext:Parameter Name="Ext" value="record.data.Ext2" Mode="Raw" />
</ExtraParams>
</ItemDblClick>
<ItemClick OnEvent="CellClickHandler" >
<ExtraParams>
<ext:Parameter Name="FileName" value="record.data.FileName2" Mode="Raw" />
<ext:Parameter Name="Idx" value="record.data.Idx2" Mode="Raw" />
</ExtraParams>
</ItemClick>
</DirectEvents>
</ext:GridPanel>
</Component>
</ext:RowExpander>
</Plugins>
</ext:GridPanel>
</Items>
</ext:FormPanel>

Daniil
Sep 05, 2014, 8:37 AM
Hi @redi,

Please demonstrate how you do redirection. In other words, please show the CellDblClickHandler server method.

redi
Sep 06, 2014, 1:47 AM
This is how I do it,




Public Sub CellDblClickHandler(ByVal sender As Object, ByVal e As DirectEventArgs)
If X.IsAjaxRequest Then

Dim TextDocNo As String = e.ExtraParams("filename")

Dim iUserID As String = Me.Session("UserID")
TextDocNo = TextDocNo.Replace("&", ";amp")

Dim url As String
url = "frmISO_DocFileList.aspx?FileName=" & TextDocNo & "&UserID=" & iUserID

ExtNet.Redirect(url)

Exit Sub

End If
End Sub

Daniil
Sep 06, 2014, 8:56 AM
Hmm, it should be OK. I mean that I don't quite understand why you see a request failure.

Please provide a standalone, runnable test case to reproduce the problem.