In this article we will discuss more about the FieldBean. Filed Beans are the beans which are displayed in the Mobile Forms on which the user performs operations.
The type of fields supported are:
- Text
- LOV
- List
- Button
- Heading1
- Heading2
- Line Separator
- Space Separator
Class Diagram
1)InputableFieldBean
InputableFieldBean is the base class for all user developed field beans which has a value property to be inputable during "runtime".
This class is the super class for Text field, Read only Text field, LOV field.
The Commonly used APIs:
public void setEditable(boolean) | Set whether the filed is read only or not. |
public void setRequired(boolean Required) | Mandatory or not. |
public void setAlter(java.lang.String) | This is used to alter the case of the values entered by the user. For eg setAlter("U") makes the user input to Upper Case after the user types in the value. |
public java.lang.String getValue() | Get the value entered by the user |
public void setValue(java.lang.String)
| Set the value in the field |
public void setBarcodeDelimiter(char)
| Set data stream delimiter |
public int getBarcodeDelimiter() | Get data stream delimiter |
public void setDFIs(java.lang.String[] )
| Set The DFI - Data Field Indicator |
public java.lang.String[] getDFIs() | Get the DFI |
public void setDFIRequired(boolean) | Set the DFI required flag |
As indicated in the class diagram, Inputable beans have Text Field Bean and LOV field Bean as most commonly used subclasses.
We will now get into the details of each of them.
LOVFieldBean
LOV is commonly used component in Oracle Applications. It provides the user with list of values and user has to choose one of them.
The common requirements which are required for constructing a LOV are:
Source for List of values (mostly an SQL query or an PLSQL procedure which returns the query result as REF CURSOR) The various values associated with each selection(eg,Emp Id, Emp Name, Department, Description) The values displayed in the UI and values used in background(eg Usually Emp Name is displayed in the screen, not the Emp Id. But we get the Emp Id of selected Emp Name and use it for further processing) Data types of each parameters passed to SQL Query or PLSQL procedure and their values(if we use bind parameters or IN parameters) An array to get the values associated with the selected value by the user. Criteria for validation check to be performed, if the user manually enters the value in the LOV field rather than selecting one by clicking "torch lite" icon, we can either validate it via an API or accept is just like that.
The various API used to achieve the above is as follows:
public java.lang.String getlovStatement()get SQL query or PL/SQL procedure with a reference cursor output parameter.
public void setlovStatement(java.lang.String)set SQL query or PL/SQL procedure with a reference cursor output parameter.
public java.lang.String[] getSubfieldNames()get unique names of subfields of each value
public void setSubfieldNames(java.lang.String[])set key names of subfields.
public java.lang.String[] getSubfieldPrompts()get prompts of subfields.
public void setSubfieldPrompts(java.lang.String[])set prompts of subfields.
public boolean[] getSubfieldDisplays()get display properties of subfields.
public void setSubfieldDisplays(boolean[])set display properties of subfields.(This controls which values are displyed in UI. For eg, Empid is usullay not displayed in UI though it is a part of the LOV)
public java.lang.String[] getInputParameterTypes()get parameter data type list.
publicvoid setInputParameterTypes(java.lang.String[])set parameter data type list.
public java.lang.String[] getInputParameters()get input parameter list.
public void setInputParameters(java.lang.String[])set input parameter list.
public void setSelectedValues(java.util.Vector)sets the return vector public java.util.Vector getSelectedValues()obtain a vector of String values for the chosen LOV
public void setValue(java.lang.String)when we setValue we also have to clear the subfield values for this bean. public void setValidateFromLOV(boolean)set the validateFromLOV property. (Default is true)
For code snippet of how to create an LOV, one can refer my previous article "Hello World in Mobile Applications"
TextFieldBean
Text Field is a common means of data input to mobile applications either via scanning a value or by manually typing in to it.This can also be used to display some values by making this field as read only so that user cant edit or enter any value into this field.
The Commonly used API used specific to Text filed is
public void setIsPassword(boolean IsPassword)indicate the field to store a password.
Most other common APIs are available in the super class "InputableFieldBean"
This class is the bean class for two types of headings: HEADING1 and HEADING2.
Default heading type is HEADING1. Heading Field is mainly used to set Titles for each regions of a Mobile page.
public void setHeadingType(short) | set the type of headings. |
public short getAlignment() | return the heading alignment |
public void setAlignment(short) | set the heading alignment |
public java.lang.String getValue() | get field value. |
public void setValue(java.lang.String Value) | set field value. |
public java.lang.String getListSource() | get list of options with each option separated by comma. |
public void setListSource(java.lang.String) | set list of options with each option separated by comma. |
public void setListSource(java.util.Vector) | set list of options via a vector |
ButtonFieldBean is the base class for all user developed button field beans.
This class is the bean class for button.
The Commonly used APIs:
public java.lang.String getNextPageName() | get block name of the block to be navigated after button is pressed. |
public void setNextPageName(java.lang.String) | set block name of the block to be navigated after button is pressed. |
This class is the bean class for two types of separators: line separator and space separator.
Default type is space separator.
written by Siddhi Dwivedi , July 02, 2009
I am trying to create a new WMS screen which will be accessible to only three orgs.
I am able to populate LOV for three orgs at 'Select Organization' screen but not able to pass organization value to load the next page.
Please help me to implement this change.
Thnaks & Regards,
Siddhi
written by Siddhi Dwivedi , July 02, 2009
Below are the steps which I am implementing to develop the new org specific screen.
1)Menu calls function 'XX2LoadTruckFunction.class' which inturn calls a 'XXValidOrgPage.class' to load select organization screen.
public XX2LoadTruckFunction()
{
setFirstPageName("oracle.apps.inv.wshtxn.server.XXValidOrgPage");
//addListener(this);
}
2) XXValidOrgPage populates org LOV which selects organization code and after selecting org code 'XXValidOrgFListener.class' class
should load next page 'XX2LoadTruckPage.class' for that particular organization code.
public class XXValidOrgFListener
implements MWAFieldListener
{
public XXValidOrgFListener(XXValidOrgPage validorgpage)
{
mParentPage = validorgpage;
}
public void fieldEntered(MWAEvent mwaevent)
throws AbortHandlerException, InterruptedHandlerException, DefaultOnlyHandlerException
{
}
public void fieldExited(MWAEvent mwaevent)
throws AbortHandlerException, InterruptedHandlerException, DefaultOnlyHandlerException
{
UtilFns.log("Siddhi into Valid Org Listener class");
Session session = mwaevent.getSession();
session.getConnection();
if(((FieldBean)mwaevent.getSource()).getName().equals("OrgInfo.ORGID"))
{
if ((mParentPage.getValidOrg().getValue() != null) ) {
mParentPage.mOrgCodeFld.setNextPageName("oracle.apps.inv.wshtxn.server.XX2LoadTruckPage");
}
}
}
public static final String RCS_ID = "$Header: XXValidOrgFListener.java 115.5 2003/01/29 15:53:15 sansari ship $";
public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header: XXValidOrgFListener.java 115.5 2003/01/29 15:53:15 sansari ship $", "oracle.apps.inv.wshtxn.server");
XXValidOrgPage mParentPage;
}
But I am not able to set parameter for ORG Code in next page and getting 'Unsuccessful row construction' error and not able to load the next page
mDockDoorFld = new DockDoorLOV();
mDockDoorFld.setName("LoadTruck.DockDoor");
mDockDoorFld.setValidateFromLOV(true);
mDockDoorFld.setRequired(true);
String as[] = {
" ", " ", "ORGID", "oracle.apps.inv.wshtxn.server.XX2LoadTruckPage.LoadTruck.DockDoor"
};
mDockDoorFld.setInputParameters(as);
mDockDoorFld.addListener(fListener);
Please let me know in case you want more info.
Thnaks & Regards,
Siddhi
written by Anju , September 24, 2009
Requirement is to add a new LOV field in a Page.
LOV field is created successfully.
The List of values get displayed when we hit enter and CTRL L on the LOV field.
Please guide me on how to prevent displaying the LOV when Enter button is hit.
Thanks,
Anju.






