Whenever we write any code in OAF we generally have some reusable code that is common in all projects which can be modified according to the requirements. In this article we will see some simple code snippets that will be used in OAF and reduce your development time:
This is for beginners and not for OAF Experts :).
Don't have an Vision instance to practice these tutorials? Visit http://cholagls.com/products-/11i-virtual-machine for details.Our smart solution to smart people like you !!
If you have a requirement where you need to foward the page to another page after certain operation then you use the below statement: For example lets say you have a login page and after you give the correct user name and password you need to navigate to another page then after checking if the details entered are correct then give the statement to forward the page to another page.
Change the page name as per your requirement:
For retrieving the value that is given in a page we use the below statement:For example if you need to check is the value entered in the text input is correct then you need to first retrieve the value for checking.
Here UserName is the ID of the messageTextInput.
For invoking a method in the AM which needs input we need to create parameters and then invoke the method:
Here in the above code what we are doing is we are creating serializable parameters named parameters which contains 2 variables userName and password. After doing so we are invoking the method "initDetails" in the AM with the parameters created.
For displaying any confirmation message on top of the page we need to create a new message by loggin to the application and then use the below code:
Message Code - FWK_TBX_T_EMP_LOGIN_CONFIRM
Short Name - FND
In the above code we pass 2 paramters to the message created and then the message with the code FWK_TBX_T_EMP_LOGIN_CONFIRM is retrieved from the application and then displayed.
To check if the button has been pressed or not :
Here Create is the ID of a submitButton. To check if the create button is clicked we use the above statement.
To execute a query and set a where clause:
Here we are setting the where clause for 2 parameters that is userName and password. This is going to check the values we retrieved and then execute the query.
To disable a button or any item use the below code:
You have various beans for the items that you wish to disable or set the rendered property to true or false.Here in this example it the submit button so I have used SubmitButtonBean.
Here Save1 is the ID of the submitButton item.
To set the value of an item from the VO:
Here we have set the item style of the ResoureNumber to FormValue. At run time we retrive the VO name and set that VO and the attribute.
To clear the cache and to reset the state of the AM use the below code:
To set a transaction value:
To remove the transaction value that we set:
Â
Â
Related Posts:

lakshmanan
said:
|
... HI Aarthi! i want ur help in oracle scm inventory module. how to update physical inventory count data. becoz 15000 onhand item code stock is will be updating. how to do this process. through API OR WEB-ADI pls give me any packages and documents. and ur advice. i want ur mail id this is my mail id pls send any document this mail id : rtlakshmanan@gmail.com Thanks &Regards, lakshmanan T |
|


















