PDA

View Full Version : [CLOSED] DirectMethods: Understanding.



supera
Mar 13, 2012, 1:18 PM
Hi!

Well... Im still problem with updating gridPanels in another aspx page.
Actually, I need a standard process to update anything on my system.
My difficulty is I have several aspx pages opened.

1 - I have a main page with tabPanels... within each tabPanel I will opened a aspx page with gridPanel.
2 - When the user double-clicked in gridPanel on aspx page contained into tabPanel, I call a directMethod in Main page that will create a window (the creation is in codebehind).
3 - This window maybe contain another gridPanel or a trigger field, for example. And this gridPanel (or trigger field) maybe creating a new window (always calling the directMethod in Main Page).
4 - Always I click in Ok button of any window, I wish update something. This 'something' depends of context. And this 'something' may is contained in any aspx page loaded (Remenber that windows are created in Main Page, always).

Therefore, the control that I wish update, maybe dont is contained in parent or in body of parent. i.e., the path to this control is not static.

I think that my problem can be solved with directMethods.
If directMethods can be access in any place, maybe I can 'registry' this directMethod to be triggered when the Ok button of any window is clicked.
For this, I need that directMethods are visibles for all pages.
How I access a directMethod in a child page (any page) from anywhere? I wish trigger this directMethod (of child page of main page) in a window, created in a MainPage.

Thanks for any help!

Daniil
Mar 13, 2012, 4:59 PM
Hi,


How I access a directMethod in a child page (any page) from anywhere? I wish trigger this directMethod (of child page of main page) in a window, created in a MainPage.

If I correctly understand it should look like this (client side):

ContainerWithChildPageCliendId.getBody().Ext.net.D irectMethods.SomeDirectMethod();

Also we would suggest to move out this logic to WebService (-s) or Handler (-s). You won't get an access to page controls at all, but get more flexibility.
http://examples2.ext.net/#/Events/DirectMethods/WebService/

So, you can access a "method" using its URL.

And you will need to return a respective JavaScript from WebService or Handler. Or just some data to handle with a Success handler.

supera
Mar 13, 2012, 5:20 PM
Ok!

I will try this;

Thanks a lot, Daniil.