[jboss-user] [JBoss Seam] - DataModel changes not reflected in view [possible newbie ign

giannidoe do-not-reply at jboss.com
Fri Jan 11 08:08:52 EST 2008

I'm using a session-scope stateful session bean to hold search results in a DataModel - in a similar manner to the booking example.

I first populate the DataModel by performing an entity query, if I then modify and persist one of the entities from the search results, return to the search page and perform the same search again the changes to the entity are not reflected in the view, my dataTable still displays the original values even though logging shows that the DataModel has been correctly updated.

  | @Name("websiteSearch")
  | @Scope(ScopeType.SESSION)
  | @DataModel("websites")
  | private List<Website> websites;
  | @RequestParameter
  | String letter;
  | public void findDomainByLetter() {
  |     websites = entityManager.createNamedQuery("Website.findByDomainLetter")
  |             .setParameter("domainName", letter.toLowerCase() + "%")
  |             .setMaxResults(pageSize)
  |             .setFirstResult(page * pageSize)
  |             .getResultList();
  | }

<ui:repeat value="#{websiteSearch.alphabet}" var="letter">
  |   <s:link value="#{letter}" action="#{websiteSearch.findDomainByLetter}">
  |     <f:param name="letter" value="#{letter}"/>
  |   </s:link> Â 
  | </ui:repeat>
  | <h:dataTable id="websites" value="#{websites}" var="site" rendered="#{websites.rowCount>0}">
  |     <h:column>
  |         <f:facet name="header"><h:outputText value="#{msgs['website.host-name']}"/></f:facet>
  |         <s:link action="#{siteManager.editSite}">
  |             <h:outputText value="#{site.domain.name}"/>
  |             <f:param name="id" value="#{site.id}"/>
  |         </s:link>
  |     </h:column>
  | ..snip
  | </h:dataTable>

If I then perform a different search and subsequently repeat the original search the changes are then reflected in the view.

Could this be some kind of view caching issue or maybe a poor grasp of the jsf lifecycle ..?
I'd appreciate some suggestions.

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

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

More information about the jboss-user mailing list