[jboss-user] [JBoss Seam] - DataModelSelection returns wrong entry.

hubaer do-not-reply at jboss.com
Wed Feb 14 09:40:30 EST 2007

Hi all,

I have a strange problem with a DataModel. I have a list of item entities referring with a button on a detail information page. 
Now after showing the overview page the first time and clicking on an item entry I always get the first item in the list.
If I go back with the browsers back button and then select this item again, it is displayed correctly ?!?

Are there errors in my annotations? There is not much code that can go wrong :)

The overview bean with the data model:

public class ItemOverviewActionBean implements ItemOverviewAction, Serializable {
    private List itemList;
    private Item item;
    public void initItems() {
        itemList =  getItemList();

    public String showDetails() {
        return "itemDetails";
    @Remove @Destroy
    public void destroy() {

The corresponding jsf page:

<f:view xmlns="http://www.w3.org/1999/xhtml"
        xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" > 
            <h1><h:outputText value="#{messages['item.overview']}"  /></h1>
            <h:outputText value="#{messages['item.overview.noItemAvailable']}" rendered="#{itemList.rowCount==0}"/>
            <h:dataTable var="itm" value="#{itemList}" rendered="#{itemList.rowCount>0}">
                    <f:facet name="header">
                        <h:outputText value="#{messages['item.title']}"/>
                    <h:outputText value="#{itm.title}" />
                    <h:commandButton value="Details" action="#{itemOverview.showDetails}"/>

The details bean.

public class ItemDetailActionBean implements ItemDetailAction, Serializable {
    private Item item;
    /** Creates a new instance of OverviewActionBean */
    public DetailActionBean() {
    @Remove @Destroy
    public void destroy() {

I'm using JBoss 4.0.5 with Seam 1.1.6 on Windows XP Pro.

I hope someone could explain me this strange behaviour, and how to solve it.


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

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

More information about the jboss-user mailing list