Get Drop-down list API
The below code snippet explains how to get Drop-down list for the given file and parameter and fdtapi.jar, fdtURL - http://<domain>:<port>/fdt/FDTServlet are required to execute.
LOVExecuter lovExecuter = LOVExecuter.getInstance();
lovExecuter.setFdtServletUrl(fdtUrl);
Hashtable retrunHashtable = lovExecuter.getLOVData(hashtable);
The input Hashtable should contain the following mandatory keys with their respective values: file, parameter, fieldFlag
The input Hashtable can also have the following optional keys with their respective values: paramhash, connection
Here is the description about each key:
file - Drop-down list file name which is available in the deployment.
parameter - Name of the Drop-down list parameter which is associated with specific select query.
fieldFlag - Boolean.TRUE / Boolean.FALSE, whether the query uses field names as Bind variables or not. By default it should be Boolean.TRUE.
paramhash - Filtering parameters and their values Hashtable.
connection - Dynamic connection, if the select query should be executed on the given connection instead of configured connection, then set the connection key and it's valid connection name in the hashtable.
The return Hashtable from this API contains the following key and data:
columnVector - This key contains column vector which again contains column names as objects.
dataVector - This key contains data vector which again contains row vector as objects.
invisibleVector - This key contains invisible data vector which again contains row vector as objects, where row vector contains invisible data.
ERROR - This key contains error message in case of failures in the Drop-down execution.
Here is the sample code snipplet to get the respective key values from the return Hashtable from the function:
Vector columnVector = (Vector)retrunHashtable.get("columnVector");
Vector dataVector = (Vector)retrunHashtable.get("dataVector");
Vector invisibleVector = (Vector)retrunHashtable.get("invisibleVector");
String errorMessage = (String)retrunHashtable.get("ERROR");