Friday, April 26, 2013

Task Flow And Switcher Example


The next example show how to switch between two fragments in the same task flow by using the switcher .

Use Case : The user can explore the hierarchy of departments and explore the hierarchy of employees by selecting from the menu in the left corner of the screen 

The hierarchy of departments


The hierarchy of employees

One of the solutions that can be used is the use of dynamic region, but in my case I will use a different technique which consists of a single task flow with 2 fragments and switcher

Implementation steps :
  1. create a task flow (fragment)
  2. create a switcher and 2 fragments , one for  hierarchy of departments and one for hierarchy of employees
  3. define cases for the switcher
  4. add the task flow to a consumer page as a region 
  5. create menu and add setPropertyListener to menu items
  6. add partial trigger to the region 
  7. change Refresh' property for the task flow to "if needed"

Create the task flow with 2 page fragments and add the navigation cases 


create the region for the hierarchy of departments 


create the region for the hierarchy of employees 



Define a parameter in  the parameters section 


Define the cases of the switcher  :
if the value of choiceParam == 'dept' then go to hierarchy of departments
if the
value of choiceParam == 'emp' then go to hierarchy of employees



Add the task flow as a region to a consumer page
create a menu model
Add partial trigger for the region 


Add SetPropertyListener to menu items



In the consumer page :
  • go to the page definition
  • pass the value of the menu item to the task flow
  • change refresh ' property to "ifNeeded"


Monday, April 15, 2013

Entity Object based on Synonym issue


We have HR and Finance Database , in the schema of Hr we need to create an Entity Object Based on Synonym in Financial database.
when running wizard to create ADBC , we can't see any Eo or Vo !
I will explain how to reproduce the problem and how to solve it

The Design of the Database :
  • Ben_View is DB View in Finance
  • HR have the privilege to select data from Ben_View
 
 

Now start ADFBC wizard


Choose connection
 

choose Synonym only


Create Entity Object


Create View Object


Create Application Module


The result is ....... !!!
No Entity Object or View Object  , just Application module !


I have tried repeating the above steps with another synonyms and the result was good and normal !

ok , now let's look at Ben_View , Ben_View composed of two query and this is the difference between it and other synonyms 


the solution is very easy , we need to add primary key for Ben_View when creating EO.
i will create EO and add PK to it 


Now we can see EO inside the project