[FIXED] [V0.7] ActiveTabIndex always 0
Hi
I noticed that the ActiveTabIndex is always 0. Im calling a AjaxMethod that checks the TabIndex of a tabpanel in a viewport. And all of a sudden its 0 all the time. I dont have the time to create a example of this now. If you cant reproduce it ill take the time to do it.
/Mikael
RE: [FIXED] [V0.7] ActiveTabIndex always 0
Hi Mikael,
Please update from the SVN. I have fixed some bugs in AjaxMethods
Plus please note that by default for AjaxMethod type of request is Load (which means that form will not submit). If you need form submit than need to add type=Submit in the config object
Code:
[AjaxMethod]
public int GetActiveTab()
{
return TabPanel1.ActiveTabIndex;
}
<ext:Button ID="Button1" runat="server" Text="Get Active Tab">
<Listeners>
<Click Handler="Coolite.AjaxMethods.GetActiveTab({type: 'submit', success: function(result){ Ext.Msg.alert('Active Tab', 'Index: '+result);}});" />
</Listeners>
</ext:Button>
RE: [FIXED] [V0.7] ActiveTabIndex always 0
Hi Mikael,
There is still a defect in the AjaxMethod. The default functionality of the AjaxMethod should be to submit the <form>, which would enable full access to all the ViewState values serverside. Somehow that functionality has changed. We're correcting the problem and will be committing an update soon.*
You will not have to pass the type:"submit" property to the AjaxMethod config object.*
RE: [FIXED] [V0.7] ActiveTabIndex always 0
Hi Mikael,
The default value for the AjaxMethod 'type' property has been changed to 'submit'. Now the ViewState for the controls will be updated during the AjaxMethod request.
Example
Code:
<script runat="server">
[AjaxMethod]
public void Update()
{
this.Label1.Text = "ActiveTab: " + this.TabPanel1.ActiveTabIndex.ToString();
this.TabPanel1.ActiveTabIndex = 2;
}
</script>
<ext:TabPanel ID="TabPanel1" runat="server" ActiveTabIndex="0" Height="300">
<Tabs>
<ext:Tab ID="Tab1" runat="server" Title="Tab 1" Html="Tab 1" />
<ext:Tab ID="Tab2" runat="server" Title="Tab 2" Html="Tab 2" />
<ext:Tab ID="Tab3" runat="server" Title="Tab 3" Html="Tab 3" />
</Tabs>
<Buttons>
<ext:Button ID="Button2" runat="server" Text="Submit (AjaxMethod)">
<Listeners>
<Click Handler="Coolite.AjaxMethods.Update();" />
</Listeners>
</ext:Button>
</Buttons>
</ext:TabPanel>
<ext:Label ID="Label1" runat="server" />
The new code has been committed to SVN and will be avilable with the public release of v0.7.
Hope this helps.
RE: [FIXED] [V0.7] ActiveTabIndex always 0
thanks!
its works great now!