Monday, August 29, 2011

ADF : lazy checking if a row in a table is new programmatically/el

Lazy arb piece of code but hey well maybe it will help someone:

Put this in the component in your table you want to make non readonly when it is a new row:

readOnly="#{not yourBean.newRow}"

public boolean isNewRow() {
  ViewRowImpl row = (ViewRowImpl) JSFUtils.resolveExpression("#{row.row}");
  return row.getNewRowState() == Row.STATUS_INITIALIZED || row.getNewRowState() == Row.STATUS_NEW;

could also just use el : readOnly="#{not (row.row.newRowState < 1}"

No comments:

Post a Comment