PDA

View Full Version : [CLOSED] How to render client's ID of the same way as 1.x?



softmachine2011
Jun 06, 2012, 10:00 AM
Hi,

In the following 1.x example:



<ext:Window ID="Window1" runat="server" Closable="false" Resizable="false" Height="130"
Icon="Lock" Title="My Frog's Leg Starling"
Draggable="true" Width="340" Modal="false" Border="false" Padding="0"
Margin="0">
<Items>
<ext:Panel runat="server" ID="Panel1">
<Items>
<ext:TextField runat="server" ID="TextField1" />
</Items>
</ext:Panel>
</Items>
</ext:Window>


If IDMode's ResourceManager set to Explicit, Ext.NET 1.x renders any component as single component (without inherit).

In the abobe case:


Window1
Panel1
TextField1


In Ext.NET 2.x, renders (even ResourceManager IDMode="Explicit"):


Window1
Window1_Panel1
Window1_Panel1_TextField1


There is a combination of property values ​​in the ResourceManager to do that could act the same way?

Greetings,

Daniil
Jun 06, 2012, 10:25 AM
Hi,

Please use

IDMode="Static"
instead of Explicit.

Daniil
Jun 06, 2012, 11:09 AM
Generally, I am unable to reproduce the issue you have described.

To get the same as it is in Ext.NET v1, you only need to set up

Namespace=""
for the ResourceManager.

Changelog item #90.
http://examples2.ext.net/#/Getting_Started/Release_Documents/CHANGELOG/

Example

<%@ 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>Ext.NET v2 Example</title>
</head>
<body>
<ext:ResourceManager runat="server" Namespace="" />

<ext:Window ID="Window1" runat="server">
<Items>
<ext:Panel ID="Panel1" runat="server">
<Items>
<ext:TextField ID="TextField1" runat="server" />
</Items>
</ext:Panel>
</Items>
</ext:Window>

<ext:Button runat="server" Text="Get client ids">
<Listeners>
<Click Handler="alert('#{Window1}' + ' ' + '#{Panel1}' + ' ' + '#{TextField1}');" />
</Listeners>
</ext:Button>
</body>
</html>

softmachine2011
Jun 06, 2012, 11:29 AM
Hi Daniil,

To work exactly like Ext.NET1.x, it is necessary to define IDMode Static and Namespace to string.Empty?

Check the alert function: it seems to work for it because is written the control's id as a text.

Thanks,

Daniil
Jun 06, 2012, 11:47 AM
To work exactly like Ext.NET1.x, it is necessary to define IDMode Static and Namespace to string.Empty?


No, just

Namespace=""



Check the alert function: it seems to work for it because is written the control's id as a text.


It has been done in demonstration purpose. #{controlServerId} returns the client id of that server control.

You can access the controls directly by Window1, Panel1 and TextField1 reference in my example.