Вы находитесь на странице: 1из 92

What is OA Framework ?

Before starting about OA Framework, lets try to understand the word Framework: As more and more applications are being developed, new technologies are also evolving at the same time. If we look at our web application from scratch, even state is not maintained for our pages. For e ample, I want to create a search form. !hen I click on search"submit button, the criteria fields will not retain their values automatically. Also we use #avascript for validations and lots of other things for similar basic functionalities.$ow, the solution to these problems is that lots of frameworks are there in which such common functionalities are already done %pre&written' for us. (o whether it is (un or Oracle or )icrosoft, the main motive behind creating frameworks is that the attention of developers should only be towards developing the application i.e. the business rule %such as what ta should be deducted from an invoice' and get rid of all other things like *re+uest.get,arameter- or *making input fields inside an ./)0 file-. Because these things are not contributing to that part of software development which is directly related to users. By doing this we are not implementing any business rule. /he aim here is to do these tasks A(A, so that developers can only concentrate on implementing the business application. One more thing I want to put here is: difference between API & Framework: A,I is a library. At times we instantiate ob#ects of library code and call their functions.

Framework on the other side is like that there is already some blocks of code written and we have have to fit our own code somewhere inside those blocks.

(o to fit our code what we do is that sometimes we make our classes to inherit from other classes, implement the methods what

framework specifies. /his is what happens in most of the frameworks.

For e ample we want to make our application on )12 architecture. (o for that we can use (tructs %a framework which provides built in support for )12'. .owever this doesn-t provide much support for 3I.

4(F is also a framework which provide us a complete model of visual components, provides event handling tech for web&apps and lots of other services.$ow, I think its easy to define Oracle Application Framework :'Oracle Application Framework OAF 5 Framework developed by Oracle for building and launching web pages within Oracle 6&Business (uite %6B('. Below is a sample web page of Oracle 6B(:

All pages within 6B( are almost similar in look and feel. Based on this fact, below is some common functionality which is already provided by this framework so that we can mainly concentrate on implementing business logic:

Built in support for )12 architecture. Inbuilt support for Apps specific features like fle fields, menus etc.. ,rovide classes for all standard components seen on pages like te t fields, buttons, tables etc.. (upport for connection pooling and session management. Built in protection against web hacking. ,ersonali7ation 5 !e can change look and feel, layout or visibility of contents on the standard pages delivered by Oracle. .owever the

main thing here is that OAF allows somewhat skilled functional user to apply these changes.

Almost every implementation of 6B( has to make some changes to some of these pages. OAF has mechanism to implement these changes in such a way that the changes are not wiped out even after patches delivered by Oracle are applied.

(ince OAF is used only for creating 6B( pages, copyright links and global links are provided by this framework by default.

UIX User Interface X!"# Framework

Oracle 6B( uses: UIX for UI $omponents %i.e. 1iew part' B284 for business components %i.e. )odel part' And what OAF does is the programmatic binding among all these. 3I9 framework is 4:66&based framework for building web applications and is based on )12 design pattern. /he main focus of 3I9 is the user presentation layer of an application. 3I9 is platform independent as it is implemented in the 4ava programming language. 3I9 development can be declarative, using ui9)0, an 9)0 language for creating 3I9 pages. 3I9 includes a set of 3I components and classes for rendering them: UI $omponents: /hese are implemented as 4ava Beans. /hey include page layouts and simple 3I ob#ects that map to standard ./)0 controls, such as buttons, forms, and checkbo es. /here are other comple components, such as trees, hide&show controls, 0O1 etc. %enderers: /hese are 4ava classes for rendering the 3I components

to target clients"devices. For e ample, components are rendered as ./)0 for use in web browsers or as !)0 for use in mobile devices. 2lasses for 3I9 2omponents are in the oracle.cabo.ui package.

&iX!": /his is an 9)0 language for programming 3I9 applications. ui9)0 provides a declarative way of creating web applications programmatically using 3I9 4ava A,Is. /he pages, events, and any other items defined with ui9)0 elements are all transformed into 4ava ob#ects behind the scenes. Below is an e ample of a ui9)0 element %button': ;button destination<=http:""www.abc.com"inde = disabled<=false= te t<=goBtn=> ;"button> ui9)0 documents are written in a te t format, where document represents page or a region. 2lasses supporting ui9)0 are located in oracle.cabo.ui.xml andoracle.cabo.servlet.xml packages. Pa'es in UIX <<<<<<<<<<<<<<<<<<< On the browser, ?page= is #ust collection of ./)0 elements. .owever, while in developing phase, concept of ?page= can be more comple , depending upon the declarative way used to create the page and renderers used. A 3I9 page consists of a hierarchical set of components known as 3I nodes. (ome nodes define visible components, such as buttons, images, te t fields, while others organi7e the layout and appearance of other nodes.

$odes can have parents and children, and multiple nodes together form a tree&like structure used to represent a page-s logical structure.For e ample, left part below figure shows a logical hierarchy of 3I nodes and right part shows the same hierarchy rendered as an ./)0 page.

$ow in 3I9, there is a #ava class for each 3I nodes. /hese classes implement the 3I$ode interface in the oracle.cabo.ui package. /he 3I$ode interface contains methods for the characteristics of nodes, such as: public int getInde ed2hild2ount%@endering2onte t conte t'A public 3I$ode getInde ed2hild%@endering2onte t conte t, int childInde 'A public 6numeration getAttribute$ames%@endering2onte t conte t'A public Ob#ect getAttribute1alue%@endering2onte t conte t, AttributeBey attrBey'A

Oracle Application Framework (rainin' !aterial C OAF A@2.I/62/3@6

OA Framework is based on the industry&standard 4:66 !)$ Design ,attern. ) 5 )odel 1 & 1iew 2 & 2ontroller Developers manipulate the application-s metadata using Oracle Ei 4Developer OA 6 tension, while OA Framework uses the most efficient manner to e ecute the application. /he )12 architecture is a component&based design pattern with clean interfaces between the !odel, )iew and $ontroller. /he !odel is where the application implements its business logic. /he )iew is where the application implements its user interface. /he $ontroller is where the application handles user interaction and directs business flow. Find the following )12 diagram to understand relationship between )odel, 1iew and 2ontroller. *+* Abo&t !odel is implemented using Oracle Business

/he OA Framework !odel 2omponents for 4ava %B284'.

B284 provides optimi7ed, ready&to&use implementations of the 4:66 design patterns. Development teams can focus immediately and only, on writing business logic and user interfaces instead of designing, coding, and debugging handcrafted application ?plumbing= code. *+, Abo&t )iew

/he OA Framework )iew is implemented using 3I 9)0 %3I9'. 3I9 uses 9)0 to describe the components and hierarchy that make up an application page. 3I9 provides runtime capabilities to translate that metadata into ./)0 output so that it can be shown on a Browser. /he metadata used to describe the 3I is loaded into a database repository, called )eta Data (ervices %)D(', at deployment time and optionally at design time as well. *+Abo&t $ontroller

3ser and Application&driven interactions are handled by the OA $ontroller, which is pure 4ava 2lass implementation. !ithin the )odel&1iew&2ontroller architecture, the OA Framework draws a clear distinction between ?client= and ?server= classes. 2lient classes %1iew and 2ontroller' drive the ./)0 user interface. (erver classes %)odel code' can support any client %not #ust OA Framework user interfaces' ,+ .e/ Feat&res

Integrated Development 6nvironment Durable ,ersonali7ation-s and 6 tensions 2onsistent and 2ompelling 3ser Interface Ob#ect Oriented @euse

,+* Inte'rated 0e1elopment 2n1ironment I02# Oracle Ei 4Developer with OA 6 tension is a world&class 4:66&based integrated development environment. Oracle customers and third party consultants have access to the same tools used by Oracle 6&Business (uite developers to build complementary applications as well as e tend the Oracle 6&Business (uite applications. ,+, 0&rable Personali3ations and 24tensions ,ersonali7ation is about declaratively tailoring the 3I look&and&feel, layout or visibility of page content to suit a business need or a user preference. ,ersonali7ation can be done at several levels by one of three authors: Application Developer Application Administrator 6nd 3ser 6 amples: /ailoring the color scheme of 3I %3I means 3ser Interface' /ailoring the order in which table columns are displayed. /ailoring a +uery result 6 tensibility is about e tending the functionality of an application beyond what can be done through personali7ation. 6 amples: Adding new functional flows

6 tending or overriding e isting functional flows 6 tending or overriding e isting business logic

,+- $onsistent and $ompellin' User Interface OA Framework offers developers a wide range of user interface components that make the building of applications into a more assembly process, freeing developers from the repetitive composition of common user interface constructs. OA Framework user interface components range from simple widgets such as buttons and fields to compound components such as tables&in&tables and hierarchical grids. ,+5 Ob6ect Oriented %e&se OA Framework applications can be abstracted into a series of concentric layers, like an onion. %7ote: Describe the ob#ects mentioned in diagram in the following pages'

6ach layer only ?knows= about the layers below it. /his encapsulation allows reuse at any of the layer boundaries.

On 3ser Interface (ide, reusable components can be saved as 8hared re'ions in the )D( repository and reused across several pages. 6 ample for (hared region is 0O1 %list of values'. It is independent ob#ect. !e can attach the same 0O1 to te t item in several pages.

-+ OA Framework 2ssentials .e/ 98P Application $omponents C' /he Browser communicates with the middle tier using :((P which involves sending a re;&est message to which the middle tier replies with a response message. :'

A 98P is a file with some ./)0 and 4A1A code that e ecutes top to bottom. At runtime, it is compiled into a 4ava class which is actually a 8er1let+ F' A 8er1let is a 4ava web based application server e tension program that implements a (tandard A,I. 8' A 8er1let 8ession is a mechanism for maintaining state between .//, re+uests during a period of continuous interaction between Browser and !eb Application. A 8ession may be initiated at any time by the application and terminated by the application, by the user closing the browser, or by a period of inactivity. A session usually corresponds to an application login"logout cycle. G' A 9a1a<ean ?<ean= for short# is simply a reusable component that implements specific design patterns to make it easy for programmers and development tools to discover the ob#ect-s properties and behavior. H' Any ob#ects in the middle tier that communicate with the database use a 4DB2 %9ava 0ata<ase $onnectivity'. Diagram to understand the above points 5+ Implement the !O02" in OAF /his chapter describes how to implement your model ob#ects in generic terms. Business 2omponents ,ackages All B284 %Business components for 4ava' model components must belong to a Business 2omponents ,ackage. Business logic"data handling %)odel' is done using B284. /he below ob#ects are B284 Ob#ects. C' 6ntity Ob#ect 6ntity Ob#ects encapsulate business logic and D)0 operations for application tables. 7ote: 6ntity ob#ects can also be based on views, synonyms or snapshots.

/here is a one&to&one mapping between a table and an entity ob#ect, and all Oracle Applications entity ob#ects should include all columns in their associated tables. 6ntity ob#ects use a declarative mapping between their attributes and underlying database columns to automatically implement +ueries, inserts, updates and deletes. /wo files will be created automatically after creating 6ntity Ob#ect%6O'. /hey are i' 6mployee6O. ml ii' 6mployee6OImpl.#ava

?6mployee6O= is name of the 6ntity Ob#ect %6O'. /he below methods are available under .#ava file %6mployee6OImpl.#ava' !e can write business logic in 6O at entity level to meet business re+uirements %6 ample: validate(tartDate %'' )ethods under 6ntity Ob#ect:&

create%' IAdd attribute defaulting logic in this methodJ remove%'IAdd entity remove logic in this methodJ set methods Isets value as the attribute valueJ

%6 ample: set6mployeeId, setFirst$ame etc' get methods Igets the attribute value, using alias nameJ %6 ample: get6mployeeId, getFirst$ame etc' validate6ntity%' 6ntity Ob#ect %6O' should have following attributes: 2reationDate 2reatedBy 0ast3pdateDate 0ast3pdatedBy 0ast3pdate0ogin

:' 1iew Ob#ects

6ncapsulates a database +uery ,rovide iteration over the +uery result set ,rimarily based on 6os %6ntity Ob#ects' )ay be based on plain (K0 for certain types of tasks )ay be based on multiple entity ob#ects if the 3I is for update

,rovide single point of contact for getting and setting entity ob#ect values )ay be linked together by view links

/wo files will be created after creating 1iew Ob#ect %1O' /hey are C' .#ava %@ow level' :' .#ava %Ob#ect level' 24ample: i' 6mployee$ames1O. ml ii' 6mployee$ames1OImpl.#ava iii' 6mployee$ames1O@owImpl.#ava !e will write code in .#ava files. F' Association Ob#ects

F' . ml file

Association ob#ect is used to create relationship between 6ntity /here are two types of associations are given below. C' 2omposition %(trong association' :' @eference %!eak association' $omposition: = its source entity


/he destination entity ob#ect can not e ist independent of

ob#ect. 24ample: A purchase order header is automatically locked even if you make changes only to its lines. 2hild is deleted when parent is deleted. %eference: & /he source entity ob#ect simply references the destination ob#ect. 24ample: A purchase order header references a supplier, but the supplier can still e ist regardless of whether a purchase order references it or not. 8' Application )odules
o o o

Application )odule serves as container for )iewOb6ects and )iew"inks Application )odule establishes database connection. Attach the Application )odule to OA Framework page.

>+ Implement the )I2W in OAF /he 1I6! formats and presents model data to user. !e have to define OAF page to display data.

At development time, you specify the bean hierarchy for every page using the 4Developer tool. OAF page comprised of regions and items. Items are simple widgets like buttons, images, fields and so on which contain no children. %e'ions are container ob#ects that hold items and other regions. @egions include header, table and layout components. 6ach region and item that you define has a style property that tells the OA Framework what web bean ob#ect to instantiate for it at runtime. For e ample, if you define a region whose style property is Ltable,L the OA Framework will instantiate an oracle+apps+fnd+framework+web&i+beans+table+OA(able<ean All pages must have a single top&level region whose style is ?,age0ayout=. @egions and Items appear in 4Developer page tree in se+uence that tells Framework where to add these ob#ects to runtime bean hierarchy. ?+ Implement the $O7(%O""2% in OAF $O7(%O""2% is used to enhance OA Framework page using logic for buttons, automatic +ueries, dynamic !.6@6 clauses, 4(, forwards, and the )essage Dictionary.

