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.
set the type of headings. return the heading alignment set the heading alignment get field value. set field value. get list of options with each option separated by comma. set list of options with each option separated by comma.
value of this property is either FieldBean.HEADING1 or FieldBean.HEADING2.
value of this property is either HeadingFieldBean.LEFT or HeadingFieldBean.CENTERset 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.
written by Phil Woods , April 14, 2010
I've used your guide pages to help me and they have been really helpful - in fact just about the only help found anywhere.
Any ideas?
Phil
written by Raj2012 , May 18, 2010
Your articles are soo useful. Very nice. I am very much thankful to you.
I am really new to this Oracle Apps area, though I have lots of experience in Java and J2EE.
Can you please help me to deploy the custom application into MWA?
please provide us a simple steps to follow and deploy.
I have created function, page and listener classes, compiled and everything is ready to be deployed. But I really dont know, what is the procedure and where can I find the information.
Please help me.
Thanks,
Raj
written by Prabhakar K , May 16, 2011
The customer wants to default certain field on entering the screen. There are certail fields like the Drop Door LOV which they want to be populated the moment they enter the field. Even certain LPN they want to generate the moment they enter the field (Simulate Ctrl + G). Is there a way to do this in MWA ?
Thanks for your help!!
Regards,
prabhakar
written by Nitin K , June 08, 2011
Are there any differences in MSCA in Release 12.1.1.3 compared to 12.1.1.1? I need to get 12.1.1.3 MSCA installed on my local apps server. My current version of Apps on my local server is 12.1.1. 1.
Regards,
Nitin.
written by Aggarwal , June 22, 2011
I am facing an issue in MWA for setting up the field values on SubInv Transfer page,the requirement is we scan the barcode value on the QTY field and we need to trim the QTY,LOT and LOTQTY field from the scanned barcode and populate the QTY,LOT and LOTQTY values in the appropriate fields, I am able to successfully populate for the QTY field not for the LOT and LOTQTY fields (below is the piece of code which I am using to set the values).
Code
++++++
if (lotQtyFieldName!= null && lotQtyFieldName.equals("INV.LOTQTY"))
{
FileLogger.getSystemLogger().trace("CTM: Inside IF Fields Name :LOT Qty"+lotQtyFieldName);
FieldBean LOTQTYField = ((FieldBean) (fieldBeanList.elementAt (lotQtyFieldIndex)));
((InputableFieldBean)LOTQTYField).setValue(lotQtyValue2);
}
++++++++
Please let me know whether do I missing anything before I set the values or is there any setup needs to be done for this.
Thanks
written by Phu Tri Nguyen , September 13, 2011
What is a method to move cursor from one field to next? I follow the HelloWorld example and able to make it work and a call to PLSQL procedure for update/insert data into a database. Now I want the cursor to move back to the text field for more inputs but I cannot do this so far. I could not find any documents anywhere (let me know if you know where).
Thank you
PhuTri
written by Phu Tri Nguyen , September 13, 2011
This method seems doing the tricks
mwaevent.getSession().setNextFieldName("TEST.HELLO")
Thank you.
PhuTri
written by Phu Tri Nguyen , September 21, 2011
Thank
written by Phu Tri Nguyen , September 21, 2011
All my field validations are in fieldExited function. My listbean is at the bottom of all beans, so when I click or choose anyting from the listbean, all above fields get validated firs. I think this causes the problem. I want to seperate the validation field by field, not using the common function (fieldExited) which causes too much problem for me. How do I do this?
Thank
written by Phu Tri Nguyen , September 22, 2011
String sStatus, sValue, sOrgCode, sPickList, sLot, sQty;
String sAll, sItem, sSQty, sMsg, sDoc;
String sFldName;
Vector oFieldBeanList;
Connection oConn;
CallableStatement oCStmt = null;
sFldName = ((FieldBean)mwaevent.getSource()).getName();
// Prints the Current Bean's ID
if (UtilFns.isTraceOn)
UtilFns.trace("CustomFListener:fieldExited:fldName = " + sFldName);
// Get handle to session and page
oSes = mwaevent.getSession();
oPage = (PickQCPage)oSes.getCurrentPage();
// get additional field values
oFieldBeanList = oPage.getFieldBeanList();
sOrgCode = ((TextFieldBean)(oFieldBeanList.elementAt(0))).getValue(); // org code
sPickList = ((TextFieldBean)(oFieldBeanList.elementAt(1))).getValue(); // picking list
sLot = ((TextFieldBean)(oFieldBeanList.elementAt(2))).getValue(); // lot code
sDoc = ((ListFieldBean)(oFieldBeanList.elementAt(7))).getValue(); // doc
UtilFns.trace("sOrgCode " + sOrgCode);
UtilFns.trace("sPickList " + sPickList);
UtilFns.trace("sLot " + sLot);
UtilFns.trace("sDoc " + sDoc);
// cancel button
UtilFns.trace("At Cancel");
UtilFns.trace(sFldName);
if (sFldName.equals("XXC.PICKQC.CANCEL")) {
UtilFns.trace("In Cancel");
try {
oConn = oSes.getConnection();
oCStmt = oConn.prepareCall("{call XXC_MOB_QUICKQC_PKG.CANCEL_VALIDATE(?,?,?)}");
oCStmt.setString(1,sOrgCode);
oCStmt.setString(2,sPickList);
oCStmt.registerOutParameter(3,java.sql.Types.VARCHAR);
oCStmt.execute();
sStatus = oCStmt.getString(3); // get output parameter
UtilFns.trace(" Status " + sStatus);
oCStmt.close();
if (sStatus.equals("S")) {
oSes.setNextFieldName("XXC.PICKQC.PICKLISTNO");
}
else {
((TextFieldBean)(oFieldBeanList.elementAt(6))).setValue("Cannot cancel Quick QC"); // message
// beep to alert user
NegativeSound(oSes);
// stay at current field
oSes.setNextFieldName(sFldName);
}
} catch (Exception e) {
NegativeSound(oSes);
if (UtilFns.isTraceOn)
UtilFns.trace(e.toString());
}
return;
}
// validate doc
if (sFldName.equals("XXC.PICKQC.DOC")) {
return;
}
// get current field value
sValue = ((TextFieldBean)mwaevent.getSource()).getValue();
UtilFns.trace("Value " + sValue);
// validate Org Code
if (sFldName.equals("XXC.PICKQC.ORGCODE")) {
try {
oConn = oSes.getConnection();
oCStmt = oConn.prepareCall("{call XXC_MOB_QUICKQC_PKG.ORG_VALIDATE(?,?)}");
oCStmt.setString(1,sValue);
oCStmt.registerOutParameter(2,java.sql.Types.VARCHAR);
oCStmt.execute();
sStatus = oCStmt.getString(2); // get output parameter
UtilFns.trace(" Status " + sStatus);
oCStmt.close();
((TextFieldBean)(oFieldBeanList.elementAt(6))).setValue(""); // message
if (sStatus.equals("S")) {
// do nothing
//mTextBean.setValue("");
}
else {
((TextFieldBean)(oFieldBeanList.elementAt(6))).setValue("Invalid Org"); // message
// beep to alert user
NegativeSound(oSes);
// stay at current field
oSes.setNextFieldName(sFldName);
}
} catch (Exception e) {
NegativeSound(oSes);
oSes.setNextFieldName(sFldName);
if (UtilFns.isTraceOn)
UtilFns.trace(e.toString());
}
return;
}
written by Phu Tri Nguyen , September 22, 2011
if (sFldName.equals("XXC.PICKQC.PICKLISTNO")) {
try {
oConn = oSes.getConnection();
oCStmt = oConn.prepareCall("{call XXC_MOB_QUICKQC_PKG.PICKLIST_VALIDATE(?,?,?)}");
oCStmt.setString(1,sOrgCode);
oCStmt.setString(2,sValue);
oCStmt.registerOutParameter(3,java.sql.Types.VARCHAR); // status
oCStmt.execute();
sStatus = oCStmt.getString(3); // get output parameter
UtilFns.trace(" Status " + sStatus);
oCStmt.close();
if (sStatus.equals("S")) {
// do nothing
//mTextBean.setValue("");
}
else {
((TextFieldBean)(oFieldBeanList.elementAt(6))).setValue("Invalid Picklist"); // message
// beep to alert user
NegativeSound(oSes);
// stay at current field
oSes.setNextFieldName(sFldName);
}
} catch (Exception e) {
NegativeSound(oSes);
oSes.setNextFieldName(sFldName);
if (UtilFns.isTraceOn)
UtilFns.trace(e.toString());
}
return;
}
// validate Lot
if (sFldName.equals("XXC.PICKQC.LOTNO") && sValue != "") {
UtilFns.trace("Inside Lot");
try {
oConn = oSes.getConnection();
oCStmt = oConn.prepareCall("{call XXC_MOB_QUICKQC_PKG.LOT_VALIDATE(?,?,?,?,?,?,?,?,?,?)}");
oCStmt.setString(1,sOrgCode);
oCStmt.setString(2,sPickList);
oCStmt.setString(3,sValue);
oCStmt.registerOutParameter(4,java.sql.Types.VARCHAR); // lot number
oCStmt.registerOutParameter(5,java.sql.Types.VARCHAR); // lot quantity
oCStmt.registerOutParameter(6,java.sql.Types.VARCHAR); // All scanned
oCStmt.registerOutParameter(7,java.sql.Types.VARCHAR); // status
oCStmt.registerOutParameter(8,java.sql.Types.VARCHAR); // last scan - Item
oCStmt.registerOutParameter(9,java.sql.Types.VARCHAR); // last scan - Quantity
oCStmt.registerOutParameter(10,java.sql.Types.VARCHAR); // message
oCStmt.execute();
sLot = oCStmt.getString(4); // lot number
sQty = oCStmt.getString(5); // lot quantity
sAll = oCStmt.getString(6); // All scanned
sStatus = oCStmt.getString(7); // status
sItem = oCStmt.getString(
; // last scan - Item sSQty = oCStmt.getString(9); // last scan - Quantity
sMsg = oCStmt.getString(10); // message
UtilFns.trace(" Status " + sStatus);
UtilFns.trace(" Lot " + sLot);
UtilFns.trace(" Qty " + sQty);
UtilFns.trace(" Item " + sItem);
UtilFns.trace(" SQty " + sSQty);
UtilFns.trace(" sMsg " + sMsg);
UtilFns.trace(" sAll " + sAll);
oCStmt.close();
((TextFieldBean)(oFieldBeanList.elementAt(6))).setValue(sMsg); // message
if (sStatus.equals("S")) {
// set lot and scanned values
((TextFieldBean)mwaevent.getSource()).setValue(sLot); // lot number
if (sQty.equals("0")) {
// do nothing, cusor will move to next field
}
else {
// if the picklist is fully scan, then clear everything and return picklist field
if (sAll.equals("Y")) {
oSes.setNextFieldName("XXC.PICKQC.PICKLISTNO");
return;
}
// if the lot is processed along with quantity, then clear quantity and return to lot field
if (sAll.equals("N")) {
oSes.setNextFieldName(sFldName);
return;
}
}
}
else {
// beep to alert user
NegativeSound(oSes);
// stay at current field
oSes.setNextFieldName(sFldName);
}
} catch (Exception e) {
NegativeSound(oSes);
oSes.setNextFieldName(sFldName);
if (UtilFns.isTraceOn)
UtilFns.trace(e.toString());
}
return;
}
written by Phu Tri Nguyen , September 22, 2011
if (sFldName.equals("XXC.PICKQC.LOTQTY") && sValue != "") {
try {
oConn = oSes.getConnection();
oCStmt = oConn.prepareCall("{call XXC_MOB_QUICKQC_PKG.QTY_VALIDATE(?,?,?,?,?,?,?,?,?)}");
oCStmt.setString(1,sOrgCode);
oCStmt.setString(2,sPickList);
oCStmt.setString(3,sLot);
oCStmt.setString(4,sValue);
oCStmt.registerOutParameter(5,java.sql.Types.VARCHAR); // All scanned
oCStmt.registerOutParameter(6,java.sql.Types.VARCHAR); // status
oCStmt.registerOutParameter(7,java.sql.Types.VARCHAR); // last scan - Item
oCStmt.registerOutParameter(8,java.sql.Types.VARCHAR); // last scan - Quantity
oCStmt.registerOutParameter(9,java.sql.Types.VARCHAR); // message
oCStmt.execute();
sAll = oCStmt.getString(5); // All scanned
sStatus = oCStmt.getString(6); // status
sItem = oCStmt.getString(7); // last scan - Item
sSQty = oCStmt.getString(
; // last scan - Quantity sMsg = oCStmt.getString(9); // message
UtilFns.trace(" Status " + sStatus);
UtilFns.trace(" Item " + sItem);
UtilFns.trace(" SQty " + sSQty);
UtilFns.trace(" sMsg " + sMsg);
UtilFns.trace(" sAll " + sAll);
oCStmt.close();
((TextFieldBean)(oFieldBeanList.elementAt(6))).setValue(sMsg); // message
if (sStatus.equals("S")) {
// if the picklist is fully scan, then clear everything and return picklist field
if (sAll.equals("Y")) {
oSes.setNextFieldName("XXC.PICKQC.PICKLISTNO");
return;
}
// if the lot is processed along with quantity, then clear quantity and return to lot field
if (sAll.equals("N")) {
oSes.setNextFieldName("XXC.PICKQC.LOTNO");
return;
}
}
else {
// beep to alert user
NegativeSound(oSes);
// stay at current field
oSes.setNextFieldName("XXC.PICKQC.LOTNO");
}
} catch (Exception e) {
NegativeSound(oSes);
oSes.setNextFieldName(sFldName);
if (UtilFns.isTraceOn)
UtilFns.trace(e.toString());
}
return;
}
return;
}
written by Phu Tri Nguyen , September 22, 2011
I cannot move the cursor to the last field without haivng the code to perform fieldExited for all the fields above it. In the form, I have fields Org Code, Pick List, Lot, Quantity, Doc, Cancel button. If I select something from Doc field while my cursor is at Pick List field, I can see that the system perform fieldExited for Pick List, Lot, Quantity field. The system should only perform the filedExited function only for Pick List field.
Now I add another button before Cancel. Now I have Transact and Cancel buttons. When I click on Cancel button, again, the system execute fieldExited for Transact button first, then Cancel button.
How do I control the flow?
Thank
written by Phu Tri Nguyen , September 22, 2011
Org Code
Pick List
Lot Code
Quantity
Transact Button
Cancel Button
So when I click the Cancel button while the cursor is at Lot Code filed, the validation (or fieldExited function) is executed for Lot Code, then Quantity, then Transact Button, then Cancel Button. By the time, the fledExited function is executed for Cancel Button, it's too late.
Also, how do I disable and enable the ButtonFieldBean?
Thank
written by Phu Tri Nguyen , September 23, 2011
Does it mean the fields are sequentially processed in Mobile? And yes, setHidden method works. Curently, I have to to toggle Transact and Cancel button and one can only be present at a time. Is there anyway to disable a button?
Thank you for help.
PhuTri






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