I am getting 'Unsuccessful row construction' error while creating a LOV.
Below is my code:
PROCEDURE XXBR_VOLUME_TYPE(x_vol_type_lov OUTNOCOPY t_genref)IS
BEGIN
OPEN x_vol_type_lov FOR
SELECT LOOKUP_CODE
FROM FND_LOOKUP_VALUES
WHERE LOOKUP_TYPE = 'BRA-EMBALAGEM-EXPORTACAO'
AND LANGUAGE = USERENV('LANG')
AND NVL(END_DATE_ACTIVE, SYSDATE) >= SYSDATE
AND ENABLED_FLAG = 'Y';
EXCEPTION
WHEN OTHERS THEN
null;
--OPEN x_vol_type_lov FOR
-- SELECT null,null
--from dual;
END XXBR_VOLUME_TYPE;
----------------------------------------------------------------------------------------------
public XXVolumeTypeLOV()
{
try{
UtilFns.log("Siddhi3 in XXVolumeTypeLOV");
mLOVType = "DeliveryInfo.VolumeType";
setName("DeliveryInfo.VolumeType");
UtilFns.log("Siddhi33 in XXVolumeTypeLOV");
setRequired(false);
setValidateFromLOV(true);
setHidden(true);
UtilFns.log("Siddhi333 in XXVolumeTypeLOV");
setlovStatement("XXBR8234_VOL_INF_ENTRY.XXBR_VOLUME_TYPE");
UtilFns.log("Siddhi3333 in XXVolumeTypeLOV "+setlovStatement("XXBR8234_VOL_INF_ENTRY.XXBR_VOLUME_TYPE"));
String as[] = {
"C", "S"
};
boolean aflag[] = {
true
};
setInputParameterTypes(as);
String as1[] = {
"a"
};
setSubfieldPrompts(as1);
setSubfieldDisplays(aflag);
addListener(this);
UtilFns.log("Siddhi33333 in XXVolumeTypeLOV");
}catch(Exception e){
UtilFns.error("Siddhi Error in calling Volume Type LOV" + e);
}
Please help me to fix the issue.Thanks in advance....
Regards,
Siddhi