In this example I use a bounded taskflow for employee and one for departmens. How to make this you can see my earlier blog.
Let's drop the department view from the data control and make a adf tree. We also put in the emploview and make sure you select the deptno and empno
Now we can drop a dymamic region by dragging the department task flow on the page. You now got an option to create a dynamic region and jdeveloper gives the option to create a bean. Let's do that. I moved the session backing bean definition to faces-config.xml. Update the backing bean with a key variable and two methods to select the right bounded taskflow region.
public class DepartmentDynamicBean {
private String taskFlowId = "/WEB-INF/task-flow-definition.xml#task-flow-definition";
public DepartmentDynamicBean() {
}
public TaskFlowId getDynamicTaskFlowId() {
return TaskFlowId.parse(taskFlowId);
}
public String empRegionLayout() {
// Add event code here...
taskFlowId = "/WEB-INF/task-flow-definition.xml#task-flow-definition";
return null;
}
public String deptRegionLayout() {
// Add event code here...
taskFlowId = "/WEB-INF/task-flow-definition1.xml#task-flow-definition1";
return null;
}
}
Now we can update the adf tree with a switcher so we can put in the right value in the key variable of the bean and call the right method.
The last step is to give the key variable value to the dynamic region so the region can refresh it self with the wanted department of employee.
and we are finished
Hi,
ReplyDeleteit was a nice sample but you missed the link to dowonload the workSpace
Thanks
You can use the other workspace downloads it also contains this example
ReplyDeletethanks edwin
Thank you edwin,
ReplyDeletebut with other worspaces the connection is not HR.
Listen edwin
I have to implement a tree hierrarchi like in windows-->Workstation-->explorer
I also have to implement the add and delete action
Can you give some advice
mourad.hmimida@gmail.com
Thanks
Ok,
ReplyDeletehere is a demo of oracle http://jdevadf.oracle.com/adffacesdemo/faces/fileExplorer/index.jspx
and check this out http://technology.amis.nl/blog/?p=2116
Hi Edwin,
ReplyDeleteI have a question about the bounded task flow. Can we iterate the bounded task flow execution inside the view. Could you please throw up your thoughts on this?
-thiva
Hi, Do you mean the flow of the view in a task flow. to control it outside the task flow see this http://biemond.blogspot.com/2009/03/mainpage-and-task-flow-region.html
ReplyDeleteor you use a router in the task flow to control the next view. Or a train and skip step by using a backing bean
thanks Edwin
Thanks Edwin for the quick response.
ReplyDeleteI have the following requirement and i am using ADF 11g to build up this.
Assume an use case "display comment". I am using some rich display to display the comment and allow some functionality on that.
So i have designed as an bounded taskflow and passing the Comment object as a parameter to the bounded taskflow.
Now i want to use this bounded taskflow for displaying list of comments inside one page. If the number of comments is fixed then i can design this easily. But the no of comments to be displayed is a runtime variable. So based on the number i would like to call the bounded taskflow. i.e i have an array of the Comment object and i would like to call the bounded takflow for each of them.
Another way would be, i would have created the bounded taskflow to accept the array of comments object and call the bounded takflow once. However i am thinking this approach in some other places, Basically i would like to call the any bounded takflow dynamically any number of times inside one view.
Much appreciate if you help me on this.
Thanks
- thiva
Hi,
ReplyDeleteOk dynamic bounded taskflow region is it a bit difficult ( maybe impossible ) you have to add the region in the page and add a taskflow executable definition in the pagedef.
You better have one taskflow and an comment iterator or arraylist as inputparameter of the taskflow then a for each in the pagefragement. in the for each you have a inputtext.
or you need to add the same taskflow as x regions in the jsf page and use the rendered attribute to control the display of a region when there not so many comments
thanks edwin. Could you please let me know where to download this example from? It would be so helpful.
ReplyDeletethanks again.
R.
Hi
ReplyDeletein this blog you can download the example workspace. it works with the production version of jdev 11g
http://biemond.blogspot.com/2008/10/dynamic-regions-with-task-flow-in.html