Welcome Guest Search | Active Topics | Sign In | Register

Tabstrip SelectedIndex Issue Options
Rabih
Posted: Monday, July 2, 2007 8:44:42 AM
Rank: Member
Groups: Member

Joined: 6/24/2007
Posts: 14
Hello, I am using the TABSTRIP instead of AJAX's TABCONTAINER, the problems i am facing are the following:
1- On the CallbackPanel1_Execute(object sender, EO.Web.CallbackEventArgs e) I am trying to get the SELECTED index of the TAB which is changing randomly everytime i debug my code ANY IDEA WHY?
2- this.TabStrip1.Items[this.TabStrip1.SelectedIndex].Value.ToString() the VALUE is also not changing from the first time, while i am debugging i have found out that the value is refreshing at the next click ANY IDEA WHY please?
here is my code

Code: C#
private void CallbackPanel1_Execute(object sender, EO.Web.CallbackEventArgs e)
    {
        string strTemp = this.TabStrip1.Items[this.TabStrip1.SelectedIndex].Value.ToString();
        int i = this.TabStrip1.SelectedIndex;
        LoadPage(int.Parse(e.Parameter));
    }
eo_support
Posted: Monday, July 2, 2007 4:58:39 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
hi, Rabih

Thank you for posting your question here.
One question is how did you triger your CallbackPanel1? For your instance, why don't you just handle TabStrip1_ItemClick server event?
Rabih
Posted: Tuesday, July 3, 2007 12:09:06 AM
Rank: Member
Groups: Member

Joined: 6/24/2007
Posts: 14
hi,
i have added TavStrip1_itemclick event, but the debugger is not even going there any idea why?
private void InitializeComponent()
{
this.CallbackPanel1.Execute += new EO.Web.CallbackEventHandler(this.CallbackPanel1_Execute);
this.TabStrip1.ItemClick += new EO.Web.NavigationItemEventHandler(TabStrip1_ItemClick);
this.Load += new System.EventHandler(this.Page_Load);

}

public void TabStrip1_ItemClick(object sender, EO.Web.NavigationItemEventArgs e)
{
string strtemp;
strtemp = "tesT";
//throw new Exception("The method or operation is not implemented.");
}

and here is not my ASPX code
<eo:TabStrip runat="server" id="TabStrip1" ControlSkinID="None" ClientSideOnItemClick="SwitchTab">
content here ....
</eo:tabstrip>

Thank You very much
Rabih
Posted: Tuesday, July 3, 2007 12:34:30 AM
Rank: Member
Groups: Member

Joined: 6/24/2007
Posts: 14
hi, got my mistake :) i should have set RaisesServerEvent=true, thanks a lot, your support is always the best
Rabih
Posted: Tuesday, July 3, 2007 12:43:00 AM
Rank: Member
Groups: Member

Joined: 6/24/2007
Posts: 14
hello,
Now I have a new issue, since i have enabled to RaisesServerEvent = true and the page is fully loading? is that true? how to solve this thing?

Thank You a lot
eo_support
Posted: Tuesday, July 3, 2007 6:47:23 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Ok, now I see what you want to do.
Still the same code with RaisesServerEvent = true, just drag the TabStrip1 into your CallbackPanel. And add TabStrip1 as Callback Panel's Trigger. Then see if it works.
When you click TabStrip1, it will fire TabStrip1_ItemClick event as well, but it won't load the whole page.

Thanks.
Rabih
Posted: Tuesday, July 3, 2007 10:45:50 PM
Rank: Member
Groups: Member

Joined: 6/24/2007
Posts: 14
hello, it did not work actually, sorry, the problem is while debugging i have found out that the ItemClick event is never fired up while the Callbackpanel.Execute event is firing up after i have added the TabStrip1 to the callbackpanel here is my code, any mistake in it?

