PDA

View Full Version : [CLOSED] Getting the parameter defined in ext:Window Loader



supera
Feb 16, 2012, 7:15 PM
Hi!

I am creating my Form Details as aspx pages.

I'm loading these Form Details in a ext:Window with Loader tag.


<ext:Window ID="wndDetails" runat="server" Icon="ApplicationFormEdit" Resizable="false" Hidden="true" Modal="true" Constrain="true" Width="400" Height="300">
<Loader runat="server" AutoLoad="true" Url="~/default.aspx" Mode="Frame" TriggerEvent="show" ReloadOnEvent="true">
<LoadMask Msg="Carregando..." ShowMask="true" />
<Params>
<ext:Parameter Name="ID" Value="" Mode="Value" />
</Params>
</Loader>
</ext:Window>


My question is:
How do I get the parameter set in Window Loader there in Form Details aspx?

Thanks for any help!

Daniil
Feb 16, 2012, 7:50 PM
Hi,

In code behind, for example, Page_Load, from Request.

Request["ID"]

supera
Feb 17, 2012, 10:23 AM
Hi Daniil...

Thanks for your reply...

I had already tried that...

However, I tried again, but the Request ("ID") or Request.QueryString ("ID") always returns empty.

I declared a window in my mainpage as follow:


<ext:Window ID="wndDetails" runat="server" Icon="ApplicationFormEdit" Resizable="false" Hidden="true" Modal="true" Constrain="true" Width="400" Height="300">
<Loader runat="server" AutoLoad="true" Url="~/default.aspx" Mode="Frame" TriggerEvent="show" ReloadOnEvent="true">
<LoadMask Msg="Carregando..." ShowMask="true" />
<Params>
<ext:Parameter Name="ID" Value="" Mode="Value" />
</Params>
</Loader>
</ext:Window>


And I get the selected record in my GridPanel and set the parameter before window show, as follow:


Protected Sub EditRecord(sender As Object, evt As DirectEventArgs)
Dim recordID As String = evt.ExtraParams("recordID")

If recordID <> "null" Then
wndDetails.Loader.Params("ID") = recordID
wndDetails.Show()
End If

End Sub


recordID has value, I checked.

I'm doing something wrong?

Daniil
Feb 17, 2012, 1:02 PM
This

wndDetails.Loader.Params("ID") = recordID
doesn't affect during DirectEvent.

To force it to be affected you should call the Window's LoadContent method.

In addition, there is a bug in Ext.NET DP1.

After update to Ext.NET v2 beta, the following example will work correct.

The fix is related to many things, therefore I can't provide it right now. Please wait the release.

Example Parent Page

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Show(object sender, DirectEventArgs e)
{
this.Window1.Show();

this.Window1.Loader.Params["test"] = "Hello World!";
this.Window1.LoadContent();
}
</script>

<!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>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" SourceFormatting="false" />
<ext:Window ID="Window1" runat="server" Hidden="true">
<Loader
runat="server"
Mode="Frame"
Url="Test.aspx"
AutoLoad="false">
<LoadMask ShowMask="true" />
</Loader>
</ext:Window>
<ext:Button runat="server" Text="Show" OnDirectClick="Show" />
</form>
</body>
</html>



Example Child Page

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
this.Label1.Text = this.Request.QueryString["test"];
}
</script>

<!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>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Label ID="Label1" runat="server" />
</form>
</body>
</html>

supera
Feb 17, 2012, 1:08 PM
Ok... thanks a lot for your help...

I'll be waiting DP2 version. I have a few bugs in my system that depend on this version.

Daniil
Feb 17, 2012, 2:27 PM
Please feel free to report if you will face any issues with a new release.