1 Reply Latest reply on Jan 11, 2008 5:50 PM by Dan Florian

    @DataModelSelection Is Update When @Factory Method Gets Call

    Dan Florian Newbie

      I'm writing a very simple Web application and trying to use POJOs instead of SBs. I have a page that displays a parent object and it's children. The children's names are displayed in the cells of a datatable. Each child has an associated SEAM link that is used to redisplay the current page but now using the child as the parent. When I click the child link the page does redisplay but since the @DataModelSelection value is always set to the first child in the collection the wrong child is displayed (unless I click on the first child:-). I've verified that the @DataModelSelection is only updated when the @Factory method is called. See code (modified for simplicity) below. Thanks much for your help.

      xhtml code:


      <f:facet name="header">
      value="Child Name" />

      pojo code:

      @Name( "pojo" )
      @Scope( ScopeType.SESSION )
      public class Pojo implements Serializable {

      @DataModelSelection( "kids" )
      private Node child;

      private Node node;

      private List kids;

      @Factory( "kids" )
      public List getNodeChildren() throws Exception {
      this.kids = this.node.getChildren();
      return this.kids;

      public String viewChild() throws Exception {
      this.node = this.child;
      return "view";