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");

3 comments:

  1. Hi!

    Thanks for your post... I'd earlier wondered how to get the page path and figured out it was the view Id (am i right?)
    I still am running into the same exception..
    do you have any suggestions?

    Many thanks,
    Suresh

    ReplyDelete
  2. And what is the ideal place where I'll add the Approach # 2?
    Do i do it after i create a new ChidPropertyTreeModel?

    ReplyDelete
    Replies
    1. I did that after populating the complete business tree & not ChildPropertyTreeModel. So you can try this, but it's prior to render. so behavior can't be predicted.

      Delete