ITEM: AC7742L
smit problem
Question:
Env: AIX 3.2.5
Desc: Customer would like to create his own SMIT panels for their
application. Before getting to the dialog screen, there are
a couple of questions he would like the user to answer. The
flow would be something like this:
What environment are you using? \
What directory in the environment? \
What file in the directory? \
Customer has tried to do this via multiple sm_cmd_hdr's.
However, this has not worked properly.
Customer would like for to know if it is possible to have
multiple sm_cmd_hdr's or sm_name_hdr's.
Action: You cannot have multiple dialogs (sm_cmd_hdrs); however,
it is possible to use multiple selectors (sm_name_hdrs),
In fact, you can setup a name selector to base it's
next_id on the results of the current selector. To do this,
you need to set the type in the sm_name_hdr stanza to "r",
raw, or "c", cooked. Raw means that the value of next_id
will be concatenated with whatever the user inputs on this
selector screen. Cooked, "c", means that the user's input
must be processed using the cmd_to_classify before being
concatenated onto the next_id value.
Here is an small example that will demonstrate the use
of multiple selectors. The example only has one path
that is complete, Selection 1, Option A. This is intended
only to be an example and IBM does not provide technical
support for this example. Custom coding is a Consult Line
activity.
\#
\# Menu option on top_menu called *** TEST MENU ***
\#
sm_menu_opt:
id = "top_menu"
id_seq_num = "098"
next_id = "first_sel"
text = "*** TEST MENU ***"
text_msg_file = ""
text_msg_set = 0
text_msg_id = 0
next_type = "n"
alias = ""
help_msg_id = ""
help_msg_loc = ""
\#
\# Selector screen and command option to determine first selection
\#
sm_name_hdr:
id = "first_sel"
next_id = "second_sel_"
option_id = "first_sel_opt"
has_name_select = ""
name = "First Selection"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
type = "r"
ghost = "y"
cmd_to_classify = ""
cmd_to_classify_postfix = ""
raw_field_name = "sel1"
cooked_field_name = ""
next_type = "n"
help_msg_id = ""
help_msg_loc = ""
sm_cmd_opt:
id = "first_sel_opt"
id_seq_num = "0"
disc_field_name = ""
name = "Choose First Selection"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
op_type = "l"
entry_type = ""
entry_size = 0
required = ""
prefix = ""
cmd_to_list_mode = "1"
cmd_to_list = "echo '1 First Option\\n2 Second Option'"
cmd_to_list_postfix = ""
multi_select = ""
value_index = 0
disp_values = ""
values_msg_file = ""
values_msg_set = 0
values_msg_id = 0
aix_values = ""
help_msg_id = ""
help_msg_loc = ""
\#
\# Selector screen and command option to determine second selection
\#
sm_name_hdr:
id = "second_sel_1"
next_id = "first_cmd_"
option_id = "second_sel_1_opt"
has_name_select = ""
name = "Second Selection"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
type = "r"
ghost = "y"
cmd_to_classify = ""
cmd_to_classify_postfix = ""
raw_field_name = "sel2"
cooked_field_name = ""
next_type = "d"
help_msg_id = ""
help_msg_loc = ""
sm_cmd_opt:
id = "second_sel_1_opt"
id_seq_num = "0"
disc_field_name = ""
name = "Choose Second Selection"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
op_type = "l"
entry_type = ""
entry_size = 0
required = ""
prefix = ""
cmd_to_list_mode = "1"
cmd_to_list = "echo 'A Option A\\nB Option B'"
cmd_to_list_postfix = ""
multi_select = ""
value_index = 0
disp_values = ""
values_msg_file = ""
values_msg_set = 0
values_msg_id = 0
aix_values = ""
help_msg_id = ""
help_msg_loc = ""
\#
\# Dialog screen and command options for selection 1, option A
\#
sm_cmd_hdr:
id = "first_cmd_A"
option_id = "first_cmd_A_opt"
has_name_select = "y"
name = "Selection 1 / Option A Screen"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
cmd_to_exec = "example.script"
ask = "n"
exec_mode = "p"
ghost = "n"
cmd_to_discover = ""
cmd_to_discover_postfix = ""
name_size = 0
value_size = 0
help_msg_id = ""
help_msg_loc = ""
sm_cmd_opt:
id = "first_cmd_A_opt"
id_seq_num = "010"
disc_field_name = "sel1"
name = "First Selection"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
op_type = "n"
entry_type = "n"
entry_size = 0
required = "+"
prefix = ""
cmd_to_list_mode = ""
cmd_to_list = ""
cmd_to_list_postfix = ""
multi_select = ""
value_index = 0
disp_values = ""
values_msg_file = ""
values_msg_set = 0
values_msg_id = 0
aix_values = ""
help_msg_id = ""
help_msg_loc = ""
sm_cmd_opt:
id = "first_cmd_A_opt"
id_seq_num = "020"
disc_field_name = "sel2"
name = "Second Selection"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
op_type = "n"
entry_type = "n"
entry_size = 0
required = "+"
prefix = ""
cmd_to_list_mode = ""
cmd_to_list = ""
cmd_to_list_postfix = ""
multi_select = ""
value_index = 0
disp_values = ""
values_msg_file = ""
values_msg_set = 0
values_msg_id = 0
aix_values = ""
help_msg_id = ""
help_msg_loc = ""
Action: Customer would also like to know if there is a way
to take the information from a name selector and use this
information in the command to list on the next name selector
or command header. The way to do this is with the raw or
cooked fields on the sm_name_hdr and the disc_field_name on
the sm_cmd_opt for the next name selector or command header.
Here is the above example with some modifications to
demonstrate this. The arrows indicate the changed lines:
\#
\# Menu option on top_menu called *** TEST MENU ***
\#
sm_menu_opt:
id = "top_menu"
id_seq_num = "098"
next_id = "first_sel"
text = "*** TEST MENU ***"
text_msg_file = ""
text_msg_set = 0
text_msg_id = 0
next_type = "n"
alias = ""
help_msg_id = ""
help_msg_loc = ""
\#
\# Selector screen and command option to determine first selection
\#
sm_name_hdr:
id = "first_sel"
-> next_id = "second_sel_1"
option_id = "first_sel_opt"
has_name_select = ""
name = "First Selection"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
-> type = ""
ghost = "y"
cmd_to_classify = ""
cmd_to_classify_postfix = ""
raw_field_name = "sel1"
cooked_field_name = ""
next_type = "n"
help_msg_id = ""
help_msg_loc = ""
sm_cmd_opt:
id = "first_sel_opt"
id_seq_num = "0"
disc_field_name = ""
name = "Choose First Selection"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
op_type = "l"
entry_type = ""
entry_size = 0
required = ""
prefix = ""
cmd_to_list_mode = "1"
-> cmd_to_list = "echo '/home/guest\\n/home/liz'"
cmd_to_list_postfix = ""
multi_select = ""
value_index = 0
disp_values = ""
values_msg_file = ""
values_msg_set = 0
values_msg_id = 0
aix_values = ""
help_msg_id = ""
help_msg_loc = ""
\#
\# Selector screen and command option to determine second selection
\#
sm_name_hdr:
id = "second_sel_1"
-> next_id = "first_cmd_A"
option_id = "second_sel_1_opt"
has_name_select = ""
name = "Second Selection"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
-> type = ""
ghost = "y"
cmd_to_classify = ""
cmd_to_classify_postfix = ""
raw_field_name = "sel2"
cooked_field_name = ""
next_type = "d"
help_msg_id = ""
help_msg_loc = ""
sm_cmd_opt:
id = "second_sel_1_opt"
id_seq_num = "0"
-> disc_field_name = "sel1"
name = "Choose Second Selection"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
op_type = "l"
entry_type = ""
entry_size = 0
required = ""
prefix = ""
cmd_to_list_mode = "1"
-> cmd_to_list = "ls -1 "
-> cmd_to_list_postfix = "sel1"
multi_select = ""
value_index = 0
disp_values = ""
values_msg_file = ""
values_msg_set = 0
values_msg_id = 0
aix_values = ""
help_msg_id = ""
help_msg_loc = ""
\#
\# Dialog screen and command options for selection 1, option A
\#
sm_cmd_hdr:
id = "first_cmd_A"
option_id = "first_cmd_A_opt"
has_name_select = "y"
name = "Selection 1 / Option A Screen"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
cmd_to_exec = "example.script"
ask = "n"
exec_mode = "p"
ghost = "n"
cmd_to_discover = ""
cmd_to_discover_postfix = ""
name_size = 0
value_size = 0
help_msg_id = ""
help_msg_loc = ""
sm_cmd_opt:
id = "first_cmd_A_opt"
id_seq_num = "010"
disc_field_name = "sel1"
name = "First Selection"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
op_type = "n"
entry_type = "n"
entry_size = 0
required = "+"
prefix = ""
cmd_to_list_mode = ""
cmd_to_list = ""
cmd_to_list_postfix = ""
multi_select = ""
value_index = 0
disp_values = ""
values_msg_file = ""
values_msg_set = 0
values_msg_id = 0
aix_values = ""
help_msg_id = ""
help_msg_loc = ""
sm_cmd_opt:
id = "first_cmd_A_opt"
id_seq_num = "020"
disc_field_name = "sel2"
name = "Second Selection"
name_msg_file = ""
name_msg_set = 0
name_msg_id = 0
op_type = "n"
entry_type = "n"
entry_size = 0
required = "+"
prefix = ""
cmd_to_list_mode = ""
cmd_to_list = ""
cmd_to_list_postfix = ""
multi_select = ""
value_index = 0
disp_values = ""
values_msg_file = ""
values_msg_set = 0
values_msg_id = 0
aix_values = ""
help_msg_id = ""
help_msg_loc = ""
Support Line: smit problem ITEM: AC7742L
Dated: November 1994 Category: N/A
This HTML file was generated 99/06/24~13:30:30
Comments or suggestions?
Contact us