cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-803092%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EJMP%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F%EF%BC%9A%E5%AD%98%E5%8F%96%E5%8B%95%E6%85%8B%E9%9D%A2%E6%9D%BF%E6%A1%86%E5%AD%90%E5%85%83%E7%B4%A0%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-803092%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%3C%2FP%3E%3CP%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E7%B7%A8%E5%AF%AB%E4%B8%80%E5%80%8B%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F%E7%A8%8B%E5%BC%8F%E7%A2%BC%EF%BC%8C%E7%95%B6%E4%BD%BF%E7%94%A8%E8%80%85%E6%8C%87%E5%AE%9A%E5%96%AE%E6%93%8A%E6%8C%89%E9%88%95%E6%99%82%E9%9C%80%E8%A6%81%E5%A4%9A%E5%B0%91%E5%80%8B%E6%96%87%E5%AD%97%E6%96%B9%E5%A1%8A%E6%A8%99%E7%B1%A4%E5%92%8C%E6%96%87%E5%AD%97%E7%B7%A8%E8%BC%AF%E6%A1%86%E6%99%82%EF%BC%8C%E8%A9%B2%E7%A8%8B%E5%BC%8F%E7%A2%BC%E5%B0%87%E5%8B%95%E6%85%8B%E5%BB%BA%E7%AB%8B%E6%96%87%E5%AD%97%E6%96%B9%E5%A1%8A%E6%A8%99%E7%B1%A4%E5%92%8C%E6%96%87%E5%AD%97%E7%B7%A8%E8%BC%AF%E6%A1%86%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EtextEditBoxList%20%3D%20%7B%7D%3B%20%20%2F%2F%20global%20variable%3CBR%20%2F%3ELoadSteps%20%3D%20function%20(%7BthisBox%7D%2C%20%7BDefault%20Local%7D%2C%0A%09steps_number%20%3D%20NumberEdit1%20%26lt%3B%26lt%3B%20Get%3B%20%20%20%2F%2F%20get%20number%20of%20items%20from%20number%20edit%20box%0A%09For(i%3D1%2C%20i%26lt%3B%3D%20steps_number%2Ci%2B%2B%2C%0A%09%09textBox%20%3D%20Text%20Box(%22Step%20%3A%20%22%20%7C%7C%20Char(i))%3B%0A%09%09textBox%20%26lt%3B%26lt%3B%20Set%20Width(100)%3B%0A%09%09%0A%09%09textEBox%20%3D%20Text%20Edit%20Box(%20%22Enter%20text%20here...%22)%3B%0A%09%09textEBox%20%26lt%3B%26lt%3B%20Set%20Width(300)%3B%0A%09%09%0A%09%09Insert%20Into(textEditBoxList%2CtextEBox)%3B%0A%09%09print(textEditBoxList)%3B%20%2F%2F%20Its%20always%20empty%0A%09%09%0A%09%09Panel1%20%26lt%3B%26lt%3B%20Append(%0A%09%09%09H%20List%20Box(%0A%09%09%09%09textBox%2C%0A%09%09%09%09textEBox%0A%09%09%09)%0A%09%09)%3B%0A%09)%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%E7%8F%BE%E5%9C%A8%EF%BC%8C%E5%9C%A8%E5%8F%A6%E4%B8%80%E5%80%8B%E6%8C%89%E9%88%95%E4%B8%8A%E9%BB%9E%E6%93%8A%E6%88%91%E6%83%B3%E5%AD%98%E5%8F%96%E9%9D%A2%E6%9D%BF%E6%A1%86%E6%89%80%E6%9C%89%E5%AD%90%E5%85%83%E7%B4%A0%E7%9A%84%20textEBox%20%E7%9A%84%E5%85%A7%E5%AE%B9%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E5%98%97%E8%A9%A6%E5%89%B5%E5%BB%BA%E4%B8%80%E5%80%8B%E5%85%A8%E5%B1%80%E8%AE%8A%E6%95%B8%E4%B8%A6%E9%80%9A%E9%81%8E%E5%AE%83%E9%80%B2%E8%A1%8C%E8%A8%AA%E5%95%8F%EF%BC%8C%E4%BD%86%E6%B2%92%E6%9C%89%E6%95%88%E6%9E%9C%E3%80%82%E4%BB%BB%E4%BD%95%E6%9B%BF%E4%BB%A3%E6%88%96%E6%9B%B4%E5%A5%BD%E7%9A%84%E6%96%B9%E6%B3%95%E4%BE%86%E5%AF%A6%E7%8F%BE%E9%80%99%E4%B8%80%E7%9B%AE%E6%A8%99%E9%83%BD%E6%9C%83%E6%9C%89%E6%89%80%E5%B9%AB%E5%8A%A9%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E5%85%88%E8%87%B4%E8%AC%9D%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-803092%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%E8%87%AA%E5%8B%95%E5%8C%96%E5%92%8C%E8%85%B3%E6%9C%AC%E7%B7%A8%E5%AF%AB%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-803132%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9AJMP%20%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F%EF%BC%9A%E5%AD%98%E5%8F%96%E5%8B%95%E6%85%8B%E9%9D%A2%E6%9D%BF%E6%A1%86%E5%AD%90%E5%85%83%E7%B4%A0%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-803132%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%BF%E7%94%A8%20XPath%20%E5%8F%96%E5%BE%97%E6%96%87%E5%AD%97%E7%B7%A8%E8%BC%AF%E6%A1%86%EF%BC%88%E6%88%96%E6%96%87%E5%AD%97%E6%96%B9%E5%A1%8A%EF%BC%89%E7%9A%84%E5%BC%95%E7%94%A8%E5%88%97%E8%A1%A8%EF%BC%8C%E6%88%96%E5%83%8F%E6%82%A8%E4%B8%80%E6%A8%A3%E4%BD%BF%E7%94%A8%E5%88%97%E8%A1%A8%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0A%0Anw%20%3D%20New%20Window(%22%22%2C%20%0A%09panel1%20%3D%20Lineup%20Box(N%20Col(2))%0A)%3B%0A%0Asteps_number%20%3D%203%3B%0AtextEditBoxList%20%3D%20%7B%7D%3B%0A%0AFor(i%20%3D%201%2C%20i%20%26lt%3B%3D%20steps_number%2C%20i%2B%2B%2C%0A%09textBox%20%3D%20Text%20Box(%22Step%20%3A%20%22%20%7C%7C%20Char(i))%3B%0A%09textBox%20%26lt%3B%26lt%3B%20Set%20Width(100)%3B%0A%09%0A%09textEBox%20%3D%20Text%20Edit%20Box(%22Enter%20text%20here...%22)%3B%0A%09textEBox%20%26lt%3B%26lt%3B%20Set%20Width(300)%3B%0A%09%0A%09Insert%20Into(textEditBoxList%2C%20textEBox)%3B%0A%09%0A%09Panel1%20%26lt%3B%26lt%3B%20Append(H%20List%20Box(textBox%2C%20textEBox))%3B%0A)%3B%0A%0Atebs%20%3D%20panel1%20%26lt%3B%26lt%3B%20XPath(%22%2F%2FTextEditBox%22)%3B%0A%0Ashow(tebs%2C%20textEditBoxList)%3B%0A%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
ComplexNerd
Level III

JMP Application : access dynamic panel box child elements

Hi,

i am writing a app code which will dynamically create a textbox label and text edit box when user specifies how many is needed on button click

textEditBoxList = {};  // global variable
LoadSteps = function ({thisBox}, {Default Local}, steps_number = NumberEdit1 << Get; // get number of items from number edit box For(i=1, i<= steps_number,i++, textBox = Text Box("Step : " || Char(i)); textBox << Set Width(100); textEBox = Text Edit Box( "Enter text here..."); textEBox << Set Width(300); Insert Into(textEditBoxList,textEBox); print(textEditBoxList); // Its always empty Panel1 << Append( H List Box( textBox, textEBox ) ); ); );

Now on another button click i want to access the contents of textEBox of all child elements of panel box.

i tried creating a global variable and accessing through it but dosent work. any alternative or better way to achieve this would be helpful.

 

Thanks in advance

 

 

 

1 REPLY 1
jthi
Super User

Re: JMP Application : access dynamic panel box child elements

Either use XPath to get a list of references to a Text Edit Box (or text box) or utilize a list like you are doing

Names Default To Here(1);

nw = New Window("", 
	panel1 = Lineup Box(N Col(2))
);

steps_number = 3;
textEditBoxList = {};

For(i = 1, i <= steps_number, i++,
	textBox = Text Box("Step : " || Char(i));
	textBox << Set Width(100);
	
	textEBox = Text Edit Box("Enter text here...");
	textEBox << Set Width(300);
	
	Insert Into(textEditBoxList, textEBox);
	
	Panel1 << Append(H List Box(textBox, textEBox));
);

tebs = panel1 << XPath("//TextEditBox");

show(tebs, textEditBoxList);

-Jarmo