Saturday, 11 June 2016

ADF Equivalents of Common Oracle Forms Triggers : Pre-Query (Query Processing)

Hello all  ,
today i have in my office have an use case , in which i have apply the "Oracle Forms Triggers in adf "
, i have done it by simply some tricky way ,

so then i decide to write blogs about the
"Equivalents Of Common Oracle forms Triggers", 
in which i will describe how can we achieve the oracle forms like behavior in ADF,

Today's Discussion:
                                  For this time i have select the Pre-query trigger from the category of Query Processing.

first of all let us know the functionality of Pre-Query trigger ,

Pre-Query Trigger:
                                      as we know the trigger is   
"a special kind of stored procedure that automatically executes when an event occurs in the database server"
so a Pre-Query trigger is :
Execute logic before executing a query in a data block.
know let us look how can we do it in ADF.

i will use the HR schema , and for the sake of simplicity just show the some sop in log window to ensure the result 

Solution :

here are simple steps you have to follow to achieve this , 

step1:
           first of all create simple application and create the entities and viewobjects of Departments And employees tables , 

step2
          Now double click on one of your view object say
DepartmentsView --> overview ---->Java --> click on pencil button on right top as in figure


Step3:
this will open a window in front of you , check the GenerateViewObject class and under this check the "Include Custome Java data Source Methodes"
as in figure


Thursday, 9 June 2016

Oracle Forms Functionality in Oracle ADF : Using 'Enter' key Instead of 'Tab' in af:form

hello all ,

inspiration from the use case which  have encountered in last days , i decide to share my learning


Today's Discussion :

the use case is pretty simple that
 "How can we use Enter key instead of Tab key in af:form in ADF application just like in Oracle forms "

so here is the simple and brief solution about this use case 
i will use java script function and client listener for this 
i am using jdeveloper Studio Edition Version 11.1.2.3.0 11gR2

step 1:

first of all create the simple application base on HR Schema and cretae the Employees view object and based on employees entity and then drag it as Form on page just like below

step 2:

now go to page source and paste this javascript code :

<af:resource type="javascript">
function myonkeypressbookdate(componentEvent)
{
    var evt = componentEvent.getNativeEvent();
    var keyCode = AdfAgent.AGENT.getKeyCode(evt);  

    if (AdfAgent.AGENT.getKeyCode(evt) == 13) // 13 is ENTER
    {
        AdfFocusUtils.focusNextTabStop(componentEvent.getNativeEventTarget());
    }
    
}
 </af:resource>



step 3 

now back to the design mode of page and select one of inputtext from form and then drag 
af:clientlistener from component pallet set the properties as below:
for example i have seleted firstName and set the property as 


<af:inputText value="#{bindings.FirstName.inputValue}" label="#{bindings.FirstName.hints.label}"
                              required="#{bindings.FirstName.hints.mandatory}"
                              columns="#{bindings.FirstName.hints.displayWidth}"
                              maximumLength="#{bindings.FirstName.hints.precision}"
                              shortDesc="#{bindings.FirstName.hints.tooltip}" id="it2">
                    <f:validator binding="#{bindings.FirstName.validator}"/>
                    <af:clientListener method="myonkeypressbookdate" type="keyPress"/>
                </af:inputText>

or as in figure:


now run the page press CreateInsert , the focus will be on FirstName , 
 Press Enter key insted of tab , you will see the focus navigate to next Inputtext for example Last Name
 :) 

Note: 

             but for using Enter Key for all input text we have to write the class which cretae client listener to all inputtext present on page 

just a 2 step more , 

Wednesday, 25 May 2016

ADF Application : Best Practices : Packaging

Introduction:

hello to all of you ,

today , the 25 may of 2016 ,

me Zeeshan Ali is going to publish my first blog :)

in my blog spot i will discuss and share my knowledge about Oracle ADF Development ,
literally speaking i am a student of ADF currently working as an ADF Developer in an effluent Organization of the state , going towards the professionalism nature of Oracle ,
hope you all of like my blogging

Zeeshan

Today's Discussion :

as my first blog , i will start from the just beginning of the basics of Oracle Application Development Framework  ,

it is a common practice that when we start development , while we are come across a situation where too many entities, their view objects , vile links , and view accessors will be created , and with the

so the best practice is to use Packaging feature of jdeveloper.

it will help to find the view objects easily.

lets see how it will be helpful for us.


i have created two application (just for explaining Packaging )

first snap shot is about that application which have no any setting about Packaging
i.e


if you go in you jdeveloper

Tool ----> Preferences --------> and select ADF bussiness Components ---> Packaging

you will see the window like this



Now for Using Packaging feature you have to set the parameter like this



now if you will  create new application then this settings will take effect and
when you cretae bussiness components (entities,viewobjects,vielinks,accessors etc)
then they all will be in defined packages like this




thats it .


Packaging is cool Feature Of any IDE , and in j developer you can use it in either way as you can use your custom name packages about individual module .
:) :) :)


Regards
ZeeShan Ali Shoban

ADF Development