cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

add tab to journal that has tabs already

jetpeach
Level III

I have a report with tabs that I created a journal from.

Let in script, I need to add to the journal sometimes - I want more tabs in it.

 

Example code is below, but it always puts the new tabs on the bottom of one of the other tabs.  The behavior I want is 5 tabs in the journal'd output.

Any help to do this? I tried add instead of append, but can't seem to find right command.

Thanks,

Joe

 

nw = new window("Tabs",tab box(
	tab page box(Title("test1"),text box("1st tab")),
	tab page box(Title("test2"),text box("2st tab")),
	tab page box(Title("test3"),text box("3st tab"))
	)
);

nw << journal;

nw2 = new window("Tabs2",tab box(
	tab page box(Title("test4"),text box("4st tab")),
	tab page box(Title("test5"),text box("5st tab"))
	)
);

current journal() << append(nw2);

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User


Re: add tab to journal that has tabs already

Adding to the journal will do just that, add to the journal, not to the Tab Box();You need to directly reference the tab box() if you want to add to it.  Below is a simple rework of your code that is one way to add elements to the journal Tab Box();

nw = new window("Tabs",<<journal);
ttt=tab box(
	tab page box(Title("test1"),text box("1st tab")),
	tab page box(Title("test2"),text box("2st tab")),
	tab page box(Title("test3"),text box("3st tab"))
	);


nw << append(ttt);

ttt<<insert(4,"test4",text box("4st tab"));
ttt<<insert(5,"test5",text box("5st tab"));
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User


Re: add tab to journal that has tabs already

Adding to the journal will do just that, add to the journal, not to the Tab Box();You need to directly reference the tab box() if you want to add to it.  Below is a simple rework of your code that is one way to add elements to the journal Tab Box();

nw = new window("Tabs",<<journal);
ttt=tab box(
	tab page box(Title("test1"),text box("1st tab")),
	tab page box(Title("test2"),text box("2st tab")),
	tab page box(Title("test3"),text box("3st tab"))
	);


nw << append(ttt);

ttt<<insert(4,"test4",text box("4st tab"));
ttt<<insert(5,"test5",text box("5st tab"));
Jim
jetpeach
Level III


Re: add tab to journal that has tabs already

great, thanks txnelson. this works for me. i was misundertanding journals, thinking they were always static copies of whatever was being journaled, and hadn't thought to try adding in the way you suggested.