PDA

View Full Version : [FIXED] [V0.7] ActiveTabIndex always 0



Jurke
Dec 02, 2008, 10:45 AM
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

Vladimir
Dec 02, 2008, 11:58 AM
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



[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>

geoffrey.mcgill
Dec 02, 2008, 12:26 PM
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. 

geoffrey.mcgill
Dec 02, 2008, 3:29 PM
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


<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.

Jurke
Dec 03, 2008, 5:54 AM
thanks!
its works great now!