Page 1 of 1

change Atrium Tab name

Posted: Thu May 18, 2017 5:12 am
by paksilv
Hi,

is it possible change the name of an Atrium tab from a RDF program?

Imagine this case:
An Atrium item menu -> call a RDF program. This RDF program changes own tab name adding a suffix string to the tab name (that usually is the name of the menu item).

Thank you.
Best regards.

Re: change Atrium Tab name

Posted: Thu May 18, 2017 4:47 pm
by Scott Klement
Currently, we do not offer a feature that lets you change the Atrium tab name.

Re: change Atrium Tab name

Posted: Fri May 19, 2017 4:27 am
by paksilv
Thank you Scott,
I'll be waiting for this new feature..
Bye.
Pak

Re: change Atrium Tab name

Posted: Fri May 19, 2017 4:33 am
by Scott Klement
If you'd like to request this feature, you should e-mail support@profoundlogic.com.

Forums are "community support", they cannot be used to report bugs or request features.

Re: change Atrium Tab name

Posted: Fri May 19, 2017 11:16 am
by shuffman
I have a set of JavaScript functions we use to do this. We are running PUI 5.6.0
Typically just called during the onload event

Code: Select all

changeTabTitle('My new title');
You could even add a little color since it just replaces the HTML

Code: Select all

changeTabTitle('<span style="color:red;">My new RED title</span>');
I did have to remove some things that are custom to our environment but hopefully i didn't miss anything

Code: Select all


function getTabTitle(){
	try{
		var tab = Atrium.getCurrentTab();
		var tabId = tab.id.split("-")[2];
		tab = window.parent.document.getElementById("Atrium-tabPanel__ext-comp-" + tabId);
		tab = tab.getElementsByClassName("x-tab-strip-text")[0];
		return tab.innerHTML;
	}catch(err){}	
}

function changeTabTitle(title){
	try{
		var tab = Atrium.getCurrentTab();
		var tabId = tab.id.split("-")[2];
		tab = window.parent.document.getElementById("Atrium-tabPanel__ext-comp-" + tabId);
		tab = tab.getElementsByClassName("x-tab-strip-text")[0];
		if(tab.title == ''){
			tab.title = tab.textContent;	
		}
		tab.innerHTML = title;
	}catch(err){}	
}

function resetTabTitle(){
	try{
		var tab = Atrium.getCurrentTab();
		var tabId = tab.id.split("-")[2];
		tab = window.parent.document.getElementById("Atrium-tabPanel__ext-comp-" + tabId);
		tab = tab.getElementsByClassName("x-tab-strip-text")[0];
		if(tab.title !== ''){
			tab.innerHTML = tab.title;	
		}
	}catch(err){}	
}