Saturday 21 June 2014

ADF - Navigate with double click in a table row

A functionality usefull in Form Builder is the doble click event in a table row.
For exemple to navigate into two fragments in the same taskflow or to navigate in a different taskflow.
Double

<af:resource type="javascript">
                  function clientEvent(evt) {
                      var cmp = evt.getSource();
                      AdfCustomEvent.queue(cmp, "BeanMethod", {}, false);
                      evt.cancel();
                  }
 </af:resource>

    private static void myCallFlowCase(String flowCase) {
        FacesContext context = FacesContext.getCurrentInstance();
        NavigationHandler nh = context.getApplication().getNavigationHandler();
        UIComponent c = JSFUtils.findPageRoot(context.getViewRoot());
        while(c.getParent() != null && !(c instanceof RichRegion)){
            c = c.getParent();
        }
        if(c != null){
            AdfFacesContext.getCurrentInstance().addPartialTarget(c);
        }
        nh.handleNavigation(context, "", flowCase);
    }

No comments:

Post a Comment