Choose Language Hide Translation Bar
Highlighted
Dib-Dey
Level III

two windows merged using Tab Box() not performing correctly

 

I merged two window using Tab Box() as shown by following code. But is making some of the button box not functional. They work fine in individual box. Any idea what the object reference get missing? 

Clear Log();
main_window_app_path = Substr( Get Default Directory(), 2, 999 );
main_window_app_path = Substitute( main_window_app_path, "/", "\" );
Show( main_window_app_path );
Set Path Variable( "root", main_window_app_path );
Include( "$root/System/DataAnalysisGUI_Mongo.jsl" );
Include( "$root/System/DataAnalysisGUI_SMV.jsl" );
Include( "$root/System/GUI_Files/Lists.jsl" );
Include( "$root/System/GUI_Files/HelperFunctions.jsl" );
Include( "$root/System/Common/GetDataFromSQLorCSV.jsl" );
Include( "$root/System/Common/wrapper_mongo_data_pull.jsl" );
//********main window****************//
DAGui = New Window( "Database Query",
	bb = Border Box( Left( 10 ), Right( 10 ), Top( 10 ), Bottom( 5 ), Sides( 15 ),
		V List Box(
			Text Box( "GUI to Pull-data from both MongoDB and AVcloud", set font size(10) ),
			tb = Text Box( "pre-req: JMP14 and run install_pkg.bat"),
			tb << Font Color("yellow") << background color("red") << border(1);
			Text Box( "More info: http://goto/jmp_ui"),
			Spacer Box( Size( 10, 10 ) ),
			H List Box( Tab Box( "MongoDB", Mongo_data, "AvcloudDB", SMV_data ), )
		)
	),
);
//SMV_data << Close Window();
//Mongo_data << Close Window();
bb << Set Color( "black" );
 

merged.jpg

Below is Mongo tab window individually. 

mongodb.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: two windows merged using Tab Box() not performing correctly

It looks like what you have is a clone of an existing display tree.  I can't tell what the object Mongo_data is - if it is a display box that is already part of a larger display tree, then using Mongo_data in another display tree results in a clone, because a single display box object can only exist in at most one window at a time.  Sometimes a clone is what you want, and you can also explicitly clone a display tree using the <<CloneBox method on a box.  If you don't want a clone, then you need to make sure that the boxes that you add to a window are not already part of a larger display tree.  The script below demonstrates a few different cases for how to create common content in multiple windows.

 

// Define expression that will create a GUI
makeUI = Expr(
	Panel Box( "Query Building",
		V List Box(
			H List Box(
				Text Box( "Columns:" ),
				Combo Box( {"", "option 2"} ),
				Text Box( "Operator:" ),
				Combo Box( {"==", "++"} )
			),
			Text Box( "Condition:" ),
			Text Edit Box( "", <<Set Width( 400 ) )
		)
	)
);

// Evaluating this expression will add the boxes to a window
w1 = New Window( "standalone",
	x = makeUI
);

// Another instance of the GUI can be created in a tabbed window
w2 = New Window( "tabbed",
	Tab Box( "Tab 1", makeUI )
);

// Referencing a box that is already part of a larger display tree
// will make a copy of the box
w3 = New Window( "tabcopy",
	Tab Box( "Tab 1", x )
);

// A journaled report also creates a copy - copies of display boxes
// are not fully functional
w1 << Journal;

  

View solution in original post

1 REPLY 1
Highlighted

Re: two windows merged using Tab Box() not performing correctly

It looks like what you have is a clone of an existing display tree.  I can't tell what the object Mongo_data is - if it is a display box that is already part of a larger display tree, then using Mongo_data in another display tree results in a clone, because a single display box object can only exist in at most one window at a time.  Sometimes a clone is what you want, and you can also explicitly clone a display tree using the <<CloneBox method on a box.  If you don't want a clone, then you need to make sure that the boxes that you add to a window are not already part of a larger display tree.  The script below demonstrates a few different cases for how to create common content in multiple windows.

 

// Define expression that will create a GUI
makeUI = Expr(
	Panel Box( "Query Building",
		V List Box(
			H List Box(
				Text Box( "Columns:" ),
				Combo Box( {"", "option 2"} ),
				Text Box( "Operator:" ),
				Combo Box( {"==", "++"} )
			),
			Text Box( "Condition:" ),
			Text Edit Box( "", <<Set Width( 400 ) )
		)
	)
);

// Evaluating this expression will add the boxes to a window
w1 = New Window( "standalone",
	x = makeUI
);

// Another instance of the GUI can be created in a tabbed window
w2 = New Window( "tabbed",
	Tab Box( "Tab 1", makeUI )
);

// Referencing a box that is already part of a larger display tree
// will make a copy of the box
w3 = New Window( "tabcopy",
	Tab Box( "Tab 1", x )
);

// A journaled report also creates a copy - copies of display boxes
// are not fully functional
w1 << Journal;

  

View solution in original post

Article Labels

    There are no labels assigned to this post.