The omb_params zip file contains classes for a generic modal dialog that can be used from OMBPlus for capturing user input. It will support parameters that are text or passwords. If you unzip this file into owb\bin\admin you can try the dialog from OMBPlus.
The Java can be invoked by calling as follows;
# java::new oracle.owb.samples.CaptureParams
{
# display_string_list
display string for dialog ie. {"Hostname", "Port", "Service"}
# param_name_list
to query after dialog is complete ie. {"vhostname", "vport", "vservice"}
# param_type_list
STRING or STRINGHIDE or list of tokens (comma separated) for combo box
# }
# title_string_for_dialog
Title for the dialog.
# dialog_prompt_string
Prompt string for dialog.
or
# java::new oracle.owb.samples.CaptureParams
{
# display_string_list
display string for dialog
# param_name_list
to query after dialog is complete
# param_type_list
STRING or STRINGHIDE or list of tokens (comma separated) for combo box
# }
# title_string_for_dialog
# dialog_prompt_string
# ok_button_string
# cancel_button_string
or
# java::new oracle.owb.samples.CaptureParams
# title_string_for_dialog
# dialog_prompt_string
# ok_button_string
# cancel_button_string
There is a Java accessor methiod named 'okButton' that will return a boolean (in Java), the Tcl shell will return 0 for false, and 1 for true. This can be used to determine if the user has pressed the OK or cancel button. Since the user can define the text for these buttons, they can be used for Yes/No style questions for example.
5.1 Example to capture user input;
The following dialog can be created with the Tcl below;
The Tcl to create this dialog is show below, this creates a modal
dialog to capture the user input for username, password (in password field),
connection string and an option selectable from a combo box;
set pars [java::new {String[][]} 3 {{"User"
"Password" "Connect" "Option"} {"user" "pass" "connect" "option"} {"STRING"
"STRINGHIDE" "STRING" "thick,thin"}} ]
set jtitle "OWB Migration"
set jprompt "Please enter migration properties:"
set paramList [java::new oracle.owb.samples.CaptureParams
$pars $jtitle $jprompt]
# To check whether OK or cancel is pressed
used retrieve okButton/cancelButton on object, then check value (0 - false,
1 - true)
set okpressed [$paramList okButton]
# To retrieve the parameters invoke getValue
passing the parameter name, the user is stord in a variable (for example);
set userval [$paramList getValue "user"]
set passval [$paramList getValue "pass"]
set connectval [$paramList getValue "connect"]
set optionval [$paramList getValue "option"]
5.2 Example to create a question-style dialog;
set paramList [java::new oracle.owb.samples.CaptureParams "OWB Dimensional Design" "Do you want to create a cube?" "Yes" "No"]
Like the example above the 'okButton'/'cancelButton' methods can be used to query the button that was selected.