Hi all,
I'm implementing a WebTab control that is nested within an UpdatePanel, so that when information underlying the data displayed in each tab is updated, a message will be displayed to the user while it is updated, and then they're reloaded.
I've disabled AutoPostBack as that seems to cause more issues than it solves. Bsaically, we want each of the tabs to persist their state if they HAVEN'T been loaded yet. So on the initial page load, we load up tab 1, then clicking tab 2 and 3 should load their contents, and clicking any of the other tabs again won't do anything.
However, after the updatepanel is updated, the selectedindexchanged event does not fire, but we need it to. How can we force the event to fire after the updatepanel has been updated?
I'm sure there's a client side function that's preventing the tabs from being reloaded again, but just not sure what that is exactly.
Just to reiterate even further, basically we want to be able to reset the tabs on the click of another button, but have the loadondemand property still in place. That is, we'd load one tab, and the rest would load when you click on them. Again though, we don't want the tabs to reload UNLESS that button has been clicked. We want them to load on demand, and then stay loaded unless we click the button, if the button is clicked, we want to load them on demand again.
Hope I'm being clear enough!
UPDATE:
It seems what I want to control is controlled in the underlying AJAXContentPane for each ContentTabItem. Basically, once the tab is loaded, I can see that the 'WasInstantiated' member changes from false to true. I'm assuming this is what determines whether or not a tab will be loaded on clicking it. Is there a way to change this? Also, if there is a way to change this, is there a way to make the tab blank while it loads? (like when a tab is loaded for the first time). So if a tab has been loaded, but the button is clicked to reload them again, on clicking each tab again, is it possible to remove the previous data so it doesn't display while the tab loads again?
Also, loading all tabs at once isn't an option, as we need to run lengthy reports for some of the tabs. We also have a webchart in one of the tabs, and therefore it needs rebinding from any proper postbacks, so that also cancels out a few other solutions
Hello Alex,
Now I'm little confused from your three subsequent explanations.
However I understood that you want to load template of selected tab only, which is accomplished using PostBackOptions EnableLoadOnDemand property of the WebTab control:
http://help.infragistics.com/doc/ASPNET/2014.2/CLR4.0/?page=Infragistics4.Web.v14.2~Infragistics.Web.UI.LayoutControls.TabPostBackOptions~EnableLoadOnDemand.html
Also please note that SelectedIndexChanged event fires every time you change the selected tab, not only the first time.
And in case that you set load on demand of the WebTab, then only the currently active tab's content will be reloaded on a button click.
If you have further questions please let me know.
Regards,
Tsanna
Thank you for your feedback.
If I can provide further assistance regarding this matter, feel free to contact me.
Thanks Tsanna.
We ended up resolving this by reloading the underlying data for a tab when new data is requested, then updating that tabs corresponding updatepanel. This resulted in the behaviour we wanted.
You can't reset all tabs in result of some other control's action, because you'll receive NullReferenceException due to the fact that the tabs load on demand and only the currently selected tab is entirely loaded.
If you have other questions, please let me know.
Hi again,
I'll try be more clear. Using AutoPostBackFlags-SelectedIndexChanged="on" is not an option for us, as each tab has different controls that need rebinding after each postback. Setting AutoPostBackFlags-SelectedIndexChanged="off" results in the SelectedIndexChanged event ONLY being fired after loading each tab for the first time. It DOES NOT fire again (this applies to both the client and server event, I have debugged the page to confirm this, they DO NOT fire after each tab has been loaded once).
The above behaviour is what we are after however. We want to load each tab on demand (this is currently happening, and works fine), and then not load the tab again (this is also working fine, as we have AutoPostBackFlags-SelectedIndexChanged="Async", meaning the whole page isn't being posted back, resulting in the controls inside each tab not requiring rebinding.
HOWEVER, we want to reset this behaviour once the user selects a value from a drop down. We want to reset all tabs, and then reload them ONCE after clicking on each tab. Basically, we want the same behaviour as when the page is loaded for the first time currently (tabs are loaded on demand, and once loaded, not loaded again).
I'm assuming there's some client side script that determines whether or not the tab should be reloaded or not, because the tab loads fine on the initial page load, but won't load again until refreshing the page. We just need to 'reset' this behaviour.
Any suggestions?