Items in OAF
There so many item styles in the OAF to display the
data now we will discuss some of the
most frequently used item styles.
Create one project and create one page under this
page create one region.
messageTextInput
Item:-
Message text
input item will used to enter values. There the user can enter the details.
For
example email,password etc.
First create two items
and select the item and go to property inspector set item style as messageTextInput.
To make the fields
mandatory in the property inspector set showRequired
to TRUE.
To make the texts in
disable mode like we write the passwords in property inspector set the secret to TRUE.
If u want u can change
the CSS style also.
Run the page to get the
output.
messageStyledText:-
To
display the data in a read only format use the message style text item.
Create
the item select the item style as messageStyleText
in the property inspector.
Run the page to get the
output.
messageCheckBox
Item:-
Create the item select the item style as messageCheckBox in the property
inspector.
For
messageCheckBox item we have to set some default properties.
Initial Value:- Y (By default if u want
to check the check box give the value Y).
Checked Value:-ONE(By default which
check box u want to check give that value).
Unchecked Value:-TWO(By
default which check box u want to uncheck give that
value).
Initially Checked:-TRUE (By default if
u want to check set the value to true).
Run the page to get the
output.
messageRadioButton
Item:-
Create the item select the item style as messageRedioButton in the property
inspector.
We can create and check
all the radio buttons .
To check the single
value we have to create one group for all the radio buttons programmatically.
For this first we have
to create the controller.
Right click on main
region and select set new controller.
Give
the name for the controller.
By default in package
we will get two webui just remove one
webui.
After this it will open
the controller and write the code their.
/*For Copy Paste*/
public void
processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
//To
retrive the radio buttons
OAMessageRadioButtonBean
mrb=(OAMessageRadioButtonBean)webBean.findChildRecursive("MRB1");
/*set
the group name for the radio buttons.*/
mrb.setName("Gender");
/*set
the value for particular radio button.*/
mrb.setValue("male");
OAMessageRadioButtonBean
mrb3=(OAMessageRadioButtonBean)webBean.findChildRecursive("MRB2");
mrb3.setName("Gender");
mrb3.setValue("female");
}
Then run the Page to get the output.
messageChoice
Item:-
Create the item select the item style as messageChoice in the property
inspector.
For
message choice we need a view object so first create the view object.
Right
click on project select new.
ADF
Business Component---- >View Object
Click
ok.
After that a welcome window will come just click
next.
In next window it will ask for the view object name
and the package will come automatically once check the package.
Name :- DepartmentVO
Package:- (sangu.oracle.apps.po.HelloworldPRJ.server)
Click
next, next…..
In
step 5 it will ask for the query write the query for which items u want in the
message choice.
Click next ..
In step 8 check both the generate jave files.
Ø VOImpl.
Ø VORowImpl.
Click next and finish.
Attach the VO to AM
Right click on AM Select Edit AM
There move your VO from left to right.
Ok now lets come to our item select the item set the
following property.
Prompt:-Department (Any name u want to display)
View Instance : -Select your view object name from
lov( DepartmentVO1).
View Attribute:- select the column which u want to
display in the message choice (Dname).
Picklist View Definition:- Give the path of the
vo
(sangu.oracle.apps.po.HelloWorldPRJ.server.DepartmentVO)
Picklist View Instance:- Give the VO name (DepartmentVO).
Picklist Display Attribute:- Which values u want to
display (Dname).
Picklist Value Attribute :- which values it shold
take from vo(Dname).
Run the page to get the output.
messageRichTextEditor
Item:-
Create the item select the item style as messageRichTextEditor in the property inspector.
messageRichTextEditor
item is used if the user want to give more details we use this.
For
ex writing Summary, Address etc.
Give
the prompt for the item.
Run
the page to get the output.
Image
Item:-
If u wants to
insert any image in the OAF page then we we will use the image item.
We cannot take image item directly in messageComponentLayout region for that
first we have to
take messageLayout and within that create the item and select
the item set item style as image in
property inspector.
To display the images first we have to put our image
in the server.
All the images in server are stored in OA_MEDIA
directory.
Copy the image in OA_MEDIA. To know the path open
the putty type $OA_MEDIA
It will give the OA_MEDIA directory
Type pwd it give the path and place your image in
that.
Here we are using WinSCP to move the file to server.
Next Copy the image in the local machine Jdeveloper
patch OA_MEDIA directory also.
jdevhome\jdev\myhtml\OA_MEDIA
To display the image in page we have to set some
property in the property inspector of that item
Visual--- >
Image URI--
> /OA_MEDIA/rose.jpg
Run the page to get the output.
hi i am strugglling to do multiselect lov in oaf, can you please help me , i need dropdown values with check box .if user selects like a and b from check box then a,b should come on taht dropdown itself.
ReplyDeleteHi Sravan,
DeleteDid you have any luck finding a solution for this? I have the same problem.
Kartik
Hi Sangu Patil,
ReplyDeleteNice Work ,, It is Very useful for OAF beginners once again thanks for your work.
''
-- John
Hi: The only way to optimize checkbox in oaf is with JDeveloper? Personalize web screen has limited functions? Thanks for your response.
ReplyDeleteHi: The only way to optimize checkbox in oaf is with JDeveloper? Personalize web screen has limited functions? Thanks for your response.
ReplyDeleteYes, If you are working on standard page then you need to extend the controller and need to write code.
DeleteHow to disable paste option on a text field
ReplyDelete