Hi,

It seems to me like a hibernate problem. Are you sure your entitiy is saved
in your database? Are you refreshing the entities from the database each
time you call getEntities()?

Regards,
Jakob

2010/2/17 baeschtu baeschtu <[email protected]>

> I have two myfaces pages with a backing bean each.
> Both of them have a spring service injected to get access to the hibernate
> dao's.
> They are related 1-N
>
> So I have a <f:selectItems> combobox in one of them served by a method like
> this in the backinbean.
>
>    private List<Entity> entities;
>    ..
>    public UISelectItems getEntityList() {
>        entityList = new UISelectItems();
>        entities = getEntities();
>        Object[] values = new Object[entities.size()];
>        int count = 0;
>        for (Entity e : entities) {
>            values[count] = new SelectItem(e.getId(), e.getName());
>            count++;
>        }
>        entityList.setValue(values);
>        return entityList;
>    }
>
>
> So the problem is, when I add an Entity on the other page and return to the
> page with the combobox. The newly added Entity does not show up in the
> combobox. So I assume I get a cached version from the backing bean or the
> items are still cached in the viewState.
>
> thanks
> Bastian
>

Reply via email to