Monday, November 15, 2010

ADF programmatic disabled

I am creating dynamic links and here is something useful I used for programmatic creatin of the links.

uiCompnent.setValueExpression(
  "disabled",
  JSFUtils.getValueExpression(
    "#{bindings.MyVOIterator.estimatedRowCount == 0}",
      Boolean.class));

public static ValueExpression getValueExpression(
  String expression, Class clazz){
  FacesContext ctx = FacesContext.getCurrentInstance();
  ELContext elCtx = ctx.getELContext();
  Application app = ctx.getApplication();
  return app.getExpressionFactory().createValueExpression(
    elCtx, expression, clazz);
}

No comments:

Post a Comment