5.5.2 getParamValue method
This method acquires the cache value of the specified parameter from the Map object stored in the argument param of the I/O Plugin method.
If the connected Guide Parts are radio buttons, check boxes, or hyperlinks, you can specify whether to acquire the entire cached value including the label portion of it or the cached value without the label portion.
- Organization of this subsection
(1) Format
Format 1
public static String getParamValue(Map<String, Object> param, String paramName);
Format 2
public static String getParamValue(Map<String, Object> param, String paramName, boolean withLabel);
(2) Arguments
(a) param
This argument specifies the Map object to be passed to the second argument (param) of the inputFromNode method.
(b) paramName
This argument specifies the name of the parameter for which to acquire a cached value.
(c) withLabel
This argument specifies whether to acquire the entire cached value, including the label, for the parameter. Note that, if you use this method with Format 1, it is assumed that this argument is set to false.
-
true
The entire value including the label is returned as is.
-
false
Depending on the type of the connected Guide Part, one of the values shown in the following table is returned.
Table 5‒11: Types of Guide Parts and the corresponding values to be acquired No.
Guide Part type
Value to be acquired
1
Static text
Cached value
2
Image
Cached value
3
Text box
Cached value
4
Text area
Cached value
5
Radio button
- If the Store label information too. check box is selected:
Cached value
- If the Store label information too. check box is not selected:
Cached value from which the label portion (from the beginning of the value to the linefeed code (\r\n)) has been removed
6
Check box
- If the Store label information too. check box is selected:
Cached value
- If the Store label information too. check box is not selected:
Cached value from which the label portion (from the beginning of the value to the linefeed code (\r\n)) has been removed
7
Drop down
Cached value
8
Hyperlink
Cached value from which the label portion (from the beginning of the value to the linefeed code (\r\n)) has been removed
9
Inline frame
Cached value
(3) Return values
The cached value for the specified parameter is returned.
(4) Exception
None
(5) Example
The example provided here describes how to use the getParamValue method within the execute method by using a sample I/O Plugin.
For details about sample I/O Plugins, see A.1 How to use I/O Plugins (sample).
Preconditions for the I/O Plugin and guide parts
-
Connect from radio button 1 (label: Label1, value: Value1), radio button 2 (label: Label2, value: Value2), and radio button 3 (label: Label3, value: Value3) to the input parameter inputItemName1 of the I/O Plugin.
-
Connect from the check box (label: CheckboxLabel, value: true or false) to the input parameter inputItemName2 of the I/O Plugin.
Processing overview
-
Acquire the Map object by using the inputFromNode method.
-
Acquire the values of radio buttons 1 to 3 with the label removed from them.
-
Acquire the value of the check box, including the label.
Implementation example
public Map<String, Object> inputFromNode(HttpSession session, Map<String, Object> param) { Map<String, Object> map = new HashMap<String, Object>(); // Acquire the value without the label radioButtonValue = ParamConvertUtil.getParamValue(param, "inputItemName1"); // Acquire the value including the label checkBoxValue = ParamConvertUtil.getParamValue(param, "inputItemName2", true); return map; }