0 Replies Latest reply on Dec 28, 2012 7:57 AM by omid pourhadi

    Photoalbum Model Controller

    omid pourhadi Apprentice

      Hi,

      I'm trying to develop a Seam 2.2 application on Jboss 4.2 as photoalbum did.

      while I was reviewning photoalbum code, I encountered somethign strange.

       

      in photoalbum example, Controller is responsible for reseting model as follow

       

      Controller.java

       

      model.reset(template, selectedEntity); //shelfEditInfo.xhtml, shelf
      

       

      and model is responsible for managing entites and pages which are set by controller

       

      template.xhtml

       

       

      <ui:include src="#{model.navigationEnum.template}" /> // load template which is set by controller
      

       

      so far so good. 

       

      The problem is when you bind a form to model.selectedEntity. after controller resets model and form is loaded, everything is fine but since there is no conversation is running when you post a from which is defined as follow :

       

      shelfEditInfo.xhtml

       

       

      <h:inutText value="#{model.selectedShelf.name}" /> //only loads data and generates exception in post
      

       

      selectedShelf must be null and the exception is : target unreachable : selectedShelf is return null.

       

      But I don't know how it's working in photoAlbum example. Does anyone have any idea ?

       

      PS : I'm using richfaces 3.3.1