Apps To Fusion

.......contents copyright protected by FocusThread UK Ltd

 
  • Increase font size
  • Default font size
  • Decrease font size
We are glad to announce the launch of Forum for Customizations and Extensions. Click here to visit http://apps2fusion.com/forums
Our OA Framework, BPEL Development & Apps DBA Trainings from USD 299 only [on weekends] . Click here for details.
Also see here fully verifiable feedbacks/testimonials


MSCA/MWA Java API Documentation – Part2 - FieldBeans

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.
Comments (8)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
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
 

Related Items

Search apps2fusion