2ontrollers for regions

M process@e+uest method %code for page initiali7ation such as .//, N6/ actions and so on' M processForm@e+uest method %code for .//, ,O(/ actions. !hen press the button the code will be e ecuted'

/ypical 0ocations for 2ode !e could not call methods of 6ntity Ob#ects %6O' from 2ontroller directly. !e have to follow below order to call method from location to other location. C' :' F' 8' 2all methods of Application!od&le from $ontroller only 2all methods of )iewOb6ect from Application!od&le only 2all methods of 2ntit/Ob6ect from )iewOb6ect only 6ntityOb#ect is based on Database table

7ote: ,lease look O7IO7 structure to understand above points.


OAF .e/ 0oAs and 0onAts Part *# = B(op *CB Dolden %&les

I donOt know how many of you have come across this in the OAF Devguide, it was only by change that I found it, thought IOd share: /hereOs a lot to learn when getting started with the OA Framework, but the following list of rules are so universal && and so fundamental && they should be familiar to anyone whoOs doing Framework development. C' A0!AP( try to declaratively define your 3I. @esort to a programmatic layout only if the 3I cannot be implemented declaratively. ,rogrammatic layouts are difficult to customi7e %they donOt leverage the ,ersonali7ation Framework' and may diverge from the 3I Nuidelines over time. :' $616@ change your 3I layout properties in processForm@e+uest%'. A0!AP( make changes in process@e+uest%', even if that means handling an event in processForm@e+uest%' and then redirecting back to the same page. /his ensures that the web bean hierarchy is in a stable state when the page renders. F' $616@ use inde numbers to find beans when you want to change their properties. A0!AP( search by name. Inde numbers can change during processing. 8' $616@ change the properties of a parent bean from a child bean. /his is a poor design practice that hampers reuse while introducing fragile code %particularly if the child code e ecutes too late in the page rendering cycle to properly affect the parent'. G' $616@ instantiate Beans using Lnew OA Bean%'L. A0!AP( use the create!ebBean%' factory methods available on the OA2ontrollerImpl class. $ot all Bean properties are initiali7ed correctly when you use Lnew.L H' $616@ create Form Beans in code %this means $616@ add nested Form beans to a pageA your ,age 0ayout region should be the only form region'. )ultiple form Beans on a page are not supported and can result in strange runtime behaviors. Q' $616@ count on your Application )odule using the same database connection in subse+uent re+uests. For e ample, $616@ post and commit in separate re+uests. For performance reasons, the Framework will start pooling and reusing connections in G.Q instead of holding onto a single connection throughout the life of an Application )odule. R' $616@ use 4DB2 directly unless youOre calling a ,0"(K0 routine %you should use a view ob#ect instead, and if possible, the view ob#ect should be

