-
1. Re: entityHome remove is not firing afterTransactionSuccess
mkabir Mar 2, 2008 9:40 PM (in response to mkabir)Deletion is happening in a modal panel.
-
2. Re: entityHome remove is not firing afterTransactionSuccess
wiggy Mar 25, 2008 1:57 PM (in response to mkabir)having a similar problem I think - no soap at present
heres what i have in code
i have an entity class Node , a NodeHome, and NodeList. The last two are seam conversational named classes.
in my UI i have pageList.xhtml that displays the results from the NodeList framework backing bean. in the UI if you want to add a new node theres a link to do this, and i start the node.xhtml as part of a nested conversation.
however when you persist the new node my NodeHome @Observer method is never called - so i get no auto refresh.
here is part of the nodeList defn
@Name("nodeList") @Scope (ScopeType.CONVERSATION) //@Conversational() public class NodeList extends PagedEntityQuery<Node> { private static final long serialVersionUID = 1; private String searchString; /*declare the selected result to be injected on selection @DataModelSelection Node node; */ //@In //Node QBENode; @Logger private Log log; @In FacesMessages facesMessages; @Observer ("org.jboss.seam.afterTransactionSuccess.Node") public void afterTransactionSuccess () { facesMessages.add("node list: refreshing list after successful transaction on nodeHome"); getResultList(); } ...
equally in the NodeHome i ovverode the raise after transaction success method to check it was getting raised
@Name("nodeHome") public class NodeHome extends EntityHome<Node> { @RequestParameter Long nodeId; @Logger private Log log; @In FacesMessages facesMessages; // TODO debug event handling then get rid of @Override protected String getEntityName() { String en = super.getEntityName(); facesMessages.add ("got simple entity name of #0", (en != null) ? en : "<null>"); return en; } /** * Raise events when a CRUD operation succeeds. * <br /> * Utility method to raise two events: an event of type * <code>org.jboss.seam.afterTransactionSuccess</code> is raised, along with * an event of type * <code>org.jboss.seam.afterTransactionSuccess.<entityName></code>. */ @Override protected void raiseAfterTransactionSuccessEvent() { facesMessages.add("raising base trans success "); raiseTransactionSuccessEvent("org.jboss.seam.afterTransactionSuccess"); String simpleEntityName = getSimpleEntityName(); if (simpleEntityName != null) { facesMessages.add("raising additional entity trans success #0", "org.jboss.seam.afterTransactionSuccess." + simpleEntityName); raiseTransactionSuccessEvent("org.jboss.seam.afterTransactionSuccess." + simpleEntityName); } } ...
When i run the forms i can see the event being raised as shown here in the facesMessages log.
created new NodeHome, start nested conversation nodeHome factory initialsed new node Successfully created raising base trans success got simple entity name of org.domain.ForstersList.entity.node.Node raising additional entity trans success org.jboss.seam.afterTransactionSuccess.Node
however i get to see no refresh fired on the NodeList observer.
my UI does not automatically refresh to show me the node just persisted. I have to manually trigger a refresh action from the nodeList.xhtml form.
Dear seam team any ideas whats not happening - is it a bug?
-
3. Re: entityHome remove is not firing afterTransactionSuccess
pmuir Mar 28, 2008 1:32 PM (in response to mkabir)Attach a debugger and see where the event raise goes wrong.