0 Replies Latest reply on Mar 15, 2007 4:50 PM by Carlos Zaniolo

    DataModelSelection initialized to first item in ListDataMode

    Carlos Zaniolo Newbie

      DataModelSelection is initialized to the first item in ListDataModel. Ok, no problem.

      But in my case, I have a single-page facelets ajax CRUD registration form. I have one container with DataModel and another container with DataModelSelection. The DataModelSelection container is only rendered when the user selects one item in the DataModel. This container hava rendered="false" before the user selects any item.

      The problem is, because the DataModelSelection is initialized to the first item in ListDataModel, all the LAZY entities that depend the first item are fetched before the user selects an item!!!

      In the seam source code, to init the DataModelSelection to null I need only to change the constructor of ListDataModel and init the rowIndex with -1.
      Could I do this? Does this have any major implications?

      It does not make sense to me that datamodelSELECTION comes selected before any selection...