Good morning!
I have had the idea of only presenting users with only relevant tabs based on optionset value selections. I was able to come up with the following; it hides all tabs except the main input tab on load, it then displays the related tab on change. All is good there, however, on save the focus goes back to the main tab (on initial save only, subsequent saves focus remains where it should). On save how do I make it that the focus remains on the tab at the time of save?
function ToggleTab(executionContext) {
_formContext = executionContext.getFormContext();
var value = _formContext.getAttribute("xx_requesttype").getValue();
_formContext.ui.tabs.get("tab_5").setVisible(false);
_formContext.ui.tabs.get("tab_6").setVisible(false);
_formContext.ui.tabs.get("tab_7").setVisible(false);
_formContext.ui.tabs.get("tab_8").setVisible(false);
_formContext.ui.tabs.get("tab_10").setVisible(false);
if (value === 157420000)
_formContext.ui.tabs.get("tab_5").setVisible(true);
else if (value === 206340000)
_formContext.ui.tabs.get("tab_6").setVisible(true);
else if (value === 206340002)
_formContext.ui.tabs.get("tab_7").setVisible(true);
else if (value === 206340003)
_formContext.ui.tabs.get("tab_8").setVisible(true);
else if (value === 100000000)
_formContext.ui.tabs.get("tab_10").setVisible(true);
}
Thanks,
Corey