JMP 응용 프로그램: 동적 패널 상자 자식 요소에 액세스안녕,
사용자가 버튼을 클릭할 때 필요한 수를 지정하면 동적으로 텍스트 상자 레이블과 텍스트 편집 상자를 생성하는 앱 코드를 작성하고 있습니다.
textEditBoxList = {}; // global variable<BR />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
)
);
);
);이제 다른 버튼을 클릭하여 패널 상자의 모든 자식 요소의 textEBox 내용에 액세스하려고 합니다.
전역 변수를 만들어서 접근해 보았지만 작동하지 않습니다. 이를 달성하기 위한 대체 방법이나 더 나은 방법이 있으면 좋겠습니다.
미리 감사드립니다
자동화 및 스크립팅Re: JMP 응용 프로그램 : 동적 패널 상자 자식 요소에 액세스XPath를 사용하여 텍스트 편집 상자(또는 텍스트 상자)에 대한 참조 목록을 가져오거나 귀하가 하는 것처럼 목록을 활용하십시오.
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);