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%3EApplication%20JMP%20%3A%20acc%C3%A9der%20aux%20%C3%A9l%C3%A9ments%20enfants%20de%20la%20bo%C3%AEte%20de%20panneau%20dynamique%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-803092%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ESalut%2C%3C%2FP%3E%3CP%3Ej'%C3%A9cris%20un%20code%20d'application%20qui%20cr%C3%A9era%20dynamiquement%20une%20%C3%A9tiquette%20de%20zone%20de%20texte%20et%20une%20zone%20d'%C3%A9dition%20de%20texte%20lorsque%20l'utilisateur%20sp%C3%A9cifie%20le%20nombre%20n%C3%A9cessaire%20lors%20du%20clic%20sur%20le%20bouton%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%3EMaintenant%2C%20en%20cliquant%20sur%20un%20autre%20bouton%2C%20je%20souhaite%20acc%C3%A9der%20au%20contenu%20de%20textEBox%20de%20tous%20les%20%C3%A9l%C3%A9ments%20enfants%20de%20la%20zone%20du%20panneau.%3C%2FP%3E%3CP%3Ej'ai%20essay%C3%A9%20de%20cr%C3%A9er%20une%20variable%20globale%20et%20d'y%20acc%C3%A9der%2C%20mais%20cela%20ne%20fonctionne%20pas.%20Toute%20alternative%20ou%20meilleure%20fa%C3%A7on%20d'y%20parvenir%20serait%20utile.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EMerci%20d'avance%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%3EAutomatisation%20et%20scripts%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%3ER%C3%A9%3A%20Application%20JMP%20%3A%20acc%C3%A9der%20aux%20%C3%A9l%C3%A9ments%20enfants%20de%20la%20bo%C3%AEte%20de%20panneau%20dynamique%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-803132%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EUtilisez%20XPath%20pour%20obtenir%20une%20liste%20de%20r%C3%A9f%C3%A9rences%20%C3%A0%20une%20zone%20d'%C3%A9dition%20de%20texte%20(ou%20zone%20de%20texte)%20ou%20utilisez%20une%20liste%20comme%20vous%20le%20faites%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