<eo:CallbackPanel runat="server" id="CallbackPanel1" Width="100%" Height="200px" LoadingHTML="This may take few seconds pls hold..."
Triggers="{ControlID:CategoryBrowser;Parameter:},{ControlID:TabStrip1;Parameter:}">
<eo:TabStrip runat="server" id="TabStrip1" ControlSkinID="None" ClientSideOnItemClick="SwitchTab" RaisesServerEvent=true>
<TopGroup>
<Items>
<eo:TabItem Text-Html="Vaults" Value="0"></eo:TabItem>
<eo:TabItem Text-Html="Jewelries" Value="1">
<subgroup>
<items>
<eo:TabItem Text-Html="By Branch" Value="1"></eo:TabItem>
<eo:TabItem Text-Html="By Category" Value="3"></eo:TabItem>
</items>
</subgroup>
</eo:TabItem>
<eo:TabItem Text-Html="Watches By Category (ALL)" Value="2"></eo:TabItem>
<eo:TabItem Text-Html="Watches (Official Brands)" Value="4">
<subgroup>
<items>
<eo:TabItem Text-Html="By Brand, Model &amp; Branch" Value="4"></eo:TabItem>
<eo:TabItem Text-Html="By Brand, Model" Value="6"></eo:TabItem>
</items>
</subgroup>
</eo:TabItem>
<eo:TabItem Text-Html="Watches (Others Brands)" Value="7">
<subgroup>
<items>
<eo:TabItem Text-Html="By Brand, Model &amp; Branch" Value="7"></eo:TabItem>
<eo:TabItem Text-Html="By Brand, Model" Value="8"></eo:TabItem>
</items>
</subgroup>
</eo:TabItem>
<eo:TabItem Text-Html="Object of Arts" Value="5"></eo:TabItem>
<eo:TabItem Text-Html="Special Catalogs"></eo:TabItem>
</Items>
</TopGroup>
<LookItems>
<eo:TabItem Image-BackgroundRepeat="RepeatX" Image-Mode="TextBackground"
Image-SelectedUrl="00010225" Image-Url="00010222" ItemID="_Default"
LeftIcon-SelectedUrl="00010224" LeftIcon-Url="00010221"
NormalStyle-CssText="color: #606060" RightIcon-SelectedUrl="00010226"
RightIcon-Url="00010223"
SelectedStyle-CssText="color: #2f4761; font-weight: bold;">

<subgroup overlapdepth="8" style-csstext="font-family: tahoma; font-size: 8pt; background-image: url(00010220);
background-repeat: repeat-x; cursor: hand;"></subgroup>
</eo:TabItem>

</LookItems>
</eo:TabStrip>
<uc1:CategoryBrowse ID="CategoryBrowser" Runat="server" AutoNavigate="True">
</uc1:CategoryBrowse>
</eo:CallbackPanel>
eo_support
Posted: Wednesday, July 4, 2007 2:05:38 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
hi, Rabih

I tried it in my VS 2005 environment. I removed the:
<uc1:CategoryBrowse ID="CategoryBrowser" Runat="server" AutoNavigate="True">
</uc1:CategoryBrowse>
Is this your own control?
I removed that one, and removed it from Callback Panel Triggers as well.
When I click ItemClick, it did fire server item click event.
In your eo:TabStrip, I don't see your item click event handler. Like this: OnItemClick="TabStrip1_ItemClick"
Can you remove your categorybrowse button and see if it makes any difference?

Thanks.
Rabih
Posted: Wednesday, July 4, 2007 10:35:52 PM
Rank: Member
Groups: Member

Joined: 6/24/2007
Posts: 14
Hello again I have tried what you asked me to do but failed to get the same results as yours, actually i am figuring out few things:
1- If i add the tabstrip under the callback, and i trigger it, it is not even refreshing, it is blinking 2 times without updateing the contents.
2- Subgroups do not show once i add the tabstrip under the callback.
3- ItemClick event is not fired even if i trigger the Tabstrip else it is firing.
Does this help you to figure out my problem? :) please help me
eo_support
Posted: Thursday, July 5, 2007 9:44:35 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
That is weird!
Can you create a simple project to demo this problem and email to us?
I will see if I can find out why it works differently for you.

Thanks.
Rabih
Posted: Wednesday, July 11, 2007 10:03:04 PM
Rank: Member
Groups: Member

Joined: 6/24/2007
Posts: 14
Any news regarding the code that i have sent a while ago? I am afraid i did not receive the reply for any failure reason.
eo_support
Posted: Thursday, July 12, 2007 2:14:43 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Rabih,

We looked into the code that you sent to us and made a few changes:

1. Removed SwitchTab client side function as well as ClientSideOnItemClick property for the TabStrip;
2. Set the TabStrip's RaisesServerEvent to true;
3. Removed the Callback's Execute event handler;

Since the TabStrip is set as a trigger of the CallbackPanel control, clicking the TabStrip would automatically trigger the Callback. You would then handle everything on the server side inside your TabStrip's ItemClick event. Inside that event handler we verified that SelectedIndex always have the correct value.

Note that SelectedIndex only reflects the index of the top level selected items. Child items do not come into play as for SelectedIndex.

Thanks
Rabih
Posted: Saturday, July 14, 2007 12:10:35 AM
Rank: Member
Groups: Member

Joined: 6/24/2007
Posts: 14
hi, :)
I am very happy now, it is working, your support is always great, what about the subgroups? how can i get their selected index?

hugeeee Thanks
Rabih
eo_support
Posted: Saturday, July 14, 2007 7:06:51 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Rabih,

The easiest way to get the selected index on sub group is not from the TabStrip, but from the TabItem inside ItemClick event. Once you are in the event handler, you can use e.TabItem.Index (or e.NavigationItem.Index in older versions) to get the clicked item index, and that is the same as selected index.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.