cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
pauldeen
Level VI

Delete a text box and a button from a lineup box

I'm trying to delete both the button itself and the associated text box before it. So when I cilck button nr 3 I want text nr 3 to also be deleted. Any ideas?

 

nr=5;
new window("Button test",
	Lineuplist=Lineup Box( N Col( 2 ),
		
	)
);
For(i=1,i<=nr,i++,
	Lineuplist << append(textbox("Text nr "||char(i)));
	Lineuplist << append(
		buttonbox("Button nr "||char(i),
			<< Set Function(
				Function({this},
					this << delete;
				)
			)
		);
	);
);
1 ACCEPTED SOLUTION

Accepted Solutions
thomasz
Level IV

Re: Delete a text box and a button from a lineup box

Here is a piece of code that works:

nr=5;
new window("Button test",
	Lineuplist=Lineup Box( N Col( 2 ),
		
	)
);
For(i=1,i<=nr,i++,
	Lineuplist << append(textbox("Text nr "||char(i)));
	Lineuplist << append(
		buttonbox("Button nr "||char(i),
			<< Set Function(
				Function({this},
					ps=this<<sib;
					par=this<<parent;
					buttonName=this<<get button name;
					buttonNo=regex(buttonName,".*?([0-9]*)$","\1");
					locator=eval insert("//TextBox[text()='Text nr ^buttonNo^']");
					textBox=par<<xpath(locator);
					textBox<<delete;
					this<<delete;
				)
			)
		);
	);
);

View solution in original post

3 REPLIES 3
uday_guntupalli
Level VIII

Re: Delete a text box and a button from a lineup box

@pauldeen

nr=5;
new window("Button test",
	Lineuplist=Lineup Box( N Col( 2 ))
	      ); 
);
For(i=1,i<=nr,i++,
	Lineuplist << append(textbox("Text nr "||char(i)));
	Lineuplist << append(
		buttonbox("Button nr "||char(i),
			<< Set Function(
				Function({this},
					this << delete;
				)
			)
		);
	);
	Lineuplist[Text Box(i)] << delete ; // this is the piece of code which will do what you are after . Insert it where you delete the button 
);
Best
Uday
thomasz
Level IV

Re: Delete a text box and a button from a lineup box

Here is a piece of code that works:

nr=5;
new window("Button test",
	Lineuplist=Lineup Box( N Col( 2 ),
		
	)
);
For(i=1,i<=nr,i++,
	Lineuplist << append(textbox("Text nr "||char(i)));
	Lineuplist << append(
		buttonbox("Button nr "||char(i),
			<< Set Function(
				Function({this},
					ps=this<<sib;
					par=this<<parent;
					buttonName=this<<get button name;
					buttonNo=regex(buttonName,".*?([0-9]*)$","\1");
					locator=eval insert("//TextBox[text()='Text nr ^buttonNo^']");
					textBox=par<<xpath(locator);
					textBox<<delete;
					this<<delete;
				)
			)
		);
	);
);
pauldeen
Level VI

Re: Delete a text box and a button from a lineup box

Thanks!

Recommended Articles