Dec 19, 2012, 8:34 AM
[CLOSED] Looking for way to use DirectMethods inside UserControl
Hi,
I have found how to call a DirectMethod inside UserControl but only if this DirectMethod is on page contains this control.
so question is How to call DirectMethod which is implemented inside UserControl from for example ext:Button (button is also inside UserControl)?
Hope I've made it clear enough if not please ask:)
Edit
What is requirement to pass parameters into DirectMethod?
I've tryed to pass
call of this DirectMethod:
solution:
Thanks,
ViDom
I have found how to call a DirectMethod inside UserControl but only if this DirectMethod is on page contains this control.
so question is How to call DirectMethod which is implemented inside UserControl from for example ext:Button (button is also inside UserControl)?
Hope I've made it clear enough if not please ask:)
Edit
What is requirement to pass parameters into DirectMethod?
I've tryed to pass
this.activeItem
inside tabPanel listeners tabchange event but got error:call of this DirectMethod:
<TabChange Handler="if(tab.items.getCount()>0) { return false; } else { #{DirectMethods}.AddTab(this.activeItem); }"></TabChange>
System.ArgumentException: DirectMethod: 'AddTab', The parameter 'activeItem' is undefined at Ext.Net.DirectMethod.Invoke(Object target, HttpContext context, ParameterCollection args) at Ext.Net.DirectMethod.Invoke(Object target, ParameterCollection args) at Ext.Net.ResourceManager.RaisePostBackEvent(String eventArgument)
my code behind looks like: [DirectMethod(Timeout = 30000)]
public void AddTab(string activeItem)
{
Ext.Net.Panel panel = tPanel.Items.FirstOrDefault(x => x.ClientID == activeItem) as Ext.Net.Panel;
}
[DirectMethod(Timeout = 30000)]
public void AddTab(int activeItem)
{
Ext.Net.Panel panel = tPanel.Items[activeItem] as Ext.Net.Panel;
}
I've figured it out:solution:
<TabChange Handler="if(tab.items.getCount()>0) { return false; } else { #{DirectMethods}.AddTab(tab.id); }"></TabChange>
This thread can be closed:)Thanks,
ViDom
Last edited by Daniil; Dec 19, 2012 at 11:11 AM.
Reason: [CLOSED]