Iform Java Custom Coding APIs
Iform Java Custom Coding APIs
In order to call java APIs in your customclass.java or IFormListener.java/processname.java you have to use
objReference object provided in executeServerEvent(customclass.java) and in
getClassInstance(IFormListener.java/processname.java) function.
Ex :
objReference.getDataFromDB(“select username from PDBUser where userindex=10”);
In above API call we will pass first parameter store procedure name as string and in second
parameter we will pass a arrayList object containing the parameters for the stored procedure.
For example :
For example , if procedure expects two parameters of type Integer, Text .
Parameter list will contain datatype and value both .DataType and value will be
colon (:) separated .
In this case paramlist would be like as follows:
List<String> paramlist =new Arraylist<String>( );
paramlist . add ("Integer : 10");
paramlist . add ("Text : John");
Note:
1) In above example we have seen the second parameter to API is an
arrayList object. This arrayList object will have a list of parameters
each of those parameter will be colon(:) separated from its Data Type as
show above while preparing arrayList object.
2) In case, procedure expects no parameter , pParamList will be empty.
3) supported parameter dataTypes are (Integer,Text,Float) .
This API is used to get value of primitive controls like textbox,combobox,listbox etc.
Parameters:
1. controlId: ControlID of the control.
Return Value:
This function by default will return a object.
For listbox you have to cast the return value of this API to JSONArray.
Ex: (JSONArray)ifr.getValue("listbox")
The return value is a JSONArray of strings.
For all other controls you have to cast the return value to String.
Ex: (String)ifr.getValue("textbox")
The return value is a string.
If control inside advanced listview is a listbox, then the value will be a JSONArray with
JSONArray containing strings.
Parameters:
1. controlId: HTML ID of the iform control.
2. attributeName: This can take the values : “disable”,”visible”,“mandatory” and
“custompattern”.
3. attributeValue: Set this to “true” or “false”
In case of “custompattern” set this to 'pattern' where pattern can be- For eg-
“[0-9]”
Return Value:
None
28. removeItemFromCombo(comboId,optionIndex)
This API is used to remove Item from combo control.
Parameters:
1. comboId: ControlID of the combo control.
2. optionIndex : index of the item to be removed.
Example:
removeItemFromCombo(“combo1”,2);
29. clearCombo(comboId)
This API is used to clear items from combo control.
Parameters:
1. comboId: ControlID of the combo control.
Example:
clearCombo(“combo1”);