Showing posts with label NEW. Show all posts
Showing posts with label NEW. Show all posts

Monday 29 June 2015

How to know whether current row is new row or from database?

A row or view has four states:
  • New
  • Modified
  • Un-Modified
  • Initialized
To get the state using expression: #{row.row.entities[0].entityState}

You can use this expression to control the display or rows in the UI. Like to display new rows in diff colors.
    Ex: #{row.row.entities[0].entityState==0 ? 'background-color:yellow' :  ''} 
Now in RowImpl, you can access the state using:
    Ex: byte entityState = this.getEntity(0).getEntityState()