Hello,
I am using WebTab with several ContentTabItem. In my case, most of the tabs need to be refreshed after tab index changed, while there is quite a large amount of data to be loaded.
Under this condition, for a better user experience, I want to have the following behavior -- everything, including the tab contents and the tab index, is changed after the data is loaded completely, and at the same time letting the user know that the page is loading instead of doing nothing there.
I've tried the ways suggested in the following post: http://ko.infragistics.com/community/forums/t/71996.aspx . But both of them cannot do exactly what I expect.
1. Process SelectedIndexChanging event, cancel it, use internal method to change object-value of selected tab index and trigger a postback. Coming response will restructure/fix html.
problem: If I cancel the SelectedIndexChanging event, the loading animation will not come out. It will be a bad experience as sometimes the page will load for a couple of seconds and the user don't know if the page is loading or not.
2. Process SelectedIndexChanged event, hide content of new selected tab and show content of old tab. Coming response will restructure/fix html.Note: to get index of old selected tab, processing SelectedIndexChanged is needed.
problem: Users will see a blank tab and than the contents suddenly appear. It will be better if the tab index and the tabitem contents change at the same time.
Is there any suggestion about this problem?
Thanks.
Regards,
KC
Hello KC,
Thank you for posting in our forums!
Have you looked into the WebTab's PostBackOptions properties object? This property contains different options for how the WebTab should handle reloading of tabs. The EnableReloadingOnTabClick or EnableReloadingUnselectedTab options sound like they will work in your scenario.
Please let me know if these properties help you achieve your requirements or if you need further assistance with this.
Hello Micheal,
Thank you for your reply. I have tried to change the properties of PostBackOptions. As far as I can go, I can make the WebTab behave like this:
I am in the 1st tab
-> click the 2nd tab
-> it shows that I am in the 2nd tab, but the content remain the 1st one, with a loading animation
-> at last, after the target tab loaded completely, the tab refresh
One more problem is that it shows that I am in the 2nd tab while it is displaying the content of the 1st tab. I want to delay this change in selected tab to avoid confusion to the users. But it seems that the PostBackOptions doesn't help this time. Any suggestion for that?
Hello Martin,
I have modified the functions from your sample and it fits my case. Thank you for your help.
I'm attaching a sample for your reference which follows the instruction explained in forum thread: http://ko.infragistics.com/community/forums/t/71996.aspx. The improvement in my sample is that it shows the loading indicator when a user is switching between tabs.
Let me known if this works for you.
Best regards,Martin PavlovInfragistics, Inc.
Our developers will be looking into this tomorrow and should have more information for you.
I am still discussing this with our developers for a better understanding of how to resolve this. I will keep you updated when I hear back from them.
Thank you for the update.
I am discussing this further with our developers to come to a better solution to this issue.
We will have another update for you by Monday.