Apps To Fusion

.......Our Journey from Apps To Fusion

 
  • Increase font size
  • Default font size
  • Decrease font size



MSCA/MWA Java API Documentation – Part2 - FieldBeans

E-mail
User Rating: / 0
PoorBest 

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:

  1. Source for List of values (mostly an SQL query or an PLSQL procedure which returns the query result as REF CURSOR)
  2. The various values associated with each selection(eg,Emp Id, Emp Name, Department, Description)
  3. 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)
  4. Data types of each parameters passed to SQL Query or PLSQL procedure and their values(if we use bind parameters or IN parameters)
  5. An array to get the values associated with the selected value by the user.
  6. 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"
2)HeadingFieldBean 
HeadingFieldBean is the base class for all user developed heading field beans.
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.
The Commonly used APIs:

public void setHeadingType(short)

set the type of headings.
value of this property is either FieldBean.HEADING1 or FieldBean.HEADING2.

public short getAlignment()

return the heading alignment

public void setAlignment(short)

set the heading alignment
value of this property is either HeadingFieldBean.LEFT or HeadingFieldBean.CENTER

3)ListFieldBean 
 ListfieldBean is bean which holds a fixed list of values. In OAF, it is called as poplist. Please see the image below for a List Bean.
The Commonly used APIs:
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
Fig : List Filed Bean in Mobile Applications

 
4) ButtonFieldBean 


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.

 *For those who are familiar with OAF, setNextPageName is something like SetForwardURL()
5)SeparatorFieldBean
SeparatorFieldBean is the base class for all user developed separator field beans.

This class is the bean class for two types of separators: line separator and space separator.
Default type is space separator.
The commonly used API is
public void setSeparatorType(short SEPARATOR) which sets the type of separator. The value of this property is either FieldBean.LINESEPARATOR or FieldBean.SPACESEPARATOR.
*This is similar to OASpacer Bean in OAF.
We will see more in forth coming articles.
For MSCA/OAF consulting kindly contact us at This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Comments (34)add
Error:Unsuccessful row construction
written by Siddhi Dwivedi , May 16, 2009
Hi Senthil,

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
report abuse
vote down
vote up
Votes: +0
...
written by Senthilkumar Shanmugam , May 17, 2009
Hi,

Can you please check why are passing 2 parameter types

String as[] = {
"C", "S"
};
setInputParameterTypes(as);

when your PLSQL proc has only one parameter.

Thanks and Regards,
Senthil
report abuse
vote down
vote up
Votes: +0
...
written by Siddhi Dwivedi , July 02, 2009
Hi Senthil,

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
report abuse
vote down
vote up
Votes: +0
...
written by Senthilkumar Shanmugam , July 02, 2009
Hi Siddi,

How are try to trying to pass the value for selected organization to the second page?

Kindly Clarify.

Thanks and Regards,
Senthil
report abuse
vote down
vote up
Votes: +0
...
written by Siddhi Dwivedi , July 02, 2009
Hi Senthil,

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
report abuse
vote down
vote up
Votes: +0
...
written by Senthilkumar Shanmugam , July 02, 2009
Hi siddi,

I am not sure what you are trying to do in this line of code:
"mParentPage.mOrgCodeFld.setNextPageName("oracle.apps.inv.wshtxn.server.XX2LoadTruckPage");"

is mOrgCodeFld is a button?

Also,

In the java file where you have the following code:

"
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);

"

Are you able to printand see the selected Org ID?

Please use our forum http://apps2fusion.com/forums/viewforum.php?f=145 for MSCA where you option to uplaod files.

Please upload source files and log files for more quick resolution

Thanks and Regards,
Senthil
report abuse
vote down
vote up
Votes: +0
Facing issue in LOV Field
written by Anju , September 24, 2009
Hi Senthil,

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.
report abuse
vote down
vote up
Votes: +0
...
written by Senthilkumar Shanmugam , September 24, 2009
Hi Anju,

Can you please post this into our forum for wider audience?

http://apps2fusion.com/forums/viewforum.php?f=145

Thanks and Regards,
Senthil


report abuse
vote down
vote up
Votes: +0
MCSA - How do you get a page to exit to menu.
written by Phil Woods , April 14, 2010
This must be a really simple thing i'm missing but I'm stuck. I can't see how to pass the user back to the menu after my page has processed the field exit code on my Submit button.

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
report abuse
vote down
vote up
Votes: +0
...
written by Senthilkumar Shanmugam , April 14, 2010
hi Phil,

I guess the following code snipped might help you.

