mendenaresh1357 - Wednesday, March 10, 2010 11:55 AM:
Hi Everyone,
I have two Questions
1) I need to hide relationship tabs onChange of value from a list box. How can i achieve this?
2) open a form on field Event.
Regards,
Naresh
kieenvt - Friday, March 12, 2010 1:52 AM:
Show a exist item:
top.aras.uiShowItem(ItemType, Item ID);
Create new item:
top.aras.uiNewItemEx(ItemType);
PeterSchroer - Friday, March 12, 2010 8:49 AM:
To hide a tab based upon an event... link the OnChange event to a JS Method, in the JS method here is the pattern for hiding a Tab:
var tabbar = parent.relationships.relTabbar;
var tabID = null;
tabID = tabbar.GetTabId("BOM");
if (tabID) { tabbar.SetTabVisible(tabID,false); }
Peter.
mendenaresh1357 - Monday, March 15, 2010 4:22 AM:
Hi Peter,
Thanks for your help. Actually it is a field event (Onchange). if a particular value is selected (into the field), i should hide tabs and when changed to other value i should show back the tabs. By using your code (Given above) am able to hide the tabs. but when i change the field value am suppose to show back the tabs which is not happening. i used the following code.
var tabbar = parent.relationships.relTabbar;
tabID
= tabbar.GetTabId("BOM");
if (tabID) {
tabbar.SetTabVisible(tabID,true); }
Here the issue is, once i hide the tab I am not able to get its id (TabID) from Tabbar.
var tabbar = parent.relationships.relTabbar;
tabID
= tabbar.GetTabId("BOM"); // This value is null or an empty string
How can i get the Tabid after hiding the tab?
Regards,
Naresh
Jeroen Bosch - Monday, February 16, 2015 3:12 PM:
Hi Naresh,
Almost 5 years later, did you succeed in showing again the hidden tabs? If so, how?
I am struggling for 2 days with the wrong behavior of SetTabVisible :-(
I am using Innovator 11 with Firefox ESR 31.4.0 (same problem with IE11).
While waiting for a fix to this problem, I am using SetTabEnabled as a temporary solution and it works great.
Thanks,
Jeroen
Jeroen Bosch - Monday, February 23, 2015 6:01 AM:
Hello community,
I cannot believe that the "SetTabVisible" method was not made workable by somebody somewhere.
Thanks
Jeroen
zahar - Monday, February 23, 2015 6:55 AM:
Hi,
Here is my method for removing tab based on classification, attached on form load (updated to work in Innovator 11, for 9.4 and 9.3 use commented rows):
function tryRun() {
if (!parent.relationships) {
setTimeout(tryRun, 100);
return;
}
if (parent.relationships.document.readyState != "complete" || !parent.relationships.currTabID) {
setTimeout(tryRun, 100);
} else {
if (document.thisItem.getProperty("classification","") == "Setting") {
parent.relationships.relTabbar.removeTabByLabel("Structure");
//parent.relationships.document.relTabbar.removeTabByLabel("Structure");
}
}
}
setTimeout(tryRun, 200);
Jeroen Bosch - Tuesday, February 24, 2015 4:38 AM:
Hi,
Here is my method for removing tab based on classification, attached on form load (updated to work in Innovator 11, for 9.4 and 9.3 use commented rows):
...
Thanks Zahar but the question was different.
Tabs made non-visible using SetTabVisible(tabid,false) are visible again after SetTabVisible(tabid,true).
Any idea why?
Jeroen
Jeroen Bosch - Thursday, March 12, 2015 9:58 AM:
Up.
zahar - Saturday, March 14, 2015 5:31 PM:
Jeroen
I'm still not sure what is your question.
After you hide tab from relTabbar - meaning remove the tab control from collection of tabs. So when you will try to use "GetTabId" it will not be returned as tab is not part of tabbar collection.
But if you need to find the ID of tab that is hidded what you need to do is:
parent.relationships.tabs_root.selectSingleNode("//tabbar/tab[@label='XXXXXXXXXXXXXXXX']/@id").text
this will return the ID (if part exist - so before using .text test that selectSingleNode not return null) and then use SetTabVisible to "rebuild" the tab in the tabbar collection
//Remove tab from display
var tabbar = parent.relationships.relTabbar;
tabID = tabbar.GetTabId("BOM");
if (tabID) { tabbar.SetTabVisible(tabID,false); }
//Rebuild tab:
tabID = parent.relationships.tabs_root.selectSingleNode("//tabbar/tab[@label='BOM']/@id").text
if (tabID) { tabbar.SetTabVisible(tabID,true); }
Jeroen Bosch - Thursday, April 2, 2015 1:10 PM:
Hi Zahar,
Thank you for your help.
I have tried your solution and I got this error message;
aras_object: "undefined" : "parent.relationships.tabs_root is undefined"
I have tried also "top.frames.relationships.tabs_root" without success.
By the way, the code is located in a client JS method.
Jeroen
zahar - Monday, April 13, 2015 8:26 AM:
On with event of form you attached your method?
Jeroen Bosch - Saturday, April 18, 2015 6:33 AM:
Hi Zahar,
I don't think that the type of event is relevant here because the code works perfectly with the SetTabEnabled method where the tab are enabled/disabled programmatically. The problem is when I use the SetTabVisible method.
For your information, here is what I do:
I have created an HTML field in the form and in the HTML, I am calling javascript methods which builds Dijit widgets.
One of the widgets is a content pane and I would like to show only a subset relationship tabs when the mouse is entering in the widget's area:
var MyWidget = new dijit.layout.ContentPane(
{
id: "MyWidget",
title: "a title",
onMouseEnter: ShowOnlyHowTheseTabs,
selected: false
});
ShowOnlyHowTheseTabs is a method which uses SetTabsEnabled.
Jeroen.
Louise - Tuesday, April 12, 2016 10:53 AM:
Hi Jeroen,
did you manage to get this to work?
BR,
Louise
Louise - Thursday, April 14, 2016 10:36 AM:
Anybody got this working? :)
I got this working in IE, but in FireFox I just get an "empty" tab: there are no buttons or anything. Any ideas why, or how to solve it?
Usecase: all tabs should be hidden when creating a part, until user selects classification, then the correct tabs for that classification are shown.
Below method is run onLoad of my form:
-----------------------------------------------------------------
top.nyx_HidePartTabs = function() {
if (!parent.relationships || !parent.relationships.relTabbarReady || parent.relationships.relTabbar.GetTabOrder("|") === "") {
setTimeout("top.nyx_HidePartTabs();", 30);
return;
}
var tabbar = parent.relationships.relTabbar;
tabbar.SetTabVisible("6459F5FF5B0B416CB81B01EAFB9D1921", false);
}
top.nyx_ShowPartTabs = function() {
var tabbar = parent.relationships.relTabbar;
tabbar.SetTabVisible("6459F5FF5B0B416CB81B01EAFB9D1921", true);
}
setTimeout("top.nyx_HidePartTabs();", 30);
-----------------------------------------------------------------
Then onBeforeUnload below method is run: (form is unloaded when classification is changed, a classification specific form is opened once classification is selected)
-----------------------------------------------------------------
top.nyx_ShowPartTabs();
-----------------------------------------------------------------