8 Replies Latest reply on Apr 14, 2007 8:06 PM by Andy Gibson

    DataModelSelection not updated

    Andreas Franke Apprentice


      have a table and use row selection with DataModelSelection. If the whole table is loaded all is perfect. But when I use searchpattern like in booking example(ajax) to reduce tablesize DataModelSelection not updated. For example all times the first row from whole table is selected while this row no longer exist in reduced table.

      public abstract class AbstractListBean<T extends BaseEntity>implements Serializable {
       protected String searchString;
       protected EntityManager em;
       private T selectedEntity;

      public class SpecialreleaseListBean extends AbstractListBean<SpecialRelease> implements
       SpecialreleaseList {
       private static final long serialVersionUID = 1L;
       FacesMessages facesMessages;
       protected List<SpecialRelease> sprTablelist;
       public void find(){
       sprTablelist = loadList();
      @Factory(value="specialreleasepattern", scope=ScopeType.EVENT)
       public String getSearchPattern(){
       return searchString==null ?
       "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%';
       protected List<SpecialRelease> loadList() {
       List readFromDB = null;
       readFromDB = readFromDB("select s from SpecialRelease s where lower(s.description) like #{specialreleasepattern}");
       return readFromDB;

      What is the right way updating DataModelSelection?