defined declaratively and not programmatically'. E' $616@ add member variables 3$06(( /.6P A@6 /@A$(I6$/ O@ FI$A0 to view ob#ects, 2ontrollers, entity ob#ect, view rows and Application )odules. CS' A0!AP( adhere to the (elf&(ervice ,erformance Nuidelines E+ $reate 8imple OAF W2"$O!2 Pa'e (tep C: Open 4Developer tool, 2reate $ew OAworkspace. 7a1i'ation: = right click on !orkspaces option in system&navigator !indow and select $ew OA!orkspace (tep :: i' 6nter workspace name in file name column as ?999OA!orkspace.#ws=, and press OB button. ii' ,ress $e t button iii' 6nter pro#ect $ame in file name column as ?999OA,ro#ect.#pr= iv' 6nter Default package name as ? .oracle.apps.ak.welcome.webui= and press 7e4t button twice. !e can see the package structure %train.oracle.apps.ak.welcome.webui' in ?mypro#ects= folder. /he package structure is used to place 6O, 1O, A) and ,ages. (tep F: 6nter +dbc file location in DB2 File $ame column I"ocation: 6:Tp8S8GHFEUCCiUN6$6@I2T#devhomeT#devTmyhtmlTOAU./)0T(ecur eT .dbcJ 7ote: If you do not have .dbc file, then import the .dbc file from server %V cd WA,,0U/O,"fnd"CC.G.S"secure".dbc' and place in above path in your local system. 6nter 3ser $ame: operationsG %oracle application user name' 6nter ,assword : Application (hort $ame: AB @esponsibility Bey : F!BU/B9U/3/O@IA0 ,ress Finish button. $ow, creation of OA!orkspace, OA,ro#ect and front&end connections successfully completed. (tep 8: $reate new OA pa'e

(elect pro#ect name % then select 7ew option.

OA,ro#ect' and click right mouse button,

$ew window will be opened, and then select ?Web(ier= under ?categories= list. (elect ?OA $omponents= option under ?!eb /ier= and select ?Pa'e= right side. ,ress OB Button. (tep G: 6nter page name as ?XXXWelcomePD= in $ame field. Pou can change the package name if you want otherwise leave it as it is because the package is already created at the time of workspace creation. ,ress OB button, then page web bean %!elcome,N. ml' will be created. $ow, we will run the . ml %!elcome,N. ml' to render the OAF page on the Browser. In above diagram, there is ?regionC= called root re'ion. It is container, consists items and other regions. (et the properties for root region %regionC' in property inspector window. Propert/ 7ame ID @egion (tyle !indow /itle /itle A) Definition )al&e )ain@$ ,age0ayout !elcome !indow !elcome ,age oracle.apps.fnd.framework.server.OAApplication)odule 7ote: we are not yet creating Application Module.
So, this

application module is using which is default.

(tep H: 2reate subregion %style: messagecomponentlayout' under the ,agelayout region. (elect ?)ain@$= and click right mouse button, select ?region= Option and set the below properties. Propert/ 7ame )al&e ID (ub@$

@egion (tyle (tep Q: 2reate item under ?8&b%7=


(elect the region ?8&b%7= and click right mouse button, and then select the option ?messa'e(e4tInp&t= and set the below properties.

Propert/ 7ame ID @egion (tyle ,rompt Additional /e t

)al&e !elcome/ t message/e tInput 6nter Pour $ame 6nter any string to display it on the page %It is like /ooltip te t'

(ee below screen shot to select ?message/e tInput=. (ave the pro#ect and compile the page %!elcome,N. ml' (teps to compile the !elcome,N. ml X (elect the . ml %!elcome,N. ml' and click right mouse button. X (elect ?)ake !elcome,N. ml= option, and verify the errors on log messages tool bo %see bottom' if occurred. (tep R: @un the OAF ,age %!elcome,N' (elect the page %!elcome,N. ml' and click right mouse button, then select ?@un !elcome,N. ml= option. %(ee above screenshot for your reference' (ee the below OAF page screenshot and verify the window title, page title and te t item prompt with above properties. In this stage, there is no control on the OAF page. !e have to create $O7(%O""2% on the root region and write the code to control the OAF page. E+ Practical Problems and 8ol&tions

Display the message as Welcome <text item value> on the OAF page when you press the o button

(tep C: 2reate button item under the sub region ? 8&b%7=. (elect the region ?(ub@$= and click right mouse button, select the option ?messa'ela/o&t= %is used to place the b&ttons'. Propert/ 7ame ID )al&e Button0ayout

(tep :: 2reate button item under the ?Button0ayout=. (elect the region ?Button0ayout= and click right mouse button, and select the Option ?item=. (et the Button item properties. Propert/ 7ame ID Item (tyle ,rompt Additional /e t

)al&e No submitButton No 2lick the button

(tep F: 2reate 2ontroller. (elect the ?)ain@$= region and click right mouse button, and then choose the option ?8et 7ew $ontroller=. 6nter 2ontroller $ame: Welcome$O and press the OB button. After press the OB button, one .#ava file will be created with ?2ontroller= name as Welcome$O+6a1a 8ee below screenshot:= (ee below screenshot once and observe the methods ?process@e+uest= and ?processForm@e+uest= in the 4ava file %Welcome$O+6a1a'. !hen press the ?No= button, the button related code will be e ecuted from ?processForm@e+uest= method %like 4ava ,O(/ method'. /he ?process@e+uest= code will be e ecuted at the time of initiali7ing the page. 0ogic to display the message ?!elcome ;value of te t item> on OAF page. Add below code in the method ?processForm%e;&est=.

$ode: if %page2onte t.get,arameter%LNoL'Y<null' Z (tring str<page2onte t.get,arameter%L!elcome/ tL'A (tring message<L!elcome L[strA throw new OA6 ception%message,OA6 ception.I$FO@)A/IO$'A \ In above code, ?No= is button name %not prompt' which is used in ?if= condition. ?!elcome/ t= is also te t item id %not prompt'. !hen user press the ?No= button, the browser will send the re+uest to middle tier and after processing the middle tier responds to browser. /he OA24ception class is used to display the message on the OAF page. /he second parameter is e ception type ?I$FO@)A/IO$=. /here C' :' F' 8' are some more e ception types available. /hey are: 2O$FI@)A/IO$ !A@$I$N 6@@O@ (616@6

7ote: /he e ception types ?6@@O@= and= (616@6= terminate the program. /he e ception types ?I$FO@)A/IO$=, ?2O$FI@)A/IO$= and ?!A@$I$N= are continue the e ecution of the program. $ow, run the page ?!elcome,N. ml= and see output like below. O&tp&t: 6nter the te t ?OAF students= in te t item and press the ?No= button, then display the message on ?)ain@$= %@oot region'. !essa'e: !602O)6 OAF students %6 ception type: I$FO@)A/IO$' Prod&ct <randin': /he ?productBranding= is used to place image beside corporate branding image ?O@A206=. (elect ?page0ayout components= and click right mouse button, and select the prod&ct<randin' option.

(et the below properties for prod&ct<randin' item Propert/ 7ame )al&e ID ItemC %as you like' Item (tyle Image Image3@I "OAU)6DIA"F$D/A,,B@A$D.gif Additional /e t 2lick the button (et the system profile ?F70: <randin' 8i3e= as ?)edium= at site level. If you change menus or profile values etc, then we have to terminate the OAF page. 7a1i'ation: @3$&>/erminate&>6mbedded O284 (erver %)enu bar' 2ompile and run the OAF page %. ml', check the output from below screenshot. In above screenshot, ?/utorial Application= image is productBranding image. In=$onte4t <randin': /he in&conte t branding includes corporate branding and product branding images. Additionally, conte tual information renders below corporate and product branding images. (elect ?page0ayout 2omponents= region and click right mouse button, then select the ?In$onte4t<randin'= option.

7ote: productBranding can contain only ?formatted/e t= because ?In& 2onte tBranding= is present. (et the properties for ?productBranding= item style as ?formatted/e t= and enter /e t property as ?8ales Online=. (et the properties for in$onte4t<randin' item. Propert/ 7ame ID Item (tyle /e t )al&e Item: %as you like' formatted/e t 2ustomer (3$ )icro(ystems&)enlo ,ark

!e can use html tags to change font styles or display font in bold etc. 24ample: 2ustomer ;b> (3$ )icro(ystems&)enlo ,ark;"b>

O&tp&t: !ow do display de"ault string in #ext $tem when page is rendered $ode: OAMessageTextInputBean fieldHelloTxt= (OAMessageTextInputBean !ebBean.find"#ild$ecursive(%&elcomeTxt' ( fieldHelloTxt.setText(page"ontext) %!elcome to OA* students' ( !here ?!elcome/ t= is a /e t Item ID. !rite above code in ?process@e+uest= method of 2O$/@O006@. Important 7ote: !e have to import the class ?OA)essage/e tInputBean=. M import oracle.apps.fnd.framework.webui.beans.message. OA)essage/e tInputBeanA M import oracle.apps.fnd.framework.webui.beans.OA!ebBeanA !ow do hide #ext item at runtime $ode: /he )ethod ?set@endered= is used to hide the te t item. ,ass the value ?false= for this method. import oracle.apps.fnd.frame!or+.!ebui.beans.message. OAMessageTextInpuBean( import oracle.apps.fnd.frame!or+.!ebui.beans.OA&ebBean( OAMessageTextInputBean #ellotxt= (OAMessageTextInputBean !ebBean.find"#ild$ecursive(%&elcomeTxt' ( Hellotxt.set$endered(false ( !rite above code in process@e+uest )ethod or processForm@e+uest of 2O$/@O006@ according to condition. 0ike set@endered method, there are so many methods are available in te t item Bean. /he method Fset%eadonl/ tr&e#G is used to convert the item to read&only.

!ow do disable the button at runtime $ode: !e have to use ?OA(ubmitButtonBean= to change behavior of buttons at runtime. import oracle.apps.fnd.framework.webui.beans.form.OA(ubmitButtonBeanA OA(ubmitButtonBean goButton < %OA(ubmitButtonBean'webBean.find2hild@ecursive%LNoL'A goButton.setDisabled%true'A !ow do display message in di""erent colour problem $ode: !e can do it by using ?raw/e t= style %Item property under )ain@$'. In ?/e t= property, we can use html tags. %Display message in red color' HbIHiIHfont colorJBredBI :ello World Pa'eHKfontIHKiIHKbI Dynamically, display the raw/e t by using OA%aw(e4t<ean OA@aw/e tBean rawt t < %OA@aw/e tBean'webBean.find2hild@ecursive%LitemFL'A rawt t.set/e t%LInventory Details are /ransferredL'A rawt t.set/e t %L;b>;i>;font color< red> Inventory Details are /ransferred;"font>;"i>;"b>L'A Display the message in red color. (ee below screenshot. !ow do call the speci"ied page "rom another page I have two pages. One page is security page, if user enters the login details correct then open the other specific page. 8ol&tion: /he A,I pa'e$onte4t+8etForwardU%" is used to open the other specific page. Design the security page with two te t items and one button like below screen shot. %7ote: /his is not related to database. 4ust check the user name and password with static te t like username<1enky and password<1enky'

$ode: Write in $ontroller L processForm%e;&est !ethod# if %uname.e+uals%L1enkyL']]pwd.e+uals%L1enkyL'' Z page2onte t.setForward3@0%LOA.#sp^ page<"train"oracle"apps"ak"welcome"webui"!elcome,NL, null, OA!ebBean2onstants.B66,U)6$3U2O$/69/, null, null, true, O!ebBean2onstants.ADDUB@6ADU2@3)BUP6(, OA!ebBean2onstants.IN$O@6U)6((AN6('A \ 6nter user name and password correct, and then press ?No= button. %ote& 'et text item property secret as #rue when enter password( )ser could not see the password while entering( /he below page ?!elcome,N= will be opened. !ow do display the *eturn %avigation lin+ on the page (uppose, if user call second page from first page and perform some actions on the second page. 0ater, the user wants to go back to first page, then we have to use ?@eturn $avigation= link. (elect the region ?pa'e"a/o&t%7= and click right mouse button, and then select the option ?ret&rn7a1i'ation=. (et the properties for ?return$avigation= item. )al&e Propert/ 7ame return0ink ID link Item (tyle OA.#sp^ Destinati page<"train"oracle"apps"ak"security"webui"(ecurity,N]retainA)<P on 3@I /e @eturn to (ecurity ,age t

Output for ret&rn7a1i'ation link %@eturn to (ecurity ,age':& (ee the below screenshot. !hen user presses the ?%et&rn to 8ec&rit/ Pa'e= link, then the security page will be opened. !ow do add a return,in+ dynamically $ode:= process@e+uest%OA,age2onte t page2onte t, OA!ebBean webBean' Z super.process@e+uest%page2onte t, webBean'A OA0inkBean return0ink < %OA0inkBean'create!ebBean%page2onte t, OA!ebBean2onstants.0I$BUB6A$, null,Lreturn0inkL'A return0ink.setDestination%LOA.#sp^ page<"oracle"apps"dem"employee"webui"6mp(earch,N]retainA)<PL'A "" @etrieve and set the translated link te t. (tring link/e t < page2onte t.get)essage%LABL,LF!BU/B9U/U@6/3@$U/OU,O(L, null'A return0ink.set/e t%link/e t'A "" Add the return link to the page. %%OA,age0ayoutBean'webBean'.set@eturn$avigation%return0ink'A \ Followin' problems are related to work on 0atabase data -onnect to Database and return number o" suppliers on the page import oracle.apps.fnd.framework.webui.OA!ebBean2onstantsA import oracle.apps.fnd.framework.server.OADB/ransactionA import #ava.s+l._A Write below code in process re.uest # method or an/where as per re;&irement+ oracle.apps.fnd.framework.OAApplication)odule am < page2onte t.getApplication)odule%webBean'A (tring task:Info < nullA

,repared(tatement ps,ro/ype < nullA @esult(et rs,ro/ype < nullA int task:/ype < SA 2onnection conn < am.getOADB/ransaction%'.get4dbc2onnection%'A task:Info < L(6062/ 2O3$/%_' F@O) F!BU/B9U(3,,0I6@(LA tryZ ps,ro/ype < conn.prepare(tatement%task:Info'A rs,ro/ype < ps,ro/ype.e ecuteKuery%'A if %rs,ro/ype.ne t%'' Z task:/ype < rs,ro/ype.getInt%C'A \ \ catch%6 ception e' Zpage2onte t.writeDiagnostics%am,e.get)essage%',8'A\ throw new OA6 ception%?supplier count :=[task:/ype, OA6 ception.I$FO@)A/IO$'A 8ee below screen shot for o&tp&t+ !ow do call stored procedure "rom OAF page /Without using 0O1 2O3 $ode: ,lace the button ?$allable= and write above code in processForm%e;&est method import #ava.s+l.2onnectionA import oracle.#dbc.Oracle2allable(tatementA if %page2onte t.get,arameter%L2allableL'Y<null' Z try Z (tring delete(tmt < LB6NI$ D606/6U@62O@D% L [ L,A@A)C <> :C'A 6$DA LA OADB/ransaction tr n < am.getOADB/ransaction%'A 2allable(tatement delproc < tr n. create2allable(tatement%delete(tmt,C' A "" @ebind parameters delproc.set(tring%C,LrahulL'A delproc.e ecute3pdate%'A \ catch%6 ception s+le' Z page2onte t.writeDiagnostics%am, s+le.get)essage%', 8'A

\ \

""2allable(tatement delete(t<conn.prepare2all%delete(tmt'A First, create stored procedure ?D606/6U@62O@D=.

2@6A/6 O@ @6,0A26 ,@O26D3@6 D606/6U@62O@D%paramC 1A@2.A@:' A( B6NI$ D606/6 F@O) emp !.6@6 ename<paramCA 2O))I/A 6$D deleteUrecord A Display message by using AO, 4essage %ame /4essage Dictionary3 8ol&tion: we can displa/ messa'e b/ &sin' Fp&t0ialo'!essa'eG !ethod+ $ode: import oracle.apps.fnd.framework.webui.OADialog,ageA import oracle.apps.fnd.common.)essage/okenA )essage/okenIJ tokens < Znew )essage/oken%L6),U$A)6L, ?rahul='\A "" rah&l is emplo/ee name OA6 ception message < new OA6 ception%LABL, LF!BU/B9U/U6),UD606/6U2O$FI@)L, tokens, OA6 ception.2O$FI@)A/IO$, null'A page2onte t.putDialog)essage%message'A &&display message. 8ee below screenshot ` F!BU/B9U/U6),UD606/6U2O$FI@) a is message name in AO0. !ow do call D56 Form "rom OAF page 8/nta4: form&responsibilit/Application8hort7ame&responsibilit/.e/&sec&rit/D ro&p.e/&f&nction7ame $ode: page2onte t.forwardImmediately/oForm%Lform:,O:,3@2.A(I$NUO,6@A/IO $(:(/A$DA@D:,OU,O9,O6,OL'A %es&lt:

!rite above code in controller for button. Opens the ,O Form when click the button.

2as/ 8teps for 8earch Pa'e

8imple 8earch Pa'e in OAF
.ere is a simple search page where user can perform search operation on the basis of employee number and employee name on employee table. *# $reate a new OA workspace 44c&s# and a new pro6ect &nder this 44c&s#+ ,# $reate a new OA pa'e: @ight click on pro#ect % cus' 5> $ew 5> !eb /ier 5> OA 2omponents

5> select *,age- item. 2lick OB. %/his will open a popup window' !e are creating a employee search page, so specify the details of page as below: $ame: 9 6mployee(earch,N ,ackage: cus.oracle.apps.fnd.emprec.webui

-# $reate a new 1iew ob6ect )O#:

@ight click 5> $ew 1iew Ob#ect %/his will open a wi7ard having Q steps'. (tep C ,ackage: cus.oracle.apps.fnd.emprec.server $ame: 9 6mployee(earch1O

2hoose the radio button *@ead&only Access- %as we are not performing any D)0 operation'. 2lick $e t. (tep : 6nter the below +uery in *Kuery (tatement-: (6062/ empno, ename, #ob, mgr, hiredate, sal, deptno F@O) employee Beep defaults for stepF, 8, G, H (tep Q (elect check bo es for *Nenerate 4ava File- for both *1iew Ob#ect 2lassand *1iew @ow 2lass-. 2lick Finish. 5# $reate a new Application !od&le A!#: (tep C ,ackage: cus.oracle.apps.fnd.emprec.server $ame: 9 6mployeeA). 2lick $e t. (tep : .ere we will add an instance of the 1O created in %F'. (elect 9 6mployee(earch1O from *Available 1iew Ob#ects- and shuttle it to *Data )odel- using > button. Beep defaults for all other steps %F, 8'. 2lick Finish. ># $reate a new $ontroller class : (tep C (elect 9 6mployee(earch,N in navigator tab. Declarative form of page will be visible in structure tab.

(tep : @ight click on page0ayout region 5> set new controller %/his will open a popup window'. 6nter the below details: package $ame: cus.oracle.apps.fnd.emprec.webui 2lass $ame: 9 6mployee(earch2O $reatin' the Pa'e "a/o&t & 8ettin' its Properties <<<<<<<<<<<<<<<<<<<<<<<<<< ,age will appear as below:

C' 2reate a new region under page0ayout of type default(ingle2olumn. :' 2reate F items under default(ingle2olumn region %message/e tInput, message/e tInput, submitButton'. F' 2reate another item under page0ayout of type *spacer-. $ow change the properties for each field from property inspector as shown below: page0ayout: ID: page0ayout@$ A) Definition: cus.oracle.apps.fnd.emprec.server.9 6mployeeA) !indow /itle: 6mployee (earch ,age

/itle: 6mployee (earch

default(ingle2olumn: ID: single2ol@$ message/e tInput %for emp number': ID: emp$um ,rompt: 6mployee $umber message/e tInput %for emp name': ID: 6mp$ame ,rompt: 6mployee $ame submitButton: ID: goBtn, ,rompt: No spacer: ID: spcr, .eight: :S

8' Again create a region under page0ayout. .owever this time, choose %e'ion Usin' Wi3ardM+ (tep C select *9 6mployeeA)- from Application )odule drop down and select *9 6mployee(earch1OCb in available view usages. 2lick $e t. (tep : choose region style as *table- from drop down. 2lick $e t. (tep F shuttle all the fields from available to selected attributes. 2lick $e t. (tep 8 2hange the style to message(tyled/e t for each row. Also modify the

prompt to make it more user friendly %like emp$ame to 6mployee $ame'. /he declarative page structure in #Dev will be similar to as shown below:

$ode for Performin' the 8earch Operation <<<<<<<<<<<<<<<<<<<<<<<<<< 3ser will enter search criteria %emp num or name' and click on *No- button.

!e catch this button press in ,F@ method of controller.

Net the criteria fields and pass those to A) where we define a method to perform search.

!rite the below code in ,F@ method of controller:

view plaincopy to clipboardprint^

1. public void processFormRequest(OAPage onte!t page onte!t,

". (. *. +. -. .. 1. 2. OA#e$%ean we$%ean& ' super.processFormRequest(page onte!t, we$%ean&) OAApplicationModule am , page onte!t.getRootApplication Module(&) if (page onte!t.getParameter(/go%tn/& 0, null& ' if ((0 (//.equals(page onte!t.getParameter(/emp3um/&.trim(&&&& 44

56. (0 (//.equals(page onte!t.getParameter(/7mp3ame/&.trim(&&&&& ' 55. String emp3um , page onte!t.getParameter(/ emp3um/&) 5". String emp3ame , page onte!t.getParameter( /7mp3ame/&) 5(. if ((//.equals(page onte!t.getParameter(/e mp3um/&.trim(&&&& ' 5*. emp3um , null) 5+. 8 5-. 5.. Seriali9a$le:; param , ' emp3um, emp3ame 8 ) 51. am.in<o=eMethod(/search7mployee/, param&) 52. "6. riteria./, "5. "". "(. "*. 8 8 8 OA7!ception.7RROR&) 8 else ' throw new OA7!ception(/Please 7nter Search

Below is code for search6mployee method in 9 6mployeeA)Impl.#ava :

view plaincopy to clipboardprint^

1. public void search7mployee(String emp3um, String emp3ame& '

". (. *. +. -. .. 1. try ' >!7mployeeSearch?O@mpl <o , get>!7mployeeSearch?O5(&) <o.setMa!FetchSi9e(A5&) <o.set#here lause(null&) <o.set#here lauseParams(null&) <o.set#here lause(/7MP3O , n<l(/ B emp3um B /,7MP3O&/ B

/A3C DPP7R(73AM7& li=e DPP7R(EF/ B emp3ame B /F E&/&) 2. System.out.println(/search query A / B <o.getGuery(&&) 56. <o.e!ecuteGuery(&) 55. 5". 8 catch(7!ception e& ' 5(. e.printStac=Hrace(&) 5*. 8 5+. 8

Create OAF Search Page

1. Create a New Workspace and Project Right click Workspaces and click create new OAworkspace and name it as PRajkumarSearch. Automatically a new OA Project is also created. Name the project as SearchDemo and package as prajkumar.oracle.apps. nd.searchdemo

2. Create a New Application Module AM! Right !lick on SearchDemo " New " AD# $usiness !omponents " Application %odule Name && SearchA% Package && prajkumar.oracle.apps. nd.searchdemo.ser'er

". #na$le Passi%ation &or the 'oot () Application Module AM!

Right !lick on SearchA% " (dit SearchA% " !ustom Properties " Name ) R(*(N*+ON,-(.(.alue ) %ANA/(,S*A*( !lick add " Apply " O0

*. Create +est +a$le and insert data so,e data in it For +esting Purpose! !R(A*( *A$-( 11,search,demo 2 && &&&&&&&&&&&&&&&&&&&& && Data !olumns && &&&&&&&&&&&&&&&&&&&& column1 .AR!3AR4215567 column4 .AR!3AR4215567 && &&&&&&&&&&&&&&&&&&&& && Who !olumns && &&&&&&&&&&&&&&&&&&&& last,update,date DA*( NO* N8--7 last,updated,9y N8%$(R NO* N8--7 creation,date DA*( NO* N8--7 created,9y N8%$(R NO* N8--7 last,update,login N8%$(R 6: +NS(R* +N*O 11,search,demo .A-8(S 2;'al1<7 <'al4<7 S=SDA*(7 57 S=SDA*(7 57 56: +NS(R* +N*O 11,search,demo .A-8(S 2;'al1<7 <'al4<7 S=SDA*(7 57 S=SDA*(7 57 56: +NS(R* +N*O 11,search,demo .A-8(S 2;'al><7 <'al?<7 S=SDA*(7 57 S=SDA*(7 57 56: +NS(R* +N*O 11,search,demo .A-8(S 2;'al@<7 <'alA<7 S=SDA*(7 57 S=SDA*(7 57 56: Now we ha'e ? records in our custom ta9le

-. Create a New #ntit. O$ject #O! Right click on SearchDemo " New " AD# $usiness !omponents " (ntity O9ject Name ) Search(O Package && prajkumar.oracle.apps. nd.searchdemo.schema.ser'er Data9ase O9jects && BB,S(AR!3,D(%O

Note / $y de ault ROW+D will 9e the primary key i we will not make any column to 9e primary key !heck the Accessors7 !reate %ethod7 .alidation %ethod and Remo'e %ethod

0. Create a New 1iew O$ject 1O! Right click on SearchDemo " New " AD# $usiness !omponents " .iew O9ject Name && Search.O Package && prajkumar.oracle.apps. nd.searchdemo.ser'er +n Step4 in (ntity Page select Search(O and shuttle them to selected list +n Step> in Attri9utes Window select columns !olumn17 !olumn4 and shuttle them to selected list +n Ca'a page Select /enerate Ca'a ile or .iew O9ject !lassD Search.O+mpl and /enerate Ca'a #ile or .iew Row !lassD Search.ORow+mpl

2. Add 3our 1iew O$ject to 'oot () Application Module Select Right click on SearchA% " (dit SearchA% " Data %odel " Select Search.O and shuttle to Data %odel list

4. Create a New Page Right click on SearchDemo " New " We9 *ier " OA !omponents " Page Name && SearchP/ Package && prajkumar.oracle.apps. nd.searchdemo.we9ui

5. Select the SearchP6 and go to the strcuture pane where a de&ault region has $een created

17. Select region1 and set the &ollowing properties8 +D && Page-ayoutRN

Region Style && Page-ayout A% De inition && prajkumar.oracle.apps. nd.searchdemo.ser'er.SearchA% Window *itle && Search Page Window *itle && Search Page Auto #ooter && *rue

11. Add a 9uer. :ean to 3our Page Right click on Page-ayoutRN " New " Region Select new region region1 and set ollowing properties +D ) EueryRN Region Style ) Fuery !onstruction %ode ) result$asedSearch +nclude Simple Panel ) *rue +nclude .iews Panel ) *rue +nclude Ad'anced Panel ) *rue

12. Add a 'esult ;ata +a$le to .our 9uer.'N Select EueryRN right click " New " Region using WiGard +n $!?C O9jects page7 Select your SearchA% and then select your Search.O1

Note / ;O NO+ select (se this as Application Module ;e&inition &or this region check9o1

+n Region Properties page7 set 'egion ); 'alue to 'esults+a$le and 'egion St.le to ta$le +n 'iew Attri9utes page7 select attri9utes rom A%aila$le 1iew Attri$utes list and shuttle them to

Selected 1iew Atri$utes listD !olumn1 !olumn4 +n Region +tems Page7 you can set +D7 Style and Attri9utes Set. !urrently we are going to set only Style as ,essageSt.led+e<t

1". Set and %eri&. 3our 'esults +a$le 'egion Properties +D ) Results*a9le Region Style ) ta9le A% ) Please Donot put any A% Rendered ) *rue Records Displayed ) 15 Width ) 155H 8ser PersonaliGation ) *rue

1*. Set or 1eri&. Colu,n1 )te, Properties Search Allowed && *rue Sort Allowed ) ascending +nitial Sort SeFence ) irst Selecti'e Search !riteria ) *rue 8ser PersonaliGation ) *rue

1-. Set or 1eri&. Colu,n2 )te, Properties Search Allowed ) *rue Sort Allowed && ascending

Selecti'e Search !riteria ) *rue 8ser PersonaliGation ) *rue

10. Congratulation .ou ha%e success&ull. &inished Search page. 'un 3our SearchP6 page and +est 3our Work

$mplement a 'earch 7age C' 2reate pro#ect :' 2reate Business 2omponent ,ackage ?train.oracle.apps.ak.empsearch.server= F' 2reate 6ntity ob#ect %6O' under the above package. 8' 2reate Application )odule %A)' under the package ?train.oracle.apps.ak.empsearch.server= Application )odule $ame: 2mplo/eeA! G' 2reate an 6mployee&to&)anager Association %AO' for the self& #oin condition on the ?F!BU/B9U6),0OP66= table. H' (elect ?)anager Id= in source table and (elect ?6mployeeId= in Destination table. Q' 2lick ?Add= button 2lick ?$e t= button and verify ?24pose Accessor= names. 2reate 1iewOb#ect %1O' to display the data on the page. .ere, 1O is based on 6O. (elect ?2mp8earch2O= ob#ect twice. /here are two entity ob#ects and linked the two 6os through Association Ob#ect %AO'.

CS' (elect $e t button, and select attributes from 6mp(earch6O and 6mp(earch6OC. CC' (elect below columns from 6mp(earch6O and 6mp(earch6OC. o 6mployeeId o Full$ame o 6mailAddress C:' 2hanges attribute name and alias as meaningful. 8elect Attrib&te 6mployeeIdC Full$ame Full$ameC 6mailAddress 6mailAddressC Attrib&te 7ame and Alias 7ame )anagerId and )A$AN6@UID 6mployee$ame and 6),0OP66U$A)6 )anager$ame and )A$AN6@U$A)6 6mployee6mail and 6),0OP66U6)AI0 )anager6mail and )A$AN6@U6)AI0

(elect 7e4t button, and observer Kuery. !e can change +uery, if you select the check bo ?24pert !ode=. CF' $ow, I want to include some other condition in the above +uery. NU2%O: (6062/ 6mp(earch6O.6),0OP66UID, 6mp(earch6O.F300U$A)6 A( 6),0OP66U$A)6, 6mp(earch6O.6)AI0UADD@6(( A( 6),0OP66U6)AI0, 6mp(earch6OC.6),0OP66UID A( )A$AN6@UID, 6mp(earch6OC.F300U$A)6 A( )A$AN6@U$A)6, 6mp(earch6OC.6)AI0UADD@6(( A( )A$AN6@U6)AI0, Flkp.meaning ,O(I/IO$UDI(,0AP F@O) F!BU/B9U6),0OP66( 6mp(earch6O, F!BU/B9U6),0OP66( 6mp(earch6OC, F!BU/B9U0OOB3,U2OD6(U10 flkp !.6@6 6mp(earch6O.)A$AN6@UID < 6mp(earch6OC.6),0OP66UID%[' A$D 6mp(earch6O.,O(I/IO$U2OD6<flkp.lookupUcode A$D flkp.lookupUtype<-F!BU/B9U,O(I/IO$((elect $e t button, and check mapping between Kuery 2olumns and Attribute names. (elect Finish button. C8' Add the 1iewOb#ect %2mplo/ee8&mmar/)O' to Application )odule. CG' (elect the application module %already created', and press right mouse button and select the option ?2dit 2mp8earchA!=, then select the ?1iewOb#ect=. CH' Attach the Application )odule %6mp(earchA)' to your OApage.

CQ' 2reate the item under ?Pa'e"a/o&t %e'ion=. /he item style is ?(tatic(tyled/e t=. 8et the below properties for the item+ Propert/ )al&e ID ,age.elp Item (tyle (tatic(tyled/e t Data/ype 1archar: 2(( 2lass OraInstruction/e t )essage Appl (hort $ame AB )essage $ame F!BU/B9U/U,AN6UN6$6@A0 /est the page once and check the output on the page. (ome te t will be displayed on the page above. $onfi'&re %28U"(=<A820 8earch+ CR' 2reate region with style ?;&er/= under page0ayout @egion. (et the below properties for the region ?;&er/%7=. Propert/ )al&e ID +uery@$ Item (tyle Kuery 2onstruction )ode @esult Based (earch Include simple panel /rue Include 1iew panel /rue Include Advanced search panel /rue CE' Adds a @esults Data table to ;&er/%7+ (elect the +uery@n and press right mouse button, then select option ?%e'ion &sin' Wi3ard=. :S' (elect the viewob#ect ?2mplo/ee8&mmar/)O= and select specified columns what you want to display on the OA,age. :C' (et below properties for ?@esults/able=. ::' (et the properties for columns under ?%es&lts(able=. !ow do display the drill down to details page according to criteria( 8teps:= *# 2reate view ob#ect with (K0 +uery.

/he +uery is: 82"2$( 2mplo/eeId A8 2!P"OO22PI0Q

2mplo/ee7ame A8 2!P"OO22P7A!2Q 9ob A8 9O<Q 8alar/ A8 8A"A%OQ 0eptno A8 02PA%(!27(P7U! F%O! 2!P ,# (elect the items style as ?)essage(tyled/e t=. -# Design the page with regions ?page0ayout %root region'= and ?default(ingle2olumn %(ub region'=. 5# !e can use ?region using wi7ard= option under the region style ?default(ingle2olumn= and then select displayed items by using the wi7ard. ># /he page name is ?6mployeeDetails,N. ml=. ?# $ow, we have to call the ?6mployeeDetails,N= page and pass parameters to this page from the other page %search page'. @# (et the property ?0estination U%I= as ?OA.#sp^ page<TtrainToracleTappsTakTemployeeTwebuiT6mployeeDetails,N]employee$ umber<Zc6mployeeId\]retainA)<P]ADDUB@6ADU2@3)B<P for the item ?6mployee$ame=. /he item ?6mployee$ame= style is ?)essage(tyled/e t=. $ow, the employee$ame item will be showing as ?"ink= E# $ow, we have to e ecute the +uery according to employeeId %depending on selection of emplo/ee7ame'. R# In viewob#ectimpl.#ava %employeeFull1OImpl.#ava' file, create method as below. $ode: import oracle.#bo.domain.$umberA import oracle.apps.fnd.framework.OA6 ceptionA public void initKuery%(tring employee$umber' Z If %employee$umberY <null' Z $umber emp$um<nullA /ry Z emp$um<new $umber%employee$umber'A \ 2atch%6 ception e' Z /hrow new OA6 ception%?AB=,= F!BU/B9UI$1A0IDU6),U$3)B6@='A \ set!here2lause%?6),0OP66UID<:C='A set!here2lause,arams%null'A set!here2lause,aram%S,emp$um'A e ecuteKuery%'A \ \

*C# From application!od&le, we can call view ob#ect procedure. $ode: public void initDetails%(tring employee$umber' Z 6mployeeFull1OImpl empvo<get6mployeeFull1OC%'A 6mpvo.initKuery%employee$umber'A

\ **# 2reate the $O7(%O""2% and call the procedure ?init0etails=. *,# !rite code in ?process@e+uest= method $ode: (tring empnum<page2onte t.get,arameter%?employee$umber='A OAApplication)odule am<page2onte t.getApplication)odule%webBean'A (eriali7ableIJ parameters<Zempnum\A Am.invoke)ethod%?initDetails=, parameters'A %es&lt: we can 'et the details of emplo/ee accordin' to emplo/ee I0+

!ow do display custom copy right on OAF page 8ol&tion: First, we have set the page0ayout region property ?A&toFooter= as False. %/his is very important'. (elect the page0ayout region, and press right mouse button, then select the option ?2opyright= and set the property ?prompt= as you wish. @un the page and observe the ?2opyright= prompt at footer of the page. !ow do get the value o" the chec+box when selected or deselected 8ol&tion: Bydefault, the checkbo returns ?on= when selected. /he checkbo returns ?null= when deselected.

According to ?on= and ?n&ll= values, we can do validation on the checkbo . $ode: !rite code in processForm%e;&est method for any button (tring val< page2onte t.get,arameter%Lchkbo L'A If %val.e+uals%=on= ''

(ystem.out.println%?)ale='A \ If %val<<null' Z (ystem.out.println%?Female='A \ http:""forums.oracle.com"forums"thread.#spa^ threadID<GQQHHH]start<S]tstart<CHG In this site, code has been given regarding get value of selected checkbo from 1O %Displayed multiple rows'

!ow do insert data "rom OAF 7age to Database table by using 2iew Ob8ect 8teps C' 2reate view ob#ect with +uery. :' 2reate application module and attach the view ob#ect F' 2reate OAF page and attach application module. 8' 2reate 2ontroller and write below code.

import oracle.apps.fnd.framework.OAApplication)oduleA import oracle.apps.fnd.framework.webui.beans.message.OA)essage/e tInputBeanA import oracle.apps.fnd.framework.webui.beans.message.OA)essage0ovInputBeanA import #ava.te t.(impleDateFormatA import #ava.te t.DateFormatA import #ava.util.DateA import #ava.te t.,arse6 ceptionA import oracle.apps.fnd.framework.server.OADB/ransactionA import #ava.s+l._A

!ethod: process%e;&est # __________________________________ public void process@e+uest%OA,age2onte t page2onte t, OA!ebBean webBean' Z super.process@e+uest%page2onte t, webBean'A OAApplication)odule am<page2onte t.getApplication)odule%webBean'A am.invoke)ethod%LinitKueryL,null'A \ !ethod: processForm%e;&est # SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS public void processForm@e+uest%OA,age2onte t page2onte t, OA!ebBean webBean' Z super.processForm@e+uest%page2onte t, webBean'A if %page2onte t.get,arameter%LApplyL'Y<null' Z try Z OAApplication)odule am<page2onte t.getApplication)odule%webBean'A "" Date updateUdate<page2onte t.get2urrent3serDate%'A "" (ystem.out.println%Lcurrent date<L[updateUdate'A OA)essage/e tInputBean supplierUid < %OA)essage/e tInputBean'webBean.find2hild@ecursive%L(upplie rIdL'A (tring supUidUt t<supplierUid.get/e t%page2onte t'A int supUid<Integer.parseInt%supUidUt t'A OA)essage0ovInputBean supUname < %OA)essage0ovInputBean'webBean.find2hild@ecursive%L(upplier $ameL'A (tring supnameUt t<supUname.get/e t%page2onte t'A OA)essage/e tInputBean onholdUflag < %OA)essage/e tInputBean'webBean.find2hild@ecursive%LOn. oldFlagL'A (tring onholdUt t<onholdUflag.get/e t%page2onte t'A (tring sdate<page2onte t.get,arameter%L(tartDateL'A "" Date startdateUt t<sdateA ""(ystem.out.println%Lstart date<L[df.format%startdateUt t''A (tring edate<page2onte t.get,arameter%L6ndtDateL'A "" Insert row into the table F!BU/B9U(3,,0I6@(

(tring task:Info < nullA ,repared(tatement ps,ro/ype < nullA @esult(et rs,ro/ype < nullA int task:/ype < SA 2onnection conn < am.getOADB/ransaction%'.get4dbc2onnection%'A task:Info < LI$(6@/ I$/O F!BU/B9U(3,,0I6@(%(3,,0I6@UID,$A)6,O$U.O0DUF0AN,(/A@/UDA/6,6$ DUDA/6,0A(/U3,DA/6UDA/6,0A(/U3,DA/6DUBP,2@6A/IO$UDA/6,2@6A/6 DUBP' 1A036(%:C,::,:F,:8,:G,(P(DA/6,S,(P(DA/6,S'LA ps,ro/ype < conn.prepare(tatement%task:Info'A ps,ro/ype.setInt%C,supUid'A ps,ro/ype.set(tring%:,supnameUt t'A ps,ro/ype.set(tring%F,onholdUt t'A ps,ro/ype.set(tring%8,sdate'A ps,ro/ype.set(tring%G,edate'A KK psPro(/pe+set8trin' #T ps,ro/ype.e ecute3pdate%'A am.invoke)ethod%LapplyL'A

\ catch%6 ception e' Z (ystem.out.println%Lerror<L[e.get)essage%''A \ ""ps,ro/ype.setDate%8,startdateUt t'A "" ps,ro/ype.setDate%G,edate'A \ \

Write below methods in Application !od&le which is correspondin' to 1iew ob6ect+ KK it is &sed to create row in 1iew ob6ect cacheQ and then &ser can enter and insert data into table+ public void initKuery%' Z (uppliers1OImpl vo<get(uppliers1OC%'A @ow row<vo.create@ow%'A vo.insert@ow%row'A \ KK it is for commit the transactionT otherwise not inserted the record into table+ public void apply%' Z get/ransaction%'.commit%'A \

,lease find the below screen shot. /he below data will be inserted into table when press the FAppl/G button. (ee below screenshot for output. !ow do re"resh the same page a"ter the data has been entered /here is A,I ?forwardImmediatel/(o$&rrentPa'e= used to refresh the same page when the user presses the submit button. Write below code in processForm%e;&est # method _____________________________________________________________ ___ import com.sun.#ava.util.collections..ash)apA .ash)ap params < new .ash)ap%'A page2onte t.forwardImmediately/o2urrent,age%params,true, OA!ebBean2onstants.ADDUB@6ADU2@3)BU$O'A !ow do set the values in poplist 8ol&tion:= *# $reate )iew Ob6ect )O# and write ;&er/ to displa/ the 1al&es in poplist+ )O 7ame: (uppliers0ist1O N&er/:= (6062/ OP6(O )6A$I$N,OPO 2OD6 F@O) D3A0 3$IO$ (6062/ O$OO )6A$I$N,O$O 2OD6 F@O) D3A0 *P6(- is used to show for user on the OAF page. *P- is used for internal purpose. /he value *P- will be stored into database when user selects *P6(-. 8et the properties for an item:= Propert/ Item (tyle ,icklist view Definition ,icklist Display Attribute ,icklist 1alue )al&e message2hoice train.oracle.apps.ak.suppliers.list.webui.(uppliers0ist1O )eaning 2ode


!ow do hide the speci"ied item when user selects the particular value "rom 7oplist 8ol&tion:= /he concepts ?partial pa'e renderin'= and ?8P2"= should be used to get this solution. I ha1e one poplist in OAF pa'e and the list has two 1al&es FO28G and F7OG+ If the &ser selects the 1al&e F7OGQ then the specified item sho&ld be in1isible on OAF pa'e at r&ntime+ 7ote: /his e ample followed above screen shot page. 8teps: *# 2reate properties view ob#ect %,1O' and create two attributes. i# %ow.e/ 8et the properties like below screenshot# ii# 2nd0ate%ender 8et the properties as per below screenshot#

:' (elect the option ?(&nin'= for the same properties 1O and select the check bo like below screenshot. F' Attach the properties1O %8&ppliers"istP)O' to application module %8&ppliersA!'. 8' 2onfigure the list item %onholdfla' item'. (et the below properties. Propert/ Disable (erver (ide 1alidation Disable 2lient (ide 1alidation Action 6vent (ubmit )al&e /rue /rue fire,artialAction onholdflag2hange /rue

G' 2onfigure the item which is invisible according to value of the list item. .ere, the invisible item is ?2nd0ate=. (o, set the below property for the item ?2nd0ate=. Propert/ )al&e



H' !rite below methods in application module %(uppliersA)Impl.#ava' p&blic 1oid onholdfla'$han'e # U OA1iewOb#ect vo < %OA1iewOb#ect'find1iewOb#ect%L(uppliers0ist,1OCL'A OA@ow row<%OA@ow'vo.first%'A OA1iewOb#ect suppvo<%OA1iewOb#ect'find1iewOb#ect%L(uppliers1OCL'A OA@ow supprow<%OA@ow'suppvo.get2urrent@ow%'A (tring onhold<%(tring'supprow.getAttribute%LOn.oldFlagL'A if %%onhold<<null'dd%L$L.e+uals%onhold''' Z row.setAttribute%L6ndDate@enderL,Boolean.FA0(6'A \ else Z row.setAttribute%L6ndDate@enderL,Boolean./@36'A \ V p&blic 1oid init # U OA1iewOb#ect app,rops1O<%OA1iewOb#ect'find1iewOb#ect%L(uppliers0ist,1OCL'A if %app,rops1OY<null' Z if %app,rops1O.getFetched@ow2ount%'<<S' Z app,rops1O.set)a Fetch(i7e%S'A app,rops1O.e ecuteKuery%'A app,rops1O.insert@ow%app,rops1O.create@ow%''A OA@ow row<%OA@ow'app,rops1O.first%'A row.setAttribute%L@owBeyL,new $umber%C''A \ \ onholdflag2hange%'A V

Q' R'

2all the init # method from process@e+uest. am.invoke)ethod%LinitL'A call the onholdfla'$han'e # method from processForm@e+uest

if %Lonholdflag2hangeL.e+uals%page2onte t.get,arameter%OA!ebBean2onstant s.616$/U,A@A)''' Z am.invoke)ethod%Lonholdflag2hangeL'A \ In the above code, the ?onholdflag2hange= is event name. /he event of the item will be worked as form=s&bmit. (o, the above code %event related' has been written in processForm@e+uest. @un the OAF page and change the value of the list item. /he item ?6ndDate= will not be rendered if the value of the list item is ?7O=. !ow do "ire event9 #o display supplier name according to supplier id+ /here are two te t items on OAF page. /hey are I' (upplierId II' (upplier$ame 8teps:= *# (et the below properties for item ?8&pplierId=. Propert/ )al&e Action fire,artialAction 6vent supplier$ame6vent (ubmit /rue ,# !rite below code in processForm@e+uest method.

if Bs&pplier7ame21entB+e;&als pa'e$onte4t+'etParameter OAWeb< ean$onstants+2)27(PPA%A!### U int s&ppPid J Inte'er+parseInt pa'e$onte4t+'etParameter B8&pplierIdB##T if s&ppPidJJ*R># U am+in1oke!ethod Bs&pplier7ame21entB#T V V -# !rite below method ?supplier$ame6vent= in an application module.

p&blic 1oid s&pplier7ame21ent # U OA)iewOb6ect s&pp1o J OA)iewOb6ect#find)iewOb6ect B8&ppliers)O*B#T

OA%ow s&pprowJ OA%ow#s&pp1o+'et$&rrent%ow #T s&pprow+setAttrib&te B8&pplier7ameBQB@amprasadB#T V 7ote: /he webBean properties can not be modified in processForm@e+uest method %24: set/e tA set$ame etc'. %es&lt: 6nter the value ?*R>= in supplier id te t item and press tab key, then the name ?%amprasad= will be getting displayed in supplier name te t item. !ow do create list box and add values to the list box dynamically 8ol&tion: First, create a message0ayout region under message2omponent0ayout region because we are creating "istbo4 item under ?messa'e"a/o&t= region using the below code. !rite below code in process%e;&est # method of 2O$/@O006@. import oracle.apps.fnd.common.1ersionInfoA import oracle.apps.fnd.framework.webui.OA2ontrollerImplA import oracle.apps.fnd.framework.webui.OA,age2onte tA import oracle.apps.fnd.framework.webui.beans.OA!ebBeanA import oracle.apps.fnd.framework.webui.beans.form.OADefault0istBeanA import oracle.apps.fnd.framework.webui.OA!ebBean2onstantsA import oracle.apps.fnd.framework.webui.beans.message.OA)essage0ayoutBeanA public void process@e+uest%OA,age2onte t page2onte t, OA!ebBean webBean' Z super.process@e+uest%page2onte t, webBean'A ""2reate 0ist !ebBean OADefault0istBean list < %OADefault0istBean'create!ebBean%page2onte t,OA!ebBean2onstants.D6F A30/U0I(/UB6A$, null, Lpositions0istL'A "" 8et the )iewob6ect nameQ displa/ attrib&te and 1al&e attrib&te for list bo4+ list.set0ist1iewOb#ectDefinition$ame%Ltrain.oracle.apps.ak.suppliers.list.webu i.(uppliers0ist1OL'A list.set0ist1alueAttribute%L2odeL'A

list.set0istDisplayAttribute%L)eaningL'A list.set)ultiple%true'A list.set$ame%L(upplier0istL'A OA)essage0ayoutBean listBo 0ayout < %OA)essage0ayoutBean'webBean.find2hild@ecursive%LlistBo 0 ayoutL'A listBo 0ayout.addInde ed2hild%list'A \ -reate a 'huttle *egion Followin' is a brief o&tline of the steps to create a 8h&ttle re'ion+ (tep C: 2reate a page with a pa'e"a/o&t region using OA 6 tension. )ake sure the Form property on the page0ayout region is set to (r&e. (tep :: (elect the page0ayout region in the (tructure pane, and choose 7ew > %e'ion from the conte t menu. (et the following properties on this new region %@e+uired properties are marked with _': _I0 & set the shuttleOs ID property in accordance with the OA Framework File " ,ackage" Directory (tandards. _%e'ion 8t/le & set the region style to sh&ttle. Add Inde4ed $hildren & make sure this property is set to (r&e, so that OA Framework automatically generates the web beans under this web bean hierarchy. /he default is (r&e. A1ailable :eader & specify the header te t of the first %leading' list. 8elected :eader & specify the header te t of the second %trailing' list. If you want to implement #ust one list for @eordering, that is, you do not want to shuttle items between two lists, then leave this property blank. Orderin' Allowed & set to (r&e if you want to enable ordering of the contents of the (elected %second or trailing' list. If you implement only one %leading' list in the shuttle region to create a @eordering region, then setting this property to /rue enables ordering on that leading list. /he default is False. 8tep -: /he (huttle region can have a ma imum of two list web beans, referred to as the leading and trailing lists. /he trailing list is omitted when you want to implement a shuttle region with a single list for the purpose of reordering the contents of that list.

!hen you define a shuttle region, OA 6 tension automatically creates a leadin' component for you, which contains a single list item. Be sure to set the following properties on the list item %@e+uired properties are marked with _': SI0 & set the listOs ID property in accordance with the OA Framework File " ,ackage" Directory (tandards. S!&lti=8elect Allowed & set to (r&e to allow the multiple selection of items in the list. /he default is False. Picklist )iew 0efinition & specify the fully +ualified view ob#ect name that is the data source to the 0ist web bean. %For e ample, oracle.apps.fnd.framework.server.FndApplication1O' SPicklist )iew Instance & alternately specify a view instance name for the data source of the list, if the ,icklist 1iew Definition is not available. $ote that setting this property overrides the ,icklist 1iew Definition property. %For e ample, FndApplication)O, which needs to be present in the Application)odule.' SPicklist 0ispla/ Attrib&te & specify the view attribute name that serves as the displayed values of the listOs content. SPicklist )al&e Attrib&te & specify the view attribute name that serves as the internal values of the listOs content. /his property, and not the ,icklist Display Attribute property, uni+uely identifies the elements in the list. Picklist 0escription Attrib&te & specify the view attribute name that serves as the descriptions of the listOs content. %endered & specify (r&e to render this list. S"ist :ei'ht & specify the suggested display height of the list, in characters. /he default is null. If this property is not set, the height is determined based on the lengths of both lists and their minimum and ma imum values. /he value should be in the range of CS to :S. 7ote: /he 0ist .eight is only a suggested value. Pour browser application and 3I9 determines the final 88H height of the list based on the number of items in the list and the si7e of the browser window. 8tep 5: /o create an optional trailing list, select the sh&ttle region in the (tructure pane and choose 7ew >trailin' from the conte t menu. OA 6 tension automatically creates a trailin' component for you, which contains a single list item. @efer to (tep F for the list of properties that you should also set on the trailing list item. )ake sure you specify names for the ,icklist Display

Attribute, ,icklist 1alue Attribute and ,icklist Description Attribute properties that match the corresponding property of the leading list item. 7ote: If you do not want to pre&populate the trailing list when the page initially renders, you can leave the ,icklist 1iew Definition, ,icklist 1iew Instance, ,icklist Display Attribute, ,icklist 1alue Attribute and Picklist0escription Attribute blank. OA Framework takes care of retaining user selected values in the trailing list when the page refreshes. 7ote: /he ,icklist 1alue Attribute uni+uely identifies the elements in a list, so if you want to pre&populate both the leading list and trailing list with data, be sure to set the ,icklist 1alue Attribute property to a different value for each list. (etting this property to the same value for both lists will result in undesirable behaviour, such as causing the values in the leading list to disappear. 8tep >: Pou can include buttons or icons in the footer of each list, as shown in Figure :. (elect the sh&ttle region in the (tructure pane, and choose 7ew > leadin'Footer %for a footer in the leading list' or 7ew > trailin'Footer %for a footer in the trailing list'. OA 6 tension automatically creates a leadingFooter or trailingFooter component, respectively, each containing a flow"a/o&t region. Pou can then add your buttons or icons to this flowlayout region. 7ote: If you set the %endered property to False for either the leading or trailing list, the leading or trailing footer also does not render, respectively. (ince the footer is directly linked to its respective list, if the list is not rendered, the footer is irrelevant. About 'tac+,ayout1 row,ayout1 cellFormat region styles !e can design layout like below screen shot by using the stack0ayout, row0ayout and cellFormat region styles. page0ayout@egion d&&&&&stack0ayout region d&&&&row0ayout region d&&&&&&&&&cellFormat region d&&&&&&&spacer %item style' d %width: 8SS' d&&&&&&&item %style: formatted/e t' %/e t: ;b>Authority For 6 penditure;"b> %Please look abo1e screenshot for res&lt' d&&&&&&stack0ayout region

d&&&&row0ayout region d&&&&cellFormat region d&&&&&spacer %item style' d %width: 8SS' d&&&&&item %st/le: formatted/e t' %,roperty (e4t: ;b>2o: CSC 999 6nergy Inc;"b>' d&&&&&&&&stack0ayout region d&&&&&row0ayout region d&&&&&cellFormat region d&&&&&& table region d&&&&& itemC %style: message(tyled/e t' d&&&&&cellFormat region d&&&&&& table region d&&&&& item: %style: message(tyled/e t' d&&&&&cellFormat region d&&&&&& table region d&&&&& itemF %style: message(tyled/e t' (et the properties for itemC, item: and itemF. /he properties are e ,rompt e 1iew Instance e 1iew Attribute %Please see table re'ion in abo1e screenshot for res&lt' :ow to displa/ te4t items side b/ side 8ol&tion:= page0ayout@egion d&&&&&stack0ayout region d&&&&row0ayout region d&&&&&&&&&cellFormat region d&&&&&&&item %message/e tInput' d&&&&&&&&&cellFormat region d&&&&&&&item %style: spacerT width: >C' (et the item properties for messa'e(e4tinp&t. /he properties are prompt, 1iew Instance and 1iew Attrib&te Please see abo1e screenshot for res&lt#+

About :rowser ,oo+ and Feel (B,A* A "ook=and=Feel "AF# controls the appearance of an OA Framework application. An 0AF provides the rendering logic for each component along with a look and feel&specific style sheet. /he OA Framework supports three 0AFs. M Oracle <"AF && implements the Oracle Browser 0ook&and&Feel %B0AF' 3I Nuidelines. M !inim&m "AF !"AF# && generates LminimalL content to reduce the si7e of ./)0 pages and overall network overhead %for e ample, this 0AF uses fewer images than the B0AF version' M Plain (e4t && produces a plain te t version of the page %typically used to send a plain te t version of a page to an e&mail client'. $ote that the plain te t 0AF does not support all the e isting component styles. 7ote: /he 0af2onstants class is in the oracle.apps.fnd.framework.webui.laf package. 24ample: OA.#sp^ page<"train"oracle"apps"ak"employee"webui"6mpDetails,N]employee$umb er<Zc6mployeeId\]retainA)<P]addBread2rumb<P] OA"AFJminimal 2all the page ?2mp0etailsPD= from any another page and observe appearance of the ?2mp0etailsPD=. ,lease find the below screen shot. %OA"AFJminimal'

From above screenshot, some te t is showing in green color. /ry for ?blaf= and ?oa(e4t= 0AFs like above. About Advanced#able :ean ,reviously, OA Framework used oracle.apps.fnd.framework.webui.beans.table.OA/ableBean, an Oracle Application implementation of 3I9 oracle.cabo.ui.beans.table./ableBean, to render tables. $ow oracle.apps.fnd.framework.webui.beans.table.OAAdvanced/ableBean e tends

OA/ableBean to provide declarative support for e isting table features that previously re+uired programmatic control. OAAdvanced/ableBean also provides declarative support for features not available with OA/ableBean, such as column span in a table column header. As of @elease CC.G.CS, oracle corp. recommend new tables be implemented as Ladvanced tablesL based on oracle.apps.fnd.framework.webui.beans.table.OAAdvanced/ableBean. Pou can create a table by specifying appropriate information in Oracle Ei 4Developer OA 6 tension. 2urrently, you can declaratively specify the following features"components"attributes on a table: $umber of rows to display in a table !idth of a table .eader te t for individual table columns 2olumn span in column headers /able formatting (ingle selection and multiple selection on a table and adding other controls to a selection bar (orting and initial sorting of a table on up to three columns /otalling a column Adding new rows Detail Disclosure @ow .eaders !rap (ettings Below is a brief outline of how to declaratively implement a table. Ad1ance(ablePD %. ml' d d&&&,age0ayout@egion d d&&&create region %style: ad1anced(ableT (et )iew Instance property' d d&&&create column d d&&&create item %style: messa'e(e4tInp&tT (et the )iew Attrib&te property' d&&&create column header %to display heading of the 2olumn and sort the data' M (et the prompt property in column header properties to display heading of the column %e ample: 6mployee $ame' M (et the property ?8ort b/ )iew Attrib&te= to sort the data based on column. %6 : & if ?(ort by 1iew Attribute= property value is ?2mplo/eeId=, then sort the data based on 2mplo/eeId attribute.' (ee below screen shot for reference. Design the table with other columns like above.

!e need to write code to display data like below screenshot.

2reate controller %2mpAd1anced$O' on ,age0ayout @egion. public void process@e+uest%OA,age2onte t page2onte t, OA!ebBean webBean' Z super.process@e+uest%page2onte t, webBean'A oracle.apps.fnd.framework.OAApplication)odule am < page2onte t.getApplication)odule%webBean'A am.invoke)ethod%LinitKueryAdvL'A ""create row and e ecute +uery \ No to the corresponding Application !od&le and write below code to create row and e ecute +uery. %i.e. pagelayout region A) Definition property value' import oracle+6bo+%owT public void initKueryAdv%' Z 6mployeeFull1oImpl empvo<get6mployeeFull1oC%'A @ow row<empvo.create@ow%'A empvo.insert@ow%row'A empvo.e ecuteKuery%'A \ In above code, the ?2mplo/eeF&ll)o*= is view ob#ect instance. 2ompile the code and run the page. !ow do display Add another row' button and totalling on column In Advanced/able, this is good feature to add row dynamically and display total on footer without write code. 0eclarati1e implementation (elect the Fad1anced(ableG region and press right mouse button and select the option ?footer=. After select the FfooterG optionQ the footer and tableFooter* components will be created. (ee below screenshot.

(elect the ?tableFooter*= and press right mouse button and select the option ?add(able%ow=. (ee below screenshot. @un the page once and you will get ?Add another %ow= button at the footer of advanced/able. (elect ?total= option to display total of particular column %salar/'. /he option ?total= showing in above screen shot. !e need to set one property ?(otal )al&e= as /rue for salary column %col&mn5 in below screen shot' and run the page. (ee the below screenshot to know the final output of advanced/able. % Add Another %ow button, %ecalc&late button and total value for salar/ column' After press the ?Add Another %ow= button, one blank record will be created. (ee below screen shot. 3ser selects the %ecalc&late button to update the column total. 7ote: T#e total displays a double precision summation of all visible ro!s in t#e table. T#e total reflects only t#e current visible records and not all t#e records -ueried. !ow do iterate the number/'erial %umber3 in OAF by using #ransient Attribute $ode: public void setItemDetails(no%' Z OA1iewOb#ect vo < %OA1iewOb#ect'get2)2ostchange1O%'A 2)2ostchange1O@owImpl row < nullA int fetched@ow2ount < vo.get@ow2ount%'A KK we &se a separate iterator == e1en tho&'h we co&ld step thro&'h the KK rows witho&t it == beca&se we donAt want to affect row c&rrenc/+ @ow(etIterator insertIter < vo.create@ow(etIterator%LinsertIterCL'A if %fetched@ow2ount > S' Z insertIter.set@ange(tart%S'A insertIter.set@ange(i7e%fetched@ow2ount'A

for %int i < SA i ; fetched@ow2ountA i[[' Z row < %2)2ostchange1O@owImpl'insertIter.get@owAt@angeInde %i'A KK For performance reasonsQ we 'enerate )iew%owImpls for all KK )iew Ob6ects+ When we need to obtain an attrib&te 1al&eQ KK we &se the named accessors instead of a 'eneric 8trin' look&p+ row.setAttribute%L($oL, new Integer%i[C''A ""87o is transient attrib&te in )O \ \ insertIter.close@ow(etIterator%'A \ 8ee below screenshot and check the 1al&es of serial n&mber 2heck the values of serial number in above screen shot. !ow do display latest serial number dynamically while creating row Write below code in proecessForm%e;&est !ethod of $ontroller+ $ode: oracle.apps.fnd.framework.OAApplication)odule am<page2onte t.getApplication)odule%webBean'A OAAdvanced/ableBean tableBean < %OAAdvanced/ableBean'webBean.find2hild@ecursive%LAdvancedtbl@ $L'A if %tableBean.get$ame%'.e+uals%page2onte t.get,arameter%(O3@26U,A@A)'' ]] ADDU@O!(U616$/.e+uals%page2onte t.get,arameter%616$/U,A@A)''' Z am.invoke)ethod%Lset(e+uence$umL'A \ 7ote: From above code, ADDU@O!(U616$/ is event name for ?Add Another %ow= button. Write below code in Application !od&le which is added to /o&r pa'ela/o&t re'ion+ Imp: 8et the propert/ Finsert rows a&tomaticall/G as False in add#able*ow; ob6ect at footer of ad1anced table+

public void set(e+uence$um%' Z (e+uence$umber1OImpl se+vo<get(e+uence$umber1OC%'A int fetched@ow2ount<se+vo.get@ow2ount%'A @ow(et rowset<se+vo.create@ow(et%LddL'A rowset.last%'A rowset.ne t%'A @ow row<se+vo.create@ow%'A rowset.insert@ow%row'A row.setAttribute%L(6@IA0$3)L,new Integer%fetched@ow2ount[C''A rowset.close@ow(et%'A \ %es&lt: Display (erial $umber %transient attribute' according to current row position dynamically after pressing the ?Add Another %ow= button. (ee below screen shot, after press the ?Add Another %ow= button $ew row is created and added onto table, and 8erial7&mber is also incremented %from H to Q' and displayed on table. (ee below screenshot. !ow do delete a selected record o" Advanced #able using Delete 'witcher 8ol&tion:= First add ?0elete 8witcher= item onto ?ad1anced(able= region. From above screenshot, C' /he ?delete(witcher= is a column of advanced/able region. :' /he ?Del(witcher= is a switcher under ?delete(witcher= column. %(et viewAttribute property to enable the delete(witcher item' %Add the column in 1O like below for delete(witcher. 2heck below decode statement. Add this in 1O' decode%$10%(e+uence$umber6O.O$U.O0DUF0AN,OPO',OPO, ODelete6nabledO, ODelete6nabledO' A( D606/6U(!I/2.6@ F' (et viewAttribute property as 0elete8witcher 8' 2reate ima'e item under case+ (et the imageID as F0elete0isabledG (et the image3@I property as FdeleteiconPdisabled+'if G G' 2reate second image item under second case. (et the imageID as F0elete2nabledG same as in 1O# (et the image3@I property as FdeleteiconPenabled+'if G H' (et the image items height and width as ?:8= Q' (et the action property for ?0elete2nabled= image as ?fireAction= and 6vent as ?delete=. (et the parameters property under 6vent property as below screenshot. From above screenshot, the value of $ame is ?s&pplier7U!=. It is used to get serial n&mber when user clicks the delete switcher at runtime.

)al&e: WUoa+8e;&ence7&mber)O*+82%IA"7U!V Xit is 8P2"Y After settin' abo1e propertiesQ !rite below code in Application !od&le for removing the selected record. public void delete(upplier%(tring (upplier$umber' Z int supp/oDelete < Integer.parseInt%(upplier$umber'A OA1iewOb#ect vo < %OA1iewOb#ect'get(e+uence$umber1OC%'A (e+uence$umber1O@owImpl row<nullA int fetched@ow2ount < vo.getFetched@ow2ount%'A (ystem.out.println%Lfetched@ow2ount L [ fetched@ow2ount'A @ow(etIterator deleteIter < vo.create@ow(etIterator%LdeleteIterL'A if %fetched@ow2ount > S' Z deleteIter.set@ange(tart%S'A deleteIter.set@ange(i7e%fetched@ow2ount'A for %int i < SA i ; fetched@ow2ountA i[[' Z row < %(e+uence$umber1O@owImpl'deleteIter.get@owAt@angeInde %i'A "" $umber primaryBey < row.get(upplierId%'A $umber primaryBey < row.get(6@IA0$3)%'A if %primaryBey.compare/o%supp/oDelete'<<S' Z row.remove%'A ""get/ransaction%'.commit%'A %if remove this comments, then the record will be removed from database' breakA \ \ \ deleteIter.close@ow(etIterator%'A \ In1oke abo1e method from $O7(%O""2%+ Write below code in processForm%e;&est method of $O7(%O""2%+ public void processForm@e+uest%OA,age2onte t page2onte t, OA!ebBean webBean' Z super.processForm@e+uest%page2onte t, webBean'A oracle.apps.fnd.framework.OAApplication)odule am < page2onte t.getApplication)odule%webBean'A if %LdeleteL.e+uals%page2onte t.get,arameter%616$/U,A@A)''' Z(tring supplier$umber < page2onte t.get,arameter%Lsupplier$3)L'A (eriali7ableIJ parameters < Z supplier$umber \A am.invoke)ethod%Ldelete(upplierL, parameters'A )essage/okenIJ tokens < Znew )essage/oken%L6),U$A)6L, supplier$umber'\A

\ From the 2O$/@O006@ code, the ?delete= is event name in ?Delete6nabled= image. /he ?supplier$3)= is value of (,60 ?W Uoa+8e;&ence7&mber)O*+82%IA"7U!V= %&n the pa'e and 'et below o&tp&t+ ,ress the 0elete switcher of any record and then check the output. $ow, the record still available in database because of not committed this transaction. After press the ?8a1e= button, the record will be removed from the database. If user wanted to show checkbo for on:oldFla' column, then we need to change the item style of the ?on.oldFlag= item as ?messa'e$heck<o4=. (et the below check bo properties checked1alue: O A unchecked1alue: 7 2heck the on:oldFla' values in above screenshots. !ow do clear the 2iew Ob8ect at runtime $ode: Write below code in Application 4odule( ,ublic void clear1O%' Z (upplierInfo1OImpl vo< get(upplierInfo1OC%'A vo.remove%' A\ -all above method "rom -O%#*O,,0* /processForm*e.uest3( OAApplication)odule am <page2onte t.getApplication)odule%webBean'A am.invokemethod%?clear1O='A Please see below screenshots After press the clear button, the data will be cleared. (ee below screenshot.

OA6 ception message < new OA6 ception%LABL, LF!BU/B9U/U6),UD606/6U2O$FI@)L, tokens, OA6 ception.2O$FI@)A/IO$, null'A page2onte t.putDialog)essage%message'A \

OAF 0irector/ 8tr&ct&re L "ocation of Files on 8er1er

All the standard OAF components delivered by Oracle fall under: V4A1AU/O,"oracle"apps"f directory.

(imilarly, any of our custom OAF application should go under: V4A1AU/O,"44c&st"oracle"appsf % cust is short name for our custom application'.

While r&nnin' o&r application from 90e1eloperQ there is no W9A)AP(OP+ 8o e;&i1alent director/ for W9A)AP(OP is H902)PU82%P:O!2IKm/classes+ when we create o&r pa'esQ all 6a1a and 4ml files 'et created in H902)PU82%P:O!2IKm/pro6ects folder+ :owe1er on compilin' the pro6ect correspondin' class files and 4ml files 'et 'enerated &nder H902)PU82%P:O!2IKm/classes+ @ight after oracle"apps, there is short name of an application that is registered within 6B( %like ic , fnd, po, etc'. $ow all we have to do is to create package structure for all components: 6ntity ob#ects: package name should end with .schema.server Application module: package name should end with .server 1iew ob#ects: package name should end with .server 1iew ob#ects %for 0O1s': package name should end with .lov.server

,age definitions ] controllers: package name should end with .webui

$reate and Update Pa'e in OAF

.ere are the steps for creating *6mployee create update- page. I have modified the search page created in previous post. *# $reate a new 2ntit/ Ob6ect 2O#: <<<<<<<<<<<<<<<<<<< @ight click on *emprec- package and create a new entity ob#ect %/his will open a wi7ard having G steps'. (tep C ,ackage: cus.oracle.apps.fnd.emprec.schema.server $ame: 9 6mployee6O (chema Ob#ect %in Database Ob#ect': 6),0OP66 2lick $e t.

(tep : Beeps default %all attributes selected'. 2lick $e t. (tep F If there is any primary key in DB table, then keep all defaults else select a primary key %like empno'. 2lick $e t. (tep 8 Beep defaults and click on $e t. (tep G Beep *Nenerate Default 1iew Ob#ect- uncheked and click on Finish. ,# $reate a new )iew Ob6ect )O# based on 2O created in *#: <<<<<<<<<<<<<<<<<<<< @ight click 5> $ew 1iew Ob#ect %/his will open a wi7ard having Q steps'. (tep C ,ackage: cus.oracle.apps.fnd.emprec.server $ame: 9 6mployee1O 2hoose the radio button *3pdatable access through 6ntity Ob#ects-. 2lick $e t. (tep : (elect the cus.oracle.apps.fnd.emprec.schema.server.9 6mployee6O from *Available- list and shuttle it to *(elected- list. 2lick $e t. (tep F )ove all the columns e cept !.O columns %last3pdate0ogin, createdByf' to *(elected- list from *Available- list attributes. 2lick $e t.

Beep defaults for step 8, G ] H. (tep Q (elect check bo es for *Nenerate 4ava File- for both *1iew Ob#ect 2lassand *1iew @ow 2lass-. 2lick Finish. Double 2lick on 9 6mployeeA) and shuttle 9 6mployee1O from *Available view ob#ects- to *Data )odel-. now there are two )O instances in A! :X42mplo/ee8earch)O* & X42mplo/ee)O*#+ -# 2dit 2mplo/ee 8earch Pa'e X42mplo/ee8earchPD#: <<<<<<<<<<<<<<<<<<<< %/his includes adding a *create button- at top ] *update- icon on every row in search result. )odified page will appear as below:'

(tep C @ight click on page0ayout@$ and add a new region. (et properties as below: @egion (tyle: pageButtonBar ID: pageBtnBar@$

@ight click on pageBtnBar@$ region and add a new item: Item (tyle: submitButton ID: createBtn ,rompt: 2reate 6mployee (tep : @ight click on 9 6mployee(earch1OC table region and add an item. (et the below properties: Item (tyle: Image ID: updateImg ,rompt: 3pdate Image 3@I: updateiconUenabled.gif Action /ype: fireAction 6vent: update6vent ,arameters: it will open a new window. Add a parameter as below: $ame: pUemp$um value: VZoa.9 6mployee(earch1OC.6mpno\ 5# $reate a new Update $reate pa'e: <<<<<<<<<<<<<<<<<<<< %.ere user can either create a new employee or can update e isting one. /he page will appear as shown below: '.

@ight click emprec 5> $ew 5> !eb /ier 5> OA 2omponents 5> select *,age- item. 2lick OB. %/his will open a popup window' !e are creating 6mployee 2reate 3pdate ,age, so specify the details of page as below: $ame: 9 6mployee2reate3pdate,N ,ackage: cus.oracle.apps.fnd.emprec.webui

$reate a new re'ion &nder pa'e"a/o&t of t/pe headerM $reate another re'ion &nder the header re'ion &sin' wi3ard %/his will open a wi7ard window having 8 steps': (elect *9 6mployeeA)- from Application )odule drop down and select *9 6mployee1OCb in available view usages. 2lick $e t.

2hoose region style as *default(ingle2olumn- from drop down. 2lick $e t. (huttle all the fields from available to selected attributes. 2lick $e t. 2hange the style to message(tyled/e t for 6mpno and message/e tInput for other remaining rows. Also modify the prompt to make it more user friendly %like emp$ame to 6mployee $ame'.

2lick $e t and finish.

%i'ht click on pa'e"a/o&t%7 and add a new re'ion (et properties as below: @egion (tyle: pageButtonBar ID: pageBtnBar@$ @ight click on pageBtnBar@$ region and add : new items of type submitButton: Item (tyle: submitButton ID: saveBtnA ID: cancelBtn prompt: (aveA prompt: 2ancel

7ow chan'e the properties for each field from propert/ inspector as shown below: page0ayout: ID: page0ayout@$ A) Definition: cus.oracle.apps.fnd.emprec.server.9 6mployeeA) !indow /itle: 6mployee 2reate 3pdate ,age /itle: 6mployee 2reate 3pdate header: ID: emp2reate@$

># $reate a new controller for Update $reate pa'e: <<<<<<<<<<<<<<<<<<<< (tep C (elect 9 6mployee2reate3pdate,N in navigator tab. Declarative form of page will be visible in structure tab. (tep : @ight click on page0ayout region 5> set new controller %/his will open a popup window'. 6nter the below details: package $ame: cus.oracle.apps.fnd.emprec.webui 2lass $ame: 9 6mployee2reate3pdate2O /he declarative page structure in #Dev will be similar to as shown below:

?# $ode for Performin' $reate & Update Operation <<<<<<<<<<<<<<<<<<<< 2atch the *create button- or *3pdate- event in ,F@ method of 9 6mployee(earch2O %controller of 9 6mployee(earch,N page' and navigate to *6mployee 2reate 3pdate ,age%9 6mployee2reate3pdate,N'. !e also pass a token %in the form of .ash)ap' to indicate whether it is a create or update operation.
view plaincopy to clipboardprint^

1. II >!7mployeeSearch O :: PFR 4. if (page onte!t.getParameter(/create%tn/& 0, null& '

(. *. +. -.

.. 1. I. if (/update7<ent/.equals(page onte!t.getParameter(7?73HOPAR AM&&& ' 56. String pOemp3um , page onte!t.getParameter(/pOemp3 um/&) 55. JashMap hm , new JashMap(&) 5". hm.put(/e<ent/, /update/&) 5(. hm.put(/emp3um/, pOemp3um&) 5*. page onte!t.Lorward@mmediately(/OA.KspM page,I!!cusIoracleIappsILndIemprecIwe$uiI>!7mployee reateDp datePN/, 5+. null, (byte&6, null, h m, false, null&) 5-. 8

JashMap hm , new JashMap(&) IIcom.sun.Ka<a.util.collect ions.JashMap) hm.put(/e<ent/, /create/&) page onte!t.Lorward@mmediately(/OA.KspM page,I!!cusIoracleIappsILndIemprecIwe$uiI>!7mployee reateDp datePN/, null, (byte&6, null, hm, fa lse, null&) 8

Once navigated to create page, we have to initiali7e the 9 6mployee1OC, so data entered by user in the fields can be mapped to its attributes. And in case of *update-, populate the records for the employee. !e write this code in ,@ method of 9 6mployee2reate3pdate2O %controller of 9 6mployee2reate3pdate,N page'. First we check if it is create or update event and will call a method from A) accordingly:
view plaincopy to clipboardprint^

1. II >!7mployee reateDpdate O :: PR method 4. public void processRequest(OAPage onte!t page onte!t, OA#e$
(. *. +. -. .. 1. 2. %ean we$%ean& ' super.processRequest(page onte!t, we$%ean&) am , page onte!t.getRootApplicationModule(&) if (/create/.equals(page onte!t.getParameter(/e<ent/&&& ' am.in<o=eMethod(/init reate7mp/&) 8

56. if (/update/.equals(page onte!t.getParameter(/e<en t/&&& ' 55. String emp3um , page onte!t.getParameter(/emp3 um/&) 5". Seriali9a$le:; param , ' emp3um 8) 5(. am.in<o=eMethod(/initDpdate7mp/, param&) 5*. 8 5+. 8

!rite below methods in 9 6mployeeA)Impl.#ava file:

view plaincopy to clipboardprint^

1. II >!7mployeeAM@mpl :: 4. public void init reate7mp(& '

(. *. +. -. .. 1. try ' >!7mployee?O@mpl emp reate?O , get>!7mployee?O5(&) emp reate?O.setMa!FetchSi9e(6&) >!7mployee?ORow@mpl row , (>!7mployee?ORow@mpl&emp reate?O.createRow(&)

II here we are setting the employee num$er using a C% S equence 2. 3um$er emp3um , getOAC%Hransaction(&.getSequence?al ue(/7MPPOQ77O3DM%7ROS/&) 56. row.set7mpno(emp3um&) 55. emp reate?O.insertRow(row&) 5". row.set3ewRowState(Row.SHAHDSO@3@H@AP@R7C&) 5(. 8 catch (& ' 5*. e.printStac=Hrace(&) 5+. 8 5-. 8 5.. 1J. public void initDpdate7mp(String emp3um& ' 52. try ' "6. >!7mployee?O@mpl employee?O , get>!7mployee?O5 (&) "5. employee?O.set#here lause(null&) "". employee?O.set#here lauseParams(null&) "(. employee?O.set#here lause(/7MP3O , :5/&) "*. employee?O.set#here lauseParam(6, emp3um&) "+. employee?O.setMa!FetchSi9e(A5&) "-. employee?O.e!ecuteGuery(&) ".. 8 catch (7!ception e& ' "1. e.printStac=Hrace(&) "2. 8


Finally, user can click on *(ave- button to commit the data or *2ancelto return back to search page. !e will catch the *save- or *cancel- button click in ,F@ method of 9 6mployee2reate3pdate2O and call a method from A) accordingly:
view plaincopy to clipboardprint^

1. 4.

II >!7mployee reateDpdate O :: PFR method public void processFormRequest(OAPage onte!t page onte !t, (. OA#e$%ean we$%ean& ' *. super.processFormRequest(page onte!t, we$%ean&) +. -. OAApplicationModule am , page onte!t.getRootApplic ationModule(&) .. 1. if (page onte!t.getParameter(/cancel%tn/& 0, null& ' 2. page onte!t.Lorward@mmediately(/OA.KspM page,I!!cusIoracleIapps 15. ILndIemprecIwe$uiI>!7mployeeSearchPN/, null, (byte& 6, null, null, false, null&) 55. 8 5". 5(. if (page onte!t.getParameter(/sa<e%tn/& 0, null& ' 5*. 5+. ISJere we are perLorming commit operation and returning $ac= to search page. Also we are Letching the updatedIcreated emp num so we can display a message on search pageS

1A. 1K. 1J.

I 52. "6. String sa<ed7mp , am.in<o=eMethod(/commit/&.toString (&) "5. JashMap hm , new JashMap(&) "". hm.put(/updated/, /Q/&) "(. hm.put(/empDpdated/, sa<ed7mp&) "*. page onte!t.Lorward@mmediately(/OA.KspM page,I!!cusIoracleIapps


ILndIemprecIwe$uiI>!7mployeeSearchPN/, null, (byte& 6, null, hm, false, null&) "-. 8 ".. 8

Below is *commit- method created in A)Impl class:

view plaincopy to clipboardprint^


public String commit(& ' "2. try ' (6. >!7mployee?O@mpl employee?O , get>!7mployee?O5 (&) (5. >!7mployee?ORow@mpl row , (>!7mployee?ORow@mpl &employee?O.Lirst(&) (". String sa<ed7mp , row.get7mpno(&.toString(&) ((. (*. (+. (-. (.. (1. 8 getOAC%Hransaction(&.commit(&) return sa<ed7mp) 8 catch (7!ception e& ' e.printStac=Hrace(&) 8

Below is code to display successful message on search page:

view plaincopy to clipboardprint^

>I. ?5.

II >!7mployeeSearch O :: PR method public void processRequest(OAPage onte!t page onte!t, OA#e$%ean we$%ean& ' *5. super.processRequest(page onte!t, we$%ean&) *". *(. if (/Q/.equals(page onte!t.getParameter(/updated/& && ' **. String updated7mp , page onte!t.getParameter(/ empDpdated/&) *+. throw new OA7!ception(/7mployee 3um$er / B upd ated7mp B *-. / has $een sa<ed success Lully./, *.. OA7!ception. O3F@RMAH@O3 &)

*1. *2. 8

)essage will be displayed after saving the data as shown below:

0ependent "O) in OAF

2oncept of dependent 0O1 is that, we select a value from one 0O1 field and based on that value, another 0O1 field will show filtered results. .ere, I have used two 0O1s: one for ,O .eaders and another for ,O 0ines. (o first, user will select a ,O .eader Id from 0O1C. As we are making these dependent, so 0O1: will show only those ,O 0ines that are related to ,O header Id selected.

*# $reate a new OA pa'e: <<<<<<<<<<<<<<<<<<<<<<<<<< @ight click on pro#ect % cus' 5> $ew 5> !eb /ier 5> OA 2omponents 5> select *,age- item. 2lick OB. %/his will open a popup window' !e are creating Dependent 0O1 page, so specify the details of page as below: $ame: 9 DemoDependent0ov,N ,ackage: cus.oracle.apps.fnd.dpndntlov.webui

,# $reate two new 1iew ob6ects )O#: <<<<<<<<<<<<<<<<<<<<<<<<<< First for PO :eaders @ight click %dpndntlov' 5> $ew 1iew Ob#ect %/his will open a wi7ard having Q steps'. (tep C ,ackage: cus.oracle.apps.fnd.dpndntlov.lov.server $ame: 9 ,o.eader0ov1O 2hoose the radio button *@ead&only Access- %as we are not performing any D)0 operation'. 2lick $e t. (tep : 6nter the below +uery in *Kuery (tatement-: select ,OU.6AD6@UID from poUheadersUall where rownum ;GS As there is no need to generate 1OImpl"1O@owImpl, keep defaults for stepF, 8, G, H ] Q and click Finish. (ave All. 8econd for PO "ines @ight click 5> $ew 1iew Ob#ect

(tep C ,ackage: cus.oracle.apps.fnd.dpndntlov.lov.server $ame: 9 ,o0ines0ov1O 2hoose the radio button *@ead&only Access-. 2lick $e t. (tep : 6nter the below +uery in *Kuery (tatement-: select ,OU.6AD6@UID, ,OU0I$6UID from poUlinesUall Beep defaults for stepF, 8, G, H ] Q and click Finish. (ave All. -# $reate a new Application !od&le A!#: <<<<<<<<<<<<<<<<<<<<<<<<<< (tep C ,ackage: cus.oracle.apps.fnd.dpndntlov.server $ame: 9 DemoDependent0ovA). 2lick $e t. (tep : .ere we will add an instance of the 1Os created in %:'. (elect 9 ,o.eader0ov1O ] 9 ,o0ines0ov1O from *Available 1iew Ob#ects- and shuttle it to *Data )odel- using ?>= button. Beep defaults for all other steps %F, 8'. 2lick Finish. 5# $reatin' the Pa'e "a/o&t & 8ettin' its Properties: <<<<<<<<<<<<<<<<<<<<<<<<<< ,age will appear as below :

C' 2reate a new region under page0ayout of type default(ingle2olumn. :' 2reate : items under default(ingle2olumn region %message0ovInput, message0ovInput'. $ow change the properties for each field from property inspector as shown below: page0ayout: ID: page0ayout@$ A) Definition: cus.oracle.apps.fnd.dpndntlov.server.9 DemoDependent0ovA) !indow /itle: Dependent 0O1 Demo ,age /itle: Dependent 0O1 Demo default(ingle2olumn: ID: single2ol@$A /e t: ,O 0ines Dependent on ,O .eader message0ovInput %for ,O .eader': ID: po.earder0ov ,rompt: ,O .eader ID message0ovInput %for ,O 0ines': ID: po0ine0ov ,rompt: ,O 0ine ID

$reatin' "O) re'ions: 6 pand po.earder0ov 0O1, right click on regionC and create a new region using wi7ard. (tep C select *9 DemoDependent0ovA)- from Application )odule drop down and select *9 ,o.eader0ov1OCb in available view usages. 2lick $e t. (tep : choose region style as *table- from drop down. 2lick $e t. (tep F (huttle all the fields from available to selected attributes. 2lick $e t. Also modify the prompt to make it more user friendly %like ,O .eader ID'. /his will create an item *,o.eaderId- under *9 ,o.eader0ov1OCb table region. (et search allowed property to /@36 for the item created. lov)apC: 0O1 region item: ,o.eaderId @eturn item: po.earder0ov 2riteria item: po.earder0ov (imilarly, create 0O1 region for po0ine0ov choosing 9 DemoDependent0ovA) as A) and 9 ,o0ines0ov1OC as view ob#ect. )odify the prompt to ,O 0ines ID. /his will create : items *,o.eaderIdCb ] *,o0ineId- under *9 ,o0ines0ov1OCb table region. (et search allowed property of *,o0ineId- to /@36.

lov)ap:: 0O1 region item: ,o0ineId @eturn item: po0ine0ov 2riteria item: po0ine0ov :ereQ in lo1!ap-Q we are makin' this dependent on first "O) b/ settin' criteria item as 1al&e of first "O) field+ lov)apF: 0O1 region item:,o.eaderIdC $riteria item: po:earder"o1 /he declarative page structure in #Dev will be similar to as shown below:

$ow select a value %,O .eader Id' from 0O1C such as 8 %as shown in above screenshot'. ,erform a search on ,O 0ine ID 0O1. /his will show only those lines whose header Id is 8.

Below is screenshot for the same:

PP% Partial Pa'e %enderin'# in OAF

!hile developing pages, we may face some scenarios where the re+uirement is to make modifications on the current page itself, instead of navigating to different page. (uch as selecting an item from a choice list might result in modifications to other fields or clicking a button to add a new row in table region and many more like these. All these tasks can be performed by simply refreshing the page however this could result in performance issues. Another alternative is to use #ava(cript which will give faster results but implementing comple functions can be a tough #ob using #ava(cript. 3I9 Framework provides a solution for this: Partial Pa'e

%enderin' i.e. to re&render only a limited portion of a page. Workin' of PP% := <<<<<<<<<<<<<<<<<<<<<<<<<< ,,@ is a three step process:

*# Partial pa'e e1ent ,artial page events are +uite similar to full page events. .owever, there are two important differences between partial and full page events. First, partial page events specify partial page rendering& specific event parameters which are not present on the full page event e+uivalents. For e ample, partial page events may include an event parameter which identifies the set of partial targets, or nodes that should be re&rendered. /he second difference between partial page events an full page events is how the events are sent. 3nlike full page events, partial page events must be sent in a way which does not force the browser to reload the current page. /o implement this capability, 3I9 ,,@ uses a hidden iframe as a communication channel between the browser and the web application running on the middle&tier. ,artial page events are sent by forcing a navigation in the hidden iframe, which in turns causes a re+uest to be sent to the application on the middle&tier. (ince the iframe is hidden, the process of sending a partial page event and rendering partial page contents can take place behind the scenes, without discarding the contents of the current page. ,# Partial Pa'e %enderin' Pass !hen the partial page event is received by the application, the application responds by determining the set of partial targets to render and performing the partial page rendering pass. /he partial page rendering pass is similar to a full page rendering pass. In both cases, the 3I$ode tree is traversed by calling render%' on each node in the tree. .owever, in the ,,@ case, only the contents generated by the partial targets are actually sent back to the browser. All other contents are dropped. (o, the partial page response is generally much smaller, since only the modified contents are sent back to the browser. -# Partial Pa'e %eplacement

!hen the browser receives the partial page response, the new contents for each partial target node are copied from the hidden iframe into the main browser window, replacing the e isting contents for each target node. For e ample, in the table navigation case, rather than replacing the entire page, #ust the contents of the table itself are replaced. $ow lets create a simple page to implement ,,@. In this page, there are F items %employee number, employee name ] #ob'. I have attach a ,,@ event on employee number field. .ence, user will enter the emp number and as soon as he tabs out, name and #ob will populate on their respective fields without refreshing the page. *# $reate a new OA pa'e: <<<<<<<<<<<<<<<<<<<<<<<<<< @ight click on pro#ect % cus' 5> $ew 5> !eb /ier 5> OA 2omponents 5> select *,age- item. 2lick OB. %/his will open a popup window' !e are creating a page for implementing ,,@, so specify the details of page as below: $ame: 9 ,prDemo,N ,ackage: cus.oracle.apps.fnd.pprdemo.webui

,# $reate a new 1iew ob6ects )O#: <<<<<<<<<<<<<<<<<<<<<<<<<< @ight click 5> $ew 1iew Ob#ect %/his will open a wi7ard having Q steps'. (tep C ,ackage: cus.oracle.apps.fnd.pprdemo.server $ame: 9 ,prDemo1O 2hoose the radio button *@ead&only Access- %as no D)0 operation'. 2lick $e t. (tep :

6nter the below +uery in *Kuery (tatement-: select 6),$O, 6$A)6, 4OB from employee Beep defaults for stepF, 8, G, H ] Q and click Finish. (ave All. -# $reate a new Application !od&le A!#: <<<<<<<<<<<<<<<<<<<<<<<<<< (tep C ,ackage: cus.oracle.apps.fnd.pprdemo.server $ame: 9 ,prDemoA). 2lick $e t. (tep : .ere we will add an instance of the 1O created in %:'. (elect 9 ,prDemo1O from *Available 1iew Ob#ects- and shuttle it to *Data )odel- using ?>= button. Beep defaults for all other steps %F, 8'. 2lick Finish. 5# $reate a new $ontroller $O#: <<<<<<<<<<<<<<<<<<<<<<<<<< @ight click on page0ayout region and create a new controller: $ame: 9 ,prDemo2O package: cus.oracle.apps.fnd.pprdemo.webui

># $reatin' the Pa'e "a/o&t & 8ettin' its Properties := <<<<<<<<<<<<<<<<<<<<<<<<<< /he page will appear as below:
















%message/e tInput, message(tyled/e t, message(tyled/e t'. $ow change the properties for each field from property inspector as shown below: page0ayout: ID: page0ayout@$ A) cus.oracle.apps.fnd.pprdemo.server.9 ,prDemoA) !indow /itle: ,,@ Demo ,age /itle: ,,@ Demo default(ingle2olumn: ID: single2ol@$ /e t: 6nter 6mployee $umber message/e tInput %applied ,,@ event on this item': ID: 6mpno ,rompt: 6mployee $umber Action (/pe: firePartialAction 21ent: pop&lateFields message(tyled/e t %for 6mployee $ame': ID: 6name ,rompt: 6mployee $ame 1iew Instance: 9 ,prDemo1OC 1iew Attribute: 6name message(tyled/e t %for 4ob': ID: 4ob ,rompt: 4ob 1iew Instance: 9 ,prDemo1OC 1iew Attribute: 4ob Definition:

/he declarative page structure in #Dev will be similar to as shown below:

!e will capture populateFields event %,,@ event' in ,F@ method of controller and call the appropriate method from A)Impl class as shown in below code snippet:

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean);

OAApplicationModule am = pageContext.getRootApplicationModule();

if ("populateFields".equals(pageContext.getParameter(EVENT _PARAM))) { String empNum = pageContext.getParameter("Empno"); if (!("".equals(empNum.trim()))) { Serializable[] param = { empNum }; String result = am.invokeMethod("firePprEvent", param).toString(); if ("N".equals(result)) { throw new OAException("Please enter valid employee number.", OAException.ERROR); } } else { String empnum = null;

Serializable[] param = { empnum }; am.invokeMethod("firePprEvent", param); throw new OAException("Please enter employee number", OAException.ERROR); } } }
2ode for fire,pr6vent method in 9 ,prDemoA)Impl.#ava file:

public String firePprEvent(String empNum) { try { XxPprDemoVOImpl vo = getXxPprDemoVO1(); vo.setWhereClause(null); vo.setWhereClauseParams(null); vo.setWhereClause("EMPNO = :1"); vo.setWhereClauseParam(0, empNum); vo.setMaxFetchSize(-1);

vo.executeQuery(); XxPprDemoVORowImpl row = (XxPprDemoVORowImpl)vo.first(); if (row == null) { return "N"; } } catch (Exception e) { e.printStackTrace(); } return "Y"; }
3ser will enter employee number and tabs out. /his will auto&populate the other two fields without full page refresh as shown below:

=ow to handle PP' e%ents in +a$le regions in OA Fra,ework

3ello all7 + ha'e one ta9le region where + am creating A rows 9y de ault. Now + ha'e a reFuirement wherein a ter selecting one poplist7 + want to ire a PPR e'ent and disa9le that row. +n this case we ha'e to tell OA# which row to use. We achie'e this using row'e&erence. + anyone ha'e similar reFuirement7 try to use 9elow code or get 9ack to me. +n controller classD String e'ent L page!onte1t.getParameter2M e'entM6: i 22MclauseM6.eFuals2e'ent66 N OO /et the identi ier o the PPR e'ent source row String rowRe erence L page!onte1t.getParameter2OAWe9$ean!onstants.(.(N*,SO8R!(,ROW,R(#(R(N !(6: SerialiGa9lePQ parameters L N rowRe erence R: am.in'oke%ethod2Mnon(dita9leM7 parameters6: R +n Application Module8

pu9lic 'oid non(dita9le2String rowRe erence6 N try N OA.iewO9ject p.O L 2OA.iewO9ject6 getBB$!R14*ranslation.O126: Row poRowPQ L p.O.getAllRows+nRange26: OARow row L 2OARow6 indRow$yRe 2rowRe erence6: i 2M(ND+#M.eFuals2row.getAttri9ute2M!onditionM66SS M(-S(M.eFuals2row.getAttri9ute2M!onditionM66 6 N row.setAttri9ute2Mtrans ielddisa9leM7 $oolean.*R8(6: System.out.println2Mdisa9ling ieldM6: R R catch 2(1ception e6 N R R