dynamic region binding task flow(region 动态绑定流taskflow)

来源:互联网 发布:c语言字符串结束标志 编辑:程序博客网 时间:2024/06/10 18:21

以下是网上的问题,也是我遇到过的问题。

In a page, I have several af:selectOneChoice components, below which is a dynamic region (whose contained task flow is dependent on the selected values). This works fine, in so far that a change in a select box results in the appropriate task flow being shown. The new task flow automatically starts on the default step, which is great. However, I need to be able to 'restart' the currently active task flow with a button.

Is there a simple way to restart a region's task flow? The region already uses refresh="ifNeeded" as a change in one of the select boxes alters one of the region params. However, the user may be on another step in the taskflow, and I want a quick way to bring them back to the start.

I have a solution (based on the ' [ADF Region Interaction|http://www.oracle.com/technology/products/adf/patterns/11/ADFRegionInteraction.pdf] ' whitepaper) which involves the region.queueActionEventInRegion method, but the problem I have with this is that I'd prefer not to force each subflow to have a 'startOver' navigation. The other problem is that my region also has a navigation listener which hides the select boxes when a navigation away from the start page in the region takes place; When the 'restarted' region is shown, the queued navigation happens, and my listener triggers, hiding the select fields straight away. I have to kludge my code to stop this from happening.

In short, is there no quick way of restarting the current flow, similar to how it works when you swap in another taskflow?

 

解决方法:

using the below code which is working fine for me and when I hit the simpleSearch Link it is refreshing the taskflow and displaying the very first fragment.

绑定的bean——TestBean.java

 

 

my main page def: (所在绑定页面对应的绑定文件templatePageDef.xml--对应的页面是template.jspx)  
I am picking the simplesearchflowdefinition1 from the pageDef and using the same to get DCTaskFlowBinding. But my issue is I have few more dynamic links in my main page. And each link got his own actionListener method. Now How could I get those DCTaskFlowBinding object. I need to achieve the same future for those taskFlows too. But Couldnot able to get the taskFlow obj.
I am trying like this but getting null. please help me in this.
DCTaskFlowBinding tf1 = (DCTaskFlowBinding)dc.findExecutableBinding("/WEB-INF/simplesearch-flow-definition.xml#advsearch-flow-definition");//这种绑定我也试了,没有成功,应该有问题,不能这样绑定
 
注意:
templatePageDef.xml文件中的taskFlow标签绑定的是TaskFlowId对象,
template.jspx也面中region绑定流的绑定值是RegionModel对象,所以需要做类型转换。

转换:
String ---->TaskFlowId

获取RegionModel对象: