This content has been marked as final.
Show 2 replies
-
1. Re: How to bind input form to new entity outside of a long running conversation
norman Jun 13, 2008 12:42 AM (in response to mocha)The only reason this doesn't work is because you are relying on an outjected newContact. Instead, define newContact in XML and inject into your contact manager. (or better yet, find a way to incorporate EntityHome and then you can do it with no code at all)
-
2. Re: How to bind input form to new entity outside of a long running conversation
mocha Jun 18, 2008 10:37 PM (in response to mocha)Thanks Norman - the suggestion works. Just to expand on the detail if anyone else is interested...
I added the following to components.xml
<component name="newContact" scope="conversation" auto-create="true" class="com.yourpackage.Contact"/>
and changed the manager to inject the new contact
@Stateful @Name("contactManager") @Scope(ScopeType.CONVERSATION) public class ContactManager { @In Contact newContact; public saveNewContact() { entityManager.persist(newContact); newContact = new Contact(); }