Hi Guys,
Hope everyone is loving 10.3.
Using the Javascript onload event code below, on my add page I can easily show or hide a tab based on a user selection from a radio button control (This works amazing)
var ctrlCleaned = Runner.getControl(pageid, 'cleaned');
var tabs = pageObj.getTabs();
tabs.hide(0);
ctrlCleaned.on('change', function(e) {
if (this.getValue()=="Yes"){
tabs.show(0);
}
else {
tabs.hide(0);
}
});
However when it comes to the edit page, I am running into problems when I open the edit page in showing the tab if the user had selected "Yes" when saving the record on the add page originally.
I would expect the tab to be shown when the users opens the edit page if cleaned was = to Yes, I do however know my tab show/hide is controlled via the onChange portion of the code above.
When the user now edits the record, "Yes" is selected in the control as desired but the tab remains hidden until the user "changes" the value on the triggering control i.e. cleanedYes No.
Any ideas how I can adapt the code above or any alternative methods how I can show the tab if the condition is true on opening the edit page.
Foe regular show/hide fields I usually use a "Before display event" however please correct me if I'm wrong the Tabs API is Javascript based only and will not work in a "Before display event".
Much appreciated,
James