変換からのグローバル変数の値の設定
以下のコード・サンプルは、ユーザーにカスタマー番号を値として入力するよう求めるプロンプトを出す方法、その後にこの値を customerNumber グローバル変数に設定する方法を示しています。
Button button = new Button(this, SWT.NONE);
button.setText("Prompt for command");
button.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
InputDialog dialog = new InputDialog(getShell(), "Prompt",
"Enter a customer number:", "", null);
if (dialog.open() == InputDialog.OK) {
String value = dialog.getValue();
getSessionService().getParameterDataAccessService().
setParameterValue("hatsgv_customerNumber",value);
}
}
});
注: ZIETrans ランタイムは、フォームが送信されるまで、setParameterValue() メソッド呼び出しによって設定された新規グローバル変数の値を認識しません。