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 的內容。
我嘗試創建一個全局變數並通過它進行訪問,但沒有效果。任何替代或更好的方法來實現這一目標都會有所幫助。
先致謝
自動化和腳本編寫回覆: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);