1 Reply Latest reply on May 6, 2006 2:09 PM by Arnaud Santoni

    datatable problem

    Arnaud Santoni Newbie

      Hello everybody,

      I would like to have a datatable, and edit the content... nothing extraordinary... i've seen a working example in the dvdstore application, and i've tryed to apply without success...
      i've tryed to explore different the scope without success too... and all help or advice would be great now...

      i use seam+facelets+adf

      this is the bean
      @Stateful
      @Scope(ScopeType.SESSION)
      @Name("testBean")
      @Interceptors(SeamInterceptor.class)
      @Intercept(InterceptionType.ALWAYS)
      public class RestaurantRestorerServiceBean implements RestaurantRestorerService {
      @In(create = true)
      private transient EntityManager entityManager;
      @In(create = true)
      private transient Restaurant currentRestaurant;

      ............

      @DataModel("xyzs")
      @Out(required=false,scope=ScopeType.SESSION)
      public List getXyzs() {
      return currentRestaurant.getRestaurantDeliverLocations();
      }

      .....

      }

      this is the view

      
       <af:table id="g1d" allDetailsEnabled="true" rows="25" bandingInterval="2" banding="row"
       value="#{xyzs}" var="pout"
       width="95%">
       <f:facet name="actions">
       <af:commandButton text="Submit" action="#{testBean.updateDelivers}"/>
       </f:facet>
      
       <af:column>
       <f:facet name="header">
       <af:outputText value="#{msgs.city}"/>
       </f:facet>
       <af:outputText value="#{pout.location.city}" />
       </af:column>
       ....
       blablabla
       .....
       <af:column>
       <f:facet name="header">
       <af:outputText value="#{msgs.deliver_cost}"/>
       </f:facet>
       <af:inputText value="#{pout.deliverCost}"/>
       </af:column>
       <af:column>
       <f:facet name="header">
       <af:outputText value="#{msgs.deliver_time}"/>
       </f:facet>
       <af:inputText value="#{pout.deliverTime}"/>
       </af:column>
       </af:table>
      
      


      updateDelivers just do some print of the list to see if parameters have changed...
      thus, i've tryed directly with the currentRestaurant bean, i've change scope event to session, and no way.... all new value values are dropped and old ones are restored...
      i don't really understand where the mistake is...

      thanks in advance...