Friday, February 24, 2012

How-to: Reinitialize bounded, page fragment based taks flow programmatically

Sometimes you need reinitialize region based ADF task flow - especially when you want to use task flow in popup. There exists declarative solution in which you set properties:
  • RefreshCondition, or
  • set Refresh to ifNeeded
Unfortuantely declarative solution wouldn't work in some cases, while code-based works for me perfectly. What's more software solution is very simple.

To restart page-fragment, bounded taskflow from code you should access the task flow model from backing bean:

RegionModel model = (RegionModel)JSFUtil.getValueEl("#{bindings.my-task-flow.regionModel}");

and next refresh this model:

model.refresh(FacesContext.getCurrentInstance());

1 comment:

  1. Thank you for your post! This is just 2 lines of code but it really helped me. As we said in France : "One that knows is better than one hundred searching".

    ReplyDelete