public void exitExited(MWAEvent mwaevent) throws AbortHandlerException,
InterruptedHandlerException,
DefaultOnlyHandlerException {
UtilFns.trace("Summary Exit Pressed");
if (mwaevent.getAction().equals("MWA_SUBMIT")) {
try {

mwaevent.getSession().setStatusMessage(UtilFns.getMessage(mwaevent.getSession(),
"WMS",
"WMS_TXN_CANCEL"));
pg.getExitBtn().setNextPageName("|END_OF_TRANSACTION|");
}
catch (Exception e) {
UtilFns.error("Error !!" + e.toString());
}

}

Thanks and Regards,
Senthil
report abuse
vote down
vote up
Votes: +0
Oracle Apps Consultant
written by Raj2012 , May 18, 2010
Hello Senthil,

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
report abuse
vote down
vote up
Votes: +0
...
written by Senthilkumar Shanmugam , May 19, 2010
Hi Raj,

Please refer to "Development and Deployment" section of my article http://www.apps2fusion.com/at/...-debugging

Feel free to post any queries.

Thanks and Regards,
senthil
report abuse
vote down
vote up
Votes: +0
Simulate Key Strokes during Field Entered
written by Prabhakar K , May 16, 2011
Senthil,
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

report abuse
vote down
vote up
Votes: +0
Differences between MSCA on Oracle EBS Release 12.1.1.1 and 12.1.1.3
written by Nitin K , June 08, 2011
Senthil,
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.
report abuse
vote down
vote up
Votes: +0
Unable to set the Field values on SubInv Transfer Page
written by Aggarwal , June 22, 2011
Hi,

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

report abuse
vote down
vote up
Votes: +0
...
written by Senthilkumar Shanmugam , June 23, 2011
Hi,

In the above code, I am not able to see how you decode the information and set the values to all 3 fields?

Can you please explain in more detail?

Thanks and Regards,
Senthil
report abuse
vote down
vote up
Votes: +0
Method To Default Cursor
written by Phu Tri Nguyen , September 13, 2011
Hello,
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
report abuse
vote down
vote up
Votes: +0
...
written by Phu Tri Nguyen , September 13, 2011
Hi,
This method seems doing the tricks
mwaevent.getSession().setNextFieldName("TEST.HELLO")
Thank you.
PhuTri
report abuse
vote down
vote up
Votes: +0
...
written by Phu Tri Nguyen , September 21, 2011
I'm using ListFieldBean but when call getValue(), it always return the second value in the list (B in this case). What happens? Also, the list always also resets to first item in the list when fieldExited is called. Please help.
Thank
report abuse
vote down
vote up
Votes: +0
...
written by Phu Tri Nguyen , September 21, 2011
Hi,
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
report abuse
vote down
vote up
Votes: +0
...
written by Senthilkumar Shanmugam , September 21, 2011
You can easily achieve this. Can you please cut-paste your source code? so that we can have a look of what you have done in fieldExited()

Thanks and Regards,
Senthil
report abuse
vote down
vote up
Votes: +0
...
written by Phu Tri Nguyen , September 22, 2011
public void fieldExited(MWAEvent mwaevent) throws AbortHandlerException, InterruptedHandlerException, DefaultOnlyHandlerException {
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;
}

report abuse
vote down
vote up
Votes: +0
...
written by Phu Tri Nguyen , September 22, 2011
// validate Picking List
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(smilies/cool.gif; // 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;
}


report abuse
vote down
vote up
Votes: +0
...
written by Phu Tri Nguyen , September 22, 2011
// validate Quantity
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(smilies/cool.gif; // 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;
}

report abuse
vote down
vote up
Votes: +0
...
written by Senthilkumar Shanmugam , September 22, 2011
Hi,

You code looks fine for me. Can you explain your problem in a brief manner so that I can take a deep look?

Thanks and Regards,
Senthil
report abuse
vote down
vote up
Votes: +0
...
written by Phu Tri Nguyen , September 22, 2011
Hi,
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
report abuse
vote down
vote up
Votes: +0
...
written by Senthilkumar Shanmugam , September 22, 2011
Hi,

Do you want to skip the fields in all scenarios or only in particular scenario? Did you try setting the focus of the cursor to the last field programatically? what is the behaviour?

Kindly clarify.

Thanks and Regards,
Senthil
report abuse
vote down
vote up
Votes: +0
...
written by Phu Tri Nguyen , September 22, 2011
During the data entry process, the cursor lands in the Lot Code field. When user click on the Cancel button, I want the Cancel button to be execute. Here is the layout sequence for the fields in the form
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

report abuse
vote down
vote up
Votes: +0
...
written by Senthilkumar Shanmugam , September 23, 2011
Hi,

In the mobile device how does the user jump from Lot code field to Cancel button?

There are APIs for enabling and disabling Button beans. setHidden(Boolean) should work i guess.

Thanks and Regards,
Senthil
report abuse
vote down
vote up
Votes: +0
...
written by Phu Tri Nguyen , September 23, 2011
Hi,
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
report abuse
vote down
vote up
Votes: +0
...
written by Senthilkumar Shanmugam , September 26, 2011
As far as I know, fields are sequentially processed unless if you scan the barcode and populate the fields.

Yes you can use setHidden API to enable any of the buttons based on your condition.

Thanks and Regards,
Senthil
report abuse
vote down
vote up
Votes: +0
How to invoke a page on fieldexit
written by Kranthi Kiran , February 12, 2012
Hi Senthil,

Thanks for the great articles. I have a question. We have a requirement of removing some fields in Lot Page which gets invoked on pressing enter key of Lot LOV field after generating a lot by using ctrl+G(PO Page). We are not able to get the connection between these two pages. How can we invoke a page on fieldExit/Enter button? I am not able to find a method like setNextPageName. Quite puzzling as I am very new to MSCA.

Thanks a lot in advance.

-Kranthi
report abuse
vote down
vote up
Votes: +0
Instance name or Database or hose name
written by mkrupun , March 15, 2012
Hi

My custom page how to display the Instance name or dabase name or site name .
String username= (session.getObject("USERNAME")).toString();
this.setPrompt("ABCR-Entry :- " +username);
Currently i'm able to display Page name and user name.

Please help
report abuse
vote down
vote up
Votes: +0
GoBack to Main Menu
written by Harman , April 10, 2012
Hi,

I tried to create a login on your forums to post this message but I am not receiving any email for activation of the account, so I am posting this message here.

I have created a new mobile form and everything is working fine so far, thanks to your wonderful tutorials. Just one thing has me stumped:

1. If a user clicks the "Cancel" button, how do I cancel the transaction and make the user go back to the Main Menu ?
OR
2. If the user clicks the "Start Over" button, how do I reload the mobile form in its initial state?

I would appreciate it if anyone can help me with this.

Thanks!
H


report abuse
vote down
vote up
Votes: +0
Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

security image
Write the displayed characters


busy
Last Updated ( Thursday, 12 January 2012 07:29 )