Working with bounded Task Flows
Working with Bounded Task Flows, Regions and Routers in JDeveloper 11gPurposeIn this tutorial, you use Oracle JDeveloper 11g to create a task flow that includes views, router and operations components. Then after creating each of the components of the task flow, you bind the task flow as a region of an existing Time to Complete 50 minutes TopicsThe tutorial covers the following topics:
Viewing Screenshots
Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the screenshot associated with that step. You can hide an individual screenshot by clicking it. OverviewThe model is provided by business components, while the view and controller are provided by Java Server Faces. The predefined application includes two pages, a browse page and an Edit page. The Browse page provides the list of departments and allows you to select a department from the list to edit the department details. The Edit page displays the To that predefined application you enhance its functionalities by adding a task flow as a region to the BrowseDepartments page. The task flow includes a BrowseEmployees page and allows to create a new employee or edit an existing employee. ScenarioYou create a bounded task flow with various components in it. Using a router, views, and operations, you design the task flow to be able to support browsing, edit and create functionalities. Once the task flow created, you create the Prerequisites In case you've already performed the URL_Bookmark hands on, you can continue on using that application and then skip the Prerequisites section and go directly to theCreating
Downloading the Required Components and Start JDeveloper 11g In the following steps, you download JDeveloper 11g and other files required for this tutorial.
Uploading the Starter Application Before you create any component, you must first open the startup application. To do this, perform the following steps:
Creating a Database Connection You need to create a Database Connection to the HR schema. To do this, perform the following steps:
Testing the Startup Application The startup application uses Departments and Employees entity objects and their corresponding view objects.
Creating a Bounded Task Flow With the TaskFlowHandsOn application loaded in JDeveloper, you create a bounded task flow diagram including views, router, and operations. To do this, perform the following steps:
|
| 1. |
On the employees-flow-definition diagram double click the BrowseEmployeesview. |
| 2. |
In the Create New JSF Page Fragment dialog, click OK to accept default values. |
| 3. |
From the Data Controls accordion, select the AppModuleDataControl | DepartmentView1 | EmployeesView3 node then drag and drop it onto the page. From the context menu, select Tables --> ADF Read-only Table. |
| 4. |
In the Edit Table Columns, check the Row Selection option, then using theCtrl key, multi select PhoneNumber, JobId, CommissionPct, ManagerId,DepartmentId and Click OK. |
| 5. |
From the Component Palette, in the ADF Faces Common Components group, select the Button component and drop it in the Structure pane under the af:tablenode.
|
| 6. |
Repeat this last operation dropping a Button below the previous one.
|
| 7. |
Select the commandButton1 and in the Property Inspector, type Edit Employee in the Text field and select createEdit for the Action property.
|
| 8. |
Select the commandButton2 and in the Property Inspector, type Create Employee in the Text field and select createEdit for the Action property.
|
| 9. |
Now, using the Ctrl key, multi select both commanButtons then right click and select Surround With from context. |
| 10. |
In the Surround With dialog, choose Panel Group Layout and click OK. |
| 11. |
In the Property Inspector, set the Layout property to horizontal. |
| 12. |
Now, using the Ctrl key, multi select the af:table and theaf:panelGroupLayout and right click, then select Surround With from context. |
| 13. |
In the Surround With dialog, choose Panel Group Layout and click OK. |
| 14. |
In the Property Inspector, set the Layout property to scroll. |
| 15. |
In the Component Palette, from the ADF Faces | Common Components | Operations, drag and drop the Set Action Listener onto the Edit Employeebutton. |
| 16. |
In the Insert Set Action Listener dialog, type #{'edit'} in the From field and #{pageFlowScope.action} in the To field. Use Crtl + C keys to copy the content of the To field Click OK. |
| 17. |
In the Component Palette, from the ADF Faces | Common Components | Operations, drag and drop the Set Action Listener onto the Create Employee button. |
| 18. |
In the Insert Set Action Listener dialog, type #{'create'} in the Fromfield and paste the content of the clipboard into the To field. Click OK. |
| 19. |
Click the save all |
Creating Other Task Flow Components
To create the router and other bounded components, perform the following steps:
| 1. |
Click the employees-flow-definition tab to reopen the task flow diagram. |
| 2. |
Double click the CreateEdit router to open its properties. |
| 3. |
In the Property Inspector, set the default-outcome to unknown from the drop down list. In case of unexpected event, this will return to the BrowseEmployees page. |
| 4. |
To add other cases to the router, in the Cases section, click the Add button |
| 5. |
In the expression column, type the following syntax #{pageFlowScope.action eq 'edit'}. For the outcome select edit from the list. |
| 6. |
In the Cases section, click the Add button The router will dispatch to the create or edit flow based on the value associated to the button pressed. |
| 7. |
Back in the task flow diagram, double click the EditEmployees view icon to create the page. |
| 8. |
In the Create New JSF Page Fragment dialog, click OK to accept default values. |
| 9. |
From the Data Controls accordion, select EmployeesView3 and drop it onto the empty page. Select Forms --> ADF Form fro context. |
| 10. |
In the Edit Form dialog, select the Include Submit Button and click OK. |
| 11. |
In the EditEmployees page, select the Submit button and in the Property Inspector, set the Action to execute. |
| 12. |
From the Components Palette, drag and drop a Set Action Listener onto theSubmit button. |
| 13. |
In the Insert Set Action Listener dialog, select the Expression Buildernext to the From field. |
| 14. |
In the Expression Builder dialog, select ADF Bindings | bindings | EmployeesView3Iterator | currentRowKeyString to move it in the Expression pane. Click OK. |
| 15. |
Back in the Insert Set Action Listener dialog, type #{pageFlowScope.rowKey} in the To field. Click OK. |
| 16. |
Return to the task flow diagram. Right click the SetCurrentRowWithKeyoperation and select Go To Page Definition. |
| 17. |
In the Structure pane for the SetCurrentRowWithKey operation expand thebindings | setCurrentRowWithKey nodes and select rowKey. In the Property Inspector type #{pageFlowScope.rowKey} in |
| 18. | Close the Page Definition tab to return to the task flow diagram. |
Binding the Task Flow as a Region to the BrowseDepartments Page
The created task flow is now going to be used as a region within the BrowseDepartments page. To do this perform the following steps:
| 1. |
In the Application Navigator, double click the BrowseDepartments.jspx node to open the page in the editor. |
| 2. | Back in the Application Navigator, select the employees-flow-definition.xml.
Drag it to the most right part of the BrowseDepartments page and drop it choosing the Region option from context. |
| 3. |
In the Structure pane, select the af:region and move it between the mainand af:panelGroupLayout components. |
| 4. |
Right click the group component above the region one and select Convertfrom context. In the Convert group dialog, select Panel Group Layout and click OK. |
| 5. |
For the Panel Group Layout in the Property Inspector, set the Layout field toscroll. |
| 6. |
In the Structure pane, select the panelGroupLayout and move it above theregion component. |
| 7. |
The Structure pane should look like this: |
| 8. |
Expand the panelGroupLayout | panelCollection component and select thetable one. In the Property Inspector in the Behavior tab set the RowSelection to single. |
| 9. |
Right click within the BrowseDepartments page and select Go To Page Definition from context. |
| 10. |
In the Structure pane expand the executables node, select the taskFlow - employeesflowdefinition1 and in the Property Inspector set the Refresh field to ifNeeded. |
| 11. |
Right click the taskFlow - employeesflowdefinition1 and select Insert inside task flow --> parameters from context. |
| 12. |
Right click the parameters node and select Insert inside parameters --> parameter from context. |
| 13. |
In the Insert Parameter dialog, type currency in the id field. |
| 14. |
The page definition should now look like this: |
| 15. |
Having the currency parameter selected, in the Property Inspector click the down arrow next to the value field and select Edit. |
| 16. |
In the Edit Property dialog, expand ADF Bindings | bindings | DepartmentsView1Iterator and select currentRowKeyString. Click OK. |
| 17. |
In the Application Navigator, double click the BrowseDepartments.jspx node to reopen the Structure pane for the page, select the region component and in the Property Inspector using the Behavior tab, select |
| 18. |
In the Edit Property dialog, select the panelCollection*, type p1 as the Id and press Return. |
| 19. |
In the Edit Property dialog, select the table*, type t1 as the Id and pressReturn. Then select the table* -t1component and using the right arrow button Click OK. |
| 20. |
The Partial Triggers should now look like this: |
| 21. | Click the save all to save the application. |
Running the BrowseDepartments Page
Now that the task flow is integrated as a region to the BrowseDepartments page you can run it. To do this, perform the following steps:
| 1. |
In the editor for the BrowseDepartments page, right click and select Run from context. |
| 2. |
The page loads up in your browser exposing the list of departments in the upper section and showing the related employees in the bottom part. |
| 3. |
Select another department in the list, the related employees are displayed synchronously in the BrowseEmployees region. |
| 4. |
Scroll down to the bottom of the page to see the Edit and Create buttons for Employee. Select an employee in the list and click the Edit Employeebutton. |
| 5. |
In the Edit Employee section, change a value (e.g. update the salary) and click Submit. |
| 6. |
Back to the BrowseEmployees section, click the Create Employee button. |
| 7. |
In the Create form, add a new employee and click the Submit button. |
| 8. |
Back to the BrowseEmployees section, the new employee is now displayed in the list. |
| 9. |
Click on the Edit Employee button for the newly created employee to review its details. |
| 10. |
Update some of the properties if you wish and click the Submit button to return to the BrowseEmployees page. |
| 11. | Close the browser window. |
Summary
In this tutorial, you created a task flow and included views, router, operations into it and added it as a region to an existing page. You learned how to:
| Create a task flow diagram | |
| Create the components of the task flow | |
| Bind the task flow to a page |
Place
the cursor over this icon to hide all screenshots.
Working with bounded Task Flows的更多相关文章
- Developing RIA Web Applications with Oracle ADF
Developing RIA Web Applications with Oracle ADF Purpose This tutorial shows you how to build a ric ...
- ADF 入门帮助
本文是由英文帮助翻译所得: 1>task flows “任务流 task flows”可以包括非可视化的组件,比如方法调用.“页片段 page fragment”可以运行在一个页面的某个局部区域 ...
- TASK FLOW中的REENTRY
在实际应用中,用户可能会点击浏览器的回退按钮回到上一页面,在有些情况下会导致一些问题. ADF Bounded TaskFlow有一个选项(UnBounded TaskFlow无此选项)可以设置是否允 ...
- ADF_Starting系列8_使用EJB/JPA/JSF通过ADF构建Web应用程序之扩展UI Method
2013-05-01 Created By BaoXinjian
- ADF_ADF基本概要(汇总)
20150601 Created By BaoXinjian
- ADF_Controller系列4_通过创建ADF Menu作为页面向导(Part2)
2015-02-15 Created By BaoXinjian
- ADF_Controller系列3_通过创建ADF Menu作为页面向导(Part1)
2015-02-15 Created By BaoXinjian
- ADF_Controller系列2_绑定TasksFlow、Region和Routers(Part2)
2015-02-14 Created By BaoXinjian
- ADF_Controller系列1_绑定TasksFlow、Region和Routers(Part1)
2015-02-14 Created By BaoXinjian
随机推荐
- android获取短信并自动填充
package com.velo.quanquan.util; import java.util.regex.Matcher; import java.util.regex.Pattern; impo ...
- [ExtJS5学习笔记]第二十五节 利用window.open()函数实现ExtJS5的登陆页面跳转
本文地址:http://blog.csdn.net/sushengmiyan/article/details/40427543 mvvm方式实现登陆的博客:http://blog.csdn.net/s ...
- 二维码扫描&集合排序
一.二维码扫描机制 二维条码/二维码(2-dimensional bar code)是用某种特定的几何图形按一定规律在平面(二维方向上)分布的黑白相间的图形记录数据符号信息的:在代码编制上巧妙地利用构 ...
- Swift延迟加载的一种用途
大熊猫猪·侯佩原创或翻译作品.欢迎转载,转载请注明出处. 如果觉得写的不好请多提意见,如果觉得不错请多多支持点赞.谢谢! hopy ;) 有以下一种情况: 我们试图用Cocoa的语音合成类NSSpee ...
- Runtime系列(二)--Runtime的使用场景
Runtime 理解介绍的文章非常多,我只想讲讲Runtime 可以用在哪里,而我在项目里哪些地方用到了runtime.多以实际使用过程为主,来介绍runtime的使用. * 那么runtime 怎么 ...
- Linux2.6 --系统调用处理程序
用户空间的程序无法直接执行内核代码.它们不能直接调用内核空间中的函数,因为内核驻留在受保护的地址空间上.如果进程可以直接在内核的地址空间上读写的话,系统的安全性和稳定性将不复存在. ...
- Ubuntu15.10 安装OpenCV3.1
wget https://sourceforge.net/projects/opencvlibrary/files/opencv-unix/3.1.0/opencv-3.1.0.zip/downloa ...
- 【一天一道Leetcode】#203.Remove Linked List Elements
一天一道LeetCode 本系列文章已全部上传至我的github,地址:ZeeCoder's Github 欢迎大家关注我的新浪微博,我的新浪微博 我的个人博客已创建,欢迎大家持续关注! 一天一道le ...
- 学习Tensorflow,使用源码安装
PC上装好Ubuntu系统,我们一步一步来讲解如何使用源码安装tensorflow?(我的Ubuntu系统是15.10) 安装cuda 根据你的系统型号选择相应的cuda版本下载 https://de ...
- 【一天一道LeetCode】#217. Contains Duplicate
一天一道LeetCode 本系列文章已全部上传至我的github,地址:ZeeCoder's Github 欢迎大家关注我的新浪微博,我的新浪微博 欢迎转载,转载请注明出处 (一)题目 Given a ...