[jboss-user] [JBoss Seam] - Re: renew the @Factory
Hmmm EntityHome isn't well documented in Seam 1.2.1 (which is what I currently use) and so without reviewing the EntityHome impl code in Seam, I'll have to guess a bit here. On closer inspection of your code, it looks like whether createInstance() is invoked or persistAndContinue() is invoked, both impl's as shown will produce a newly instantiated license. However, you're saying that the 'data of previous object' is in "license" - are you submitting to a session- or conversational-scoped component? If you are, are you also outjecting license back to session or conversation? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081463#4081463 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081463 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: renew the @Factory
See all my comments here, this maybe can help you. http://www.jboss.com/index.html?module=bb&op=viewtopic&t=117469 View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081461#4081461 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081461 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: renew the @Factory
ok, here go! in my add.xhtml page I put: | #{messages['Name']}: | | | | | | | | | the add.page.xml: | | | | | | | | | | | and the class: | @Name(value = "licenseHome") | public class LicenseHome extends EntityHome { | | @Override | protected License createInstance() { | license = new License(); | return license; | } | | @Override | @Factory(value = "license") | public License work() { | return getInstance(); | } | | public String persistAndContinue() { | super.persist(); | Contexts.getSessionContext().remove("license") ; | setInstance(new License()); | | return ""; | } | | public void setLicenseId(Long id) { | setId(id); | } | | public Long getLicenseId() { | return (Long) getId(); | } | } View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081456#4081456 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081456 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: renew the @Factory
anonymous wrote : It didn´t works! Well, you should probably post your entire component then and the markup that you claim is 'submit the action'. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081449#4081449 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081449 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: renew the @Factory
the interesting is: after submit the conversation are changed but the fields still there. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081441#4081441 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081441 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: renew the @Factory
It didn´t works! When submit the value in fields are in screen and when I press the submit button again give error. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081438#4081438 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081438 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: renew the @Factory
Let's say your Seam component that contains this @Factory is session scoped; then you need to remove the current license from the session context. Example: | public String persistAndContinue(){ | super.persist(); | Contexts.getSessionContext().remove("license"); | setInstance(new License()); | } | Hope that helps. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081417#4081417 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081417 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user