[CLOSED] [1.0] ExtraParams with DirectEvent when IsUpload="true"
Hello,
Is it possible to pass through ExtraParams when carrying out a DirectEvent with IsUpload set to true?
The code I am trying to use is:
Code:
<ext:Button ID="btnDoExport" runat="server" Text="Export">
<DirectEvents>
<Click ViewStateMode="Enabled" OnEvent="btnDoExport_Click" IsUpload="true">
<ExtraParams>
<ext:Parameter Mode="Raw" Name="ExportType" Value="#{ExportType}.getValue()" />
<ext:Parameter Mode="Raw" Name="ExportFormat" Value="#{ExportFormat}.getValue()" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
Thanks,
RE: [CLOSED] [1.0] ExtraParams with DirectEvent when IsUpload="true"
Hi,
Yes, it is possible. Do you have any problems?
Here is my test case
Code:
<%@ Page Language="C#" %>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script runat="server">
protected void btnDoExport_Click(object sender, DirectEventArgs e)
{
var s1 = e.ExtraParams["ExportType"];
var s2 = e.ExtraParams["ExportFormat"];
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager runat="server"></ext:ResourceManager>
<ext:FileUploadField runat="server" Width="200" />
<ext:Hidden ID="ExportType" runat="server" Text="ExportType" />
<ext:Hidden ID="ExportFormat" runat="server" Text="ExportFormat" />
<ext:Button ID="btnDoExport" runat="server" Text="Export">
<DirectEvents>
<Click ViewStateMode="Enabled" OnEvent="btnDoExport_Click" IsUpload="true">
<ExtraParams>
<ext:Parameter Mode="Raw" Name="ExportType" Value="#{ExportType}.getValue()" />
<ext:Parameter Mode="Raw" Name="ExportFormat" Value="#{ExportFormat}.getValue()" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
</form>
</body>
</html>
RE: [CLOSED] [1.0] ExtraParams with DirectEvent when IsUpload="true"
Yes for some reason the values are not passing through unless I remove the IsUpload="true" attribute, however, removing this means that my file download doesn't work.
I have tried examining the request data using Fiddler and I can't see the Ext parameters being passed through to the server in any way.
I will give your test page a go with my build of Ext DLLs and see if it works (or not).
RE: [CLOSED] [1.0] ExtraParams with DirectEvent when IsUpload="true"
Okay I tried your sample and it worked fine.
I then copied in some of my code form my own project and it still worked fine. I was running Fiddler as a proxy capturing web traffic, I didn't know if that might cause some problems so I have turned that off and now the ExtraParams seem to pass through intermittently. For example, I have IE open on the page and it submitted fine, I then submitted again and the params didn't pass through. I also have firefox on the same page and it won't work (params are null).
Looking in FireBug I can see the params being passed:
Code:
<td role="presentation" class="netInfoParamName ">{</td><td role="list" aria-label="submitDirectEventConfig" class="netInfoParamValue "><code role="listitem" class="focusRow
subFocusRow ">"config":{"viewStateMode":"enabled","extraParams":{"ExportType":"Full","ExportFormat":"PDF"}}}
</code></td>
<td role="presentation" class="netInfoParamName ">
But they are null on the server. This page has an ASP script manager and also has some processing in Page_Init to parse and use the view state but I can't see that this should interfere with anything?</td><td role="list" aria-label="submitDirectEventConfig" class="netInfoParamValue ">
</td>
RE: [CLOSED] [1.0] ExtraParams with DirectEvent when IsUpload="true"
Ooops, looks like the formatting broke my last post otherwise I would put this as an edit.
Checking Request["textBoxContactName"] returns the value of the textbox on the form (ASP) control. Checking the value of Request["ExportFormat_Value"] and Request["submitDirectEventConfig"] returns null even though according to FireBug these should have values.
RE: [CLOSED] [1.0] ExtraParams with DirectEvent when IsUpload="true"
Hi,
Do you able to create test project which reproduces such behaviour?
EDIT: Marking as [CLOSED] as no further information was provided.