ADF Invoke operation manually from code

允我心安 提交于 2019-12-02 05:14:19

the code you want to execute an operation behind a actionlistener:

        public BindingContainer getBindings() {
          if (this.bindings == null) {
              FacesContext fc = FacesContext.getCurrentInstance();
              this.bindings = (BindingContainer)fc.getApplication().
                  evaluateExpressionGet(fc, "#{bindings}", BindingContainer.class);
          }
          return this.bindings;
      }

BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("doQueryResultReset");
    operationBinding.execute();

Similar to Joe's answer but does not use EL Expression evaluator and uses direct access instead to get the BindingContainer

//Get binding container BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();

// get an Action or MethodAction
OperationBinding method = bindings.getOperationBinding("methodAction");
method.execute();
List errors = method.getErrors();

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!