Wednesday, February 27, 2013

ADF: No Vertical Scrollbars for Table/Tree


Below is the way to eliminate vertical scrollbars from ADF Table/Tree component:

autoHeightRows 
This property suggests that, the height of the component can grow to a maximum of 'autoHeightRows' after which a vertical scrollbar is displayed.

Problem: But even after specifying the value in autoHeightRows or assigning it the value of model data size (e.g. list size), vertical scrollbars are visible after certain limit.

Resolution: Assign the same value to "fetchSize" property as specified for "autoHeightRows".

Tuesday, February 26, 2013

ADF: javax.faces.model.NoRowAvailableException


Scenarios:

This error is generally thrown in case where underlying tree model is changed & component changes (i.e. expanding or collapsing of nodes) are saved in state. 

  • Approach 1
It is suggested in many blogs to clear the disclosed rowkeyset & add partial trigger on tree/treeTable component
treeTable.getDisclosedRowKeys().clear();
Note: But it will work only in case where tree is already being rendered & underlining model is changed as a part of partial submission.

  • Approach 2
In case where page (having tree/treeTable component) is called again with model change. And on previous page tree nodes are expanded & collapsed randomly.
org.apache.myfaces.trinidad.model.TreeModel uses ComponentChangesMapForSession API to support back button behavior or to save the state of TreeTable/tree. We can manually clear the changes stored in session map for respective pages.
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().
  remove("org.apache.myfaces.trinidadinternal.ComponentChangesMapForSession/oracle/webcenter/portalapp/pages/testPages/TestTree.jspx");