Hi all,
In Oracle ADF you can create JSF pages which includes page fragments (A page fragment is a JSF JSP document (file extension is .jsff) that renders as content in another JSF page).
The purpose of page fragments is nothing but re-usability. You can use the same page fragments on different pages with the help of bounded task-flows. The pages with fragment could appears as Regions (fixed visibility) on JSF page you can also create pages with Dynamic Regions (Dynamically visibility on run-time based on some action or condition).
In this example i will create 2 Bounded task flows called "dept-flow" and "emp-flow" with page fragments respectively and later i will display both fragments on a single page as simple Regions.
The result would be like this
Note: Few of the following steps are not important to create pages with Regions but would helpful to understand the concept with examples specially for people coming from 4GL background.
I assumed that you have already setups the project with Hr Connection, employees, departments EOs with default VOs and AM (if you new to ADF please check the my older posts)
Creating Bounded Task flows and Page Fragments:
- First step is to create bounded task-flow. Right click Choose New on ViewController Project and select ADF Task Flow in Web Tier > JSF category
- Named it as "dept-flow" as shown in the slide make sure Create as Bounded Task Flow and Create with Page Fragments already selected.
- Drop a View activity named it as "dept" on the Task flow double click it and create a page with fragments.
Note: Change the directory at the end as public_html\fragments to keep your fragments separate
- Create the dept page as shown in the slide by dropping a vertical panel splitter and ADF read-only table at the first facet and ADF form in the second facet both from DepartmentsView DataControls iterators (as shown in the slide)
- Set the Partial trigger property of the Form panel layout component so it will change its data according to the af:table for DepartmentsView
- Repeat the all above steps for emp-flow by creating new bounded Task flow
- Create emp page based on Single strech column apply a theme to it
- Drop simple EmployeeView Iterator from Data control to the new Page fragment as ADF Read-only Table.
Now you are complete with your page fragments time to move on to next step
Creating JSF page to display Page Fragments
- Right click choose new on ViewController Project choose JSF page
- Choose Template as 3 Column Template
- The page would appear like this
- Drag and Drop the dept-flow from Application Navigator to the end facet of the new page a menu will appear choose Create > Region as shown in the slide
- Repeat the same step and drop the emp-flow to the center facet
- Create a AdfOutputText in the start facet and set value to "Page Fragments Example" your page at design time would looks like this
Note that our both regions are not editable on this page if you want to do any changes go to actual page fragment and change it.
- Right click and choose Run you will see the following page on run-time.
Conclusion:
As you have seen with Oracle ADF Web development becoming easy and fun. ADF Task flow is powerful feature of Oracle ADF which provides a great usability and provides a modular approach defining control flow in the application and Page fragments gave us re-usability.
You can Download the working example
Happy Jdeveloping,
Baig
very usefull tutorial
ReplyDeleteI have some requirement in adf search, i have three tables all the tables contains one of the column name as ID, and remaining are different fields. three tables are independent.
ReplyDeletewhat my requirement is in search panel with table, i want search to enter id filed and tables name as drop down or radio button to search ID details from the particular table.
please let me know this is possible in adf search or give me some alternatives on the same.
Hi Shankar,
ReplyDeleteI think i saw your thread at OTN forums which is best for this kind of discussions I am just sharing the link here https://forums.oracle.com/forums/thread.jspa?threadID=2364785&tstart=0
ZB
Hi ZB,
ReplyDeleteThank you very much for sharing experiences. By the way, I can't download example. Please help to me.
Regards
KT
hi ,
ReplyDeletei want to display the results of clicking a button in a different fragment while my button is in different fragment. pls help me on this issue.
Regards
Mritunjay
Thats exactly what is happening in the post. My Button is in different fragment.
DeleteYou can also pass parameter to task flow from button.
The example link does not work
ReplyDelete"The file link that you requested is not valid. "
Hi,
DeleteYes the link was 4shared account which is lock. I have moved my all samples to Google code account.
You can follow the example to build similar i will try to find the original file.
ZB
Excellent article and really helpful ,thanks a ton !
ReplyDeleteHi zeeshan,
ReplyDeleteIs it possible to do calender in adf as day in partition by 4 part.as it calender component month as day as 4 parts means blocks.
I want day to divide in 4 parts in tht month view
hi zeeshan when I trying to follow your example I got this message (cannot create a region from a task flow containing faceletes fragments in a jspx page) when I am trying to drop task flow on my page please help
ReplyDeleteMake sure all pages in task flow are fragments. You cannot have task flow with both fragments and pages. Also make sure the extension of fragments is .jsff
DeleteHi, I need to have a button in a page to determine which flow to display. How can i do that?
ReplyDeleteYou need to create dynamic region check this post http://www.baigzeeshan.com/2010/06/working-with-dynamic-regions-in-oracle.html
DeleteHello Zeeshan,
ReplyDeleteThanks for all your amazing knowledge that you share. This is totally unrelated but wanted to ask you, what could be the future with Oracle from a developer's point of view? I'm an ADF Developer and I see jobs going down with time, what do you think is the next good and reliably big thing that I can learn?
Thanks
Tarun
Hi Tarun,
ReplyDeleteYou are not alone. IMO next big thing is Microservices + Cloud and Open source technologies are doing the best, unfortunately again IMO Oracle tools are behind in this space.
Zeeshan