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%20%EC%9D%91%EC%9A%A9%20%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%A8%3A%20%EB%8F%99%EC%A0%81%20%ED%8C%A8%EB%84%90%20%EC%83%81%EC%9E%90%20%EC%9E%90%EC%8B%9D%20%EC%9A%94%EC%86%8C%EC%97%90%20%EC%95%A1%EC%84%B8%EC%8A%A4%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-803092%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%EC%95%88%EB%85%95%2C%3C%2FP%3E%3CP%3E%EC%82%AC%EC%9A%A9%EC%9E%90%EA%B0%80%20%EB%B2%84%ED%8A%BC%EC%9D%84%20%ED%81%B4%EB%A6%AD%ED%95%A0%20%EB%95%8C%20%ED%95%84%EC%9A%94%ED%95%9C%20%EC%88%98%EB%A5%BC%20%EC%A7%80%EC%A0%95%ED%95%98%EB%A9%B4%20%EB%8F%99%EC%A0%81%EC%9C%BC%EB%A1%9C%20%ED%85%8D%EC%8A%A4%ED%8A%B8%20%EC%83%81%EC%9E%90%20%EB%A0%88%EC%9D%B4%EB%B8%94%EA%B3%BC%20%ED%85%8D%EC%8A%A4%ED%8A%B8%20%ED%8E%B8%EC%A7%91%20%EC%83%81%EC%9E%90%EB%A5%BC%20%EC%83%9D%EC%84%B1%ED%95%98%EB%8A%94%20%EC%95%B1%20%EC%BD%94%EB%93%9C%EB%A5%BC%20%EC%9E%91%EC%84%B1%ED%95%98%EA%B3%A0%20%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%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%EC%9D%B4%EC%A0%9C%20%EB%8B%A4%EB%A5%B8%20%EB%B2%84%ED%8A%BC%EC%9D%84%20%ED%81%B4%EB%A6%AD%ED%95%98%EC%97%AC%20%ED%8C%A8%EB%84%90%20%EC%83%81%EC%9E%90%EC%9D%98%20%EB%AA%A8%EB%93%A0%20%EC%9E%90%EC%8B%9D%20%EC%9A%94%EC%86%8C%EC%9D%98%20textEBox%20%EB%82%B4%EC%9A%A9%EC%97%90%20%EC%95%A1%EC%84%B8%EC%8A%A4%ED%95%98%EB%A0%A4%EA%B3%A0%20%ED%95%A9%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3CP%3E%EC%A0%84%EC%97%AD%20%EB%B3%80%EC%88%98%EB%A5%BC%20%EB%A7%8C%EB%93%A4%EC%96%B4%EC%84%9C%20%EC%A0%91%EA%B7%BC%ED%95%B4%20%EB%B3%B4%EC%95%98%EC%A7%80%EB%A7%8C%20%EC%9E%91%EB%8F%99%ED%95%98%EC%A7%80%20%EC%95%8A%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%EC%9D%B4%EB%A5%BC%20%EB%8B%AC%EC%84%B1%ED%95%98%EA%B8%B0%20%EC%9C%84%ED%95%9C%20%EB%8C%80%EC%B2%B4%20%EB%B0%A9%EB%B2%95%EC%9D%B4%EB%82%98%20%EB%8D%94%20%EB%82%98%EC%9D%80%20%EB%B0%A9%EB%B2%95%EC%9D%B4%20%EC%9E%88%EC%9C%BC%EB%A9%B4%20%EC%A2%8B%EA%B2%A0%EC%8A%B5%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%EB%AF%B8%EB%A6%AC%20%EA%B0%90%EC%82%AC%EB%93%9C%EB%A6%BD%EB%8B%88%EB%8B%A4%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%EC%9E%90%EB%8F%99%ED%99%94%20%EB%B0%8F%20%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8C%85%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%3ERe%3A%20JMP%20%EC%9D%91%EC%9A%A9%20%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%A8%20%3A%20%EB%8F%99%EC%A0%81%20%ED%8C%A8%EB%84%90%20%EC%83%81%EC%9E%90%20%EC%9E%90%EC%8B%9D%20%EC%9A%94%EC%86%8C%EC%97%90%20%EC%95%A1%EC%84%B8%EC%8A%A4%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-803132%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EXPath%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20%ED%85%8D%EC%8A%A4%ED%8A%B8%20%ED%8E%B8%EC%A7%91%20%EC%83%81%EC%9E%90(%EB%98%90%EB%8A%94%20%ED%85%8D%EC%8A%A4%ED%8A%B8%20%EC%83%81%EC%9E%90)%EC%97%90%20%EB%8C%80%ED%95%9C%20%EC%B0%B8%EC%A1%B0%20%EB%AA%A9%EB%A1%9D%EC%9D%84%20%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B1%B0%EB%82%98%20%EA%B7%80%ED%95%98%EA%B0%80%20%ED%95%98%EB%8A%94%20%EA%B2%83%EC%B2%98%EB%9F%BC%20%EB%AA%A9%EB%A1%9D%EC%9D%84%20%ED%99%9C%EC%9A%A9%ED%95%98%EC%8B%AD%EC%8B%9C%EC%98%A4.%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