My code is like below, it works well if I click option 1 and 2 one by one, but multiple list box would be generated after I continuously click the option 1 which would make my users confused. How could I optimize the code? Many thanks.
 
Another two question are:
1. If I delete a panel box, would the boxed(like text box) be deleted too or just not displayed?
2. How could I get the hierarchy of a modal window?
 
dt = Current Data Table();
If( Is Empty( dt ),
	Stop(),
	nc = N Col( dt )
);
openDTs = {};
For( i = 1, i <= N Table(), i++,
	Insert Into( openDTs, Data Table( i ) << getname )
);
tableSelBox = Expr(
	//Panel Box( "Select Limit Table", 
	
	lbtableSel = List Box( openDTs, width( 150 ), nlines( 6 ), maxselected( 1 ), ), 
		
		
	//),
);
nw = New Window( "Auto Plot",
	modal,
	hb = H List Box(
		V List Box(
			Panel Box( "Mode Selection",
				Spacer Box( size( 100, 0 ) ),
				rbMethod = Radio Box(
					{"With Current Limit", "Without Current Limit"},
					rbSel = rbMethod << get selected;
					dbAfterpb = colSelLstBox << Next();				
					If( rbSel == "With Current Limit",
						pb << Sib Append( tableSelBox ),
					);
					
					If( rbSel == "Without Current Limit", 
						dbAfterpb << Delete;
						lbtableSel << Delete
					),
				),
			), 
			Panel Box( "Action",
				Spacer Box( size( 100, 0 ) ),
				okBb = Button Box( "OK", Stop() ), 
			
				cancelBb = Button Box( "Cancel", Stop() ),
			), 
		), 
		
		pb = Panel Box( "Select Columns",
			colSelLstBox = Filter Col Selector( dt, nlines( Min( nc, 13 ) ) ), 
		), 
		
		pb << Sib Append( tableSelBox ), 
		
	), 
		
);
 
