[jboss-user] [JBoss Seam] - Re: Problem with Two DataModel

keuller do-not-reply at jboss.com
Wed Aug 29 10:32:27 EDT 2007


Thanks for all tips, but anyone works.

Below is my modified code:

@Name("servicoBean")
  | @Scope(ScopeType.EVENT)
  | public class ServicoBean
  | {
  |     @Logger
  |     private Log log;
  | 
  |     @DataModel
  |     private List<Categoria> categorias;
  | 
  |     @DataModelSelection("categorias")
  |     private Categoria categoria;
  | 
  |     @DataModel
  |     private List<Servico> servicos;
  | 
  |     @DataModelSelection("servicos")
  |     private Servico servico;
  |     ...
  | }

I dont change anyXHTML code of "servicos.xhtml" page. The first @DataModel "categoria" works fine and display all data, but second "servicos" does not works again. I use two XHTML pages, the first page called "servicos.xhtml" shows result of "categorias" DataModel object and second page "listServices.xhtml" shows the result of "servicos" DataModel object, but any data is displayed on "listServices.xhtml".

The action code fired by <t:commandLink /> inside <t:dataTable />:


  | ..
  | public String selecionaCategoria(Categoria categ)
  |     {
  |         log.info("Selecionando a categoria..." + categ.getId());
  |         this.categoria = categ;
  |         findServicos();
  |         return "success";
  |     }
  | ...
  | 

I'm using JBoss EL to call this action method. Here is code of "listServices.xhtml" page:


  | ...
  | <h:form id="frmServicos">
  |             <t:dataList var="servico" value="#{servicos}" layout="simple" 
  |                 preserveDataModel="false">
  |                 <h:outputText value="#{servico.titulo}" />
  |             </t:dataList>
  | </h:form>
  | ...
  | 

This <t:dataTable /> is empty but there is data in DataModel collection. I have two @Factory objects for each @DataModel object.

Any suggestion ?

Regards.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079195#4079195

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079195



More information about the jboss-user mailing list