Databinding Errors and the wwWebTabControl

Web Connection's databinding displays error messages on controls that are databound and provides links to those controls on the top of the page. This works great to jump to the control in error, but when that control lives on a tab page that is not visible you'll find that while the control gets activated the tab page won't automatically change to display it.

To work around this issue you can implement a JavaScript function OnBindingErrorLink to intercept link clicks and activate the appropriate page explicitly. Whenever an error link is clicked this global function is called and you can use it to activate the appropriate page. The function receives a single parameter which is the element that has the error on it.

With this knowledge you can use a somewhat generic implementation to activate the appropriate page. The following code assumes a tab control named Tabs on which each tab page has a CSS class named tabpage assigned to it (ie. <div class="tabpage">):