webtier@glassfish.java.net

How to debug action method not being called in command button

From: <webtier_at_javadesktop.org>
Date: Fri, 19 Mar 2010 10:11:26 PDT

I am using Glassfish v3 which I believe uses Mojarra 2.0.2. I have deployed a simple page which holds a single data table (it is primefaces, but I changed it to h:dataTable and it behaves the same way) which displays a list of wrapped objects and has a delete callback on each object. This is what the view looks like:

<h:form id="listForm">
        <h:dataTable value="#{beanService.actorsForClientList}" var="entity" >
                <h:column>
                        <f:facet name="header">ID</f:facet>
                        #{entity.id}
                </h:column>
                <h:column>
                        <f:facet name="header">Action</f:facet>
                        <action:deleteAction actionMethod="#{entity.delete}" />
                </h:column>
        </h:dataTable>
</h:form>

The beanService.actorsForClientList method returns the result of an EJB query, with each object wrapped in this wrapper class:

public class SCDEntityWrapper {
        private final SCDEntity scdEntity;
        private final DimensionSession.IRemote dimensionSession;

        public Long getId() {
                return scdEntity.getId();
        }

        public SCDEntityWrapper(SCDEntity entity, DimensionSession.IRemote remote)
        {
                scdEntity = entity;
                dimensionSession = remote;
        }

        public String delete()
        {
                dimensionSession.remove(scdEntity);

                return "list.jsf?faces-redirect=true";
        }
}

So, here is the kicker. I use this list on two separate pages, and one works and one doesn't. The only difference I can tell is the type of entity the wrapper holds. So, I put a breakpoint in the delete method and in the case which doesn't work the method is never called at all - it just reloads the current page instead of even trying to call delete.

So, my question is, how can I debug why the delete method is being called? I am quite proficient at servlet/jsp programming, but this particular issue has been nagging at me for a few days and I can't figure out the next step.
[Message sent by forum member 'absmiths']

http://forums.java.net/jive/thread.jspa?messageID=392782