Skip to content
This repository was archived by the owner on Aug 9, 2024. It is now read-only.
This repository was archived by the owner on Aug 9, 2024. It is now read-only.

Direct Events not passing control scope to client-side environment #1842

Description

@fabriciomurta

Found: 7.1.0
Ext.NET forum thread:

Generated client-side code is not including a required control: this argument to Ext.net.directRequest() calls.

The following code in Ext.NET 5:

<ext:buttonrunat="server"text="Toast 2">
<directEvents>
<clickOnEvent="Button2_Click">
<extraParams>
<ext:Parametername="label"value="function() { return this.text; }"mode="Raw" />
</extraParams>
</click>
</directEvents>
</ext:button>

Results in:

Ext.create("Ext.button.Button",{id: "ctl03",renderTo: "App.ctl03_Container",text: "Toast 2",directEvents: {click: {fn: function(item,e){Ext.net.directRequest({extraParams: {"label": function(){returnthis.text;}},control: this});}}}});

In Ext.NET 7 though, the button definition:

<ext-buttontext="Toast 2">
<directEvents>
<clickactionName="Button2_Click">
<extraParams>
<ext-addkey="label"value="function() { return this.text; }"mode="Raw" />
</extraParams>
</click>
</directEvents>
</ext-button>

Is generating:

Ext.create("Ext.button.Button",{directEvents: {click: {fn: function(item,e){Ext.net.directRequest({action: "click",cleanRequest: true,extraParams: {label: function(){returnthis.text;}}});}}},id: "ctl02",renderTo: "App.ctl02_Container",text: "Toast 2"});

Then, this in the direct event's extraParams scope becomes the javascript Window object, and it is not possible to reliably get data from the related component during pre- and post- direct event client-side tasks.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions