[ 
https://issues.jboss.org/browse/RF-12619?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fab Mars updated RF-12619:
--------------------------

                    Labels: a4j:commandbutton cdi facelets seamfaces viewscoped 
 (was: )
               Environment: Windows, JDK 1.7.0_09, Glassfish 3.1.2.2 with 
Mojarra 2.1.14 (at least >= 2.1.8), RF 4.3.0 M2 (also on RF 4.2.x), Weld 1.1.8 
and SeamFaces 3.1.0.  (was: Windows, JDK 1.7.0_09, Glassfish 3.1.2.2 with 
Mojarra 2.1.14 (at least >= 2.1.8), RF 4.3.0 M2 (also on RF 4.2.x), and 
SeamFaces 3.1.0.)
    Workaround Description: When triggering partial renders containing command 
buttons use <h:commandButton><f:ajax/></h:commandButton> instead of 
<a4j:commandButton/>
                Workaround: Workaround Exists
               Description: 
Here is a weird case I found after updating a project of mine from JSF 1.2 & RF 
3.x to JSF 2.1 and RF 4.2.3/4.3.0M2. See attached project.

On a part of the page which is into a Facelets insert, I can click on a 
<a4j:commandButton/> to trigger the creation of some entity instance and 
dynamically display another form associated to that entity in another part of 
the page. So, there are 2 forms on the screen, one for the creation button, 
another one to edit the entity, both are always displayed but the content of 
the latter isn't rendered until the entity exists. The page actions are held by 
some backing bean which also contains the form.

>From the second form, I can submit the entity once updated. The buttons are 
><h:commandButton/> this time and the action returns null so I can stay on the 
>same view and keep on working.


Back with RF 3.x, I used the keepAlive tag to maintain the page's backing bean 
along the page life. All worked fine. After JSF 2.1 and RF 4 and CDI were 
released, I intended on using @ViewScoped instead. Naturally I had to add 
SeamFaces so my @ViewScoped beans were actually CDI-managed, and I updated my 
whole codebase.

Well, now, when the creation button is used, the form dynamically displays all 
right BUT when I try to submit the second form, my @ViewScoped bean vanishes 
(pbly the viewMap vanishes entirely).

However, if I use <h:commandButton><f:ajax/></h:commandButton> instead, 
everything works fine. hich leads me to believe there is a bug/regression from 
RF3.3 on a4j:command* components (maybe a4j:ajax/a4j:poll, didn't check).
                Complexity: High
        Steps to Reproduce: 
In the attached example, first click on "Init by RichFaces" and try using the 
form and see what happens on System.out. Then click on "Init by Mojarra" and 
see there is a different behavior.



- I don't think it's relevant testing this with any JSF version < 2.1.8 because 
partial view handling was bogus before (see 
http://java.net/jira/browse/JAVASERVERFACES-2373). I used 2.1.14 here.
- This problem happens only if the 2nd form's submit buttons are dynamically 
added to the page after the use of an a4j:command*. When the submit buttons are 
displayed from the start, all works fine.
- I'm NOT playing with javax.faces.PARTIAL_STATE_SAVING !
- Naturally you HAVE to use CDI and SeamFaces for this example.
- This issue may be linked to https://issues.jboss.org/browse/RF-12442
                
> @ViewScoped (SeamFaces) beans lost with a4j:command* and dynamic form
> ---------------------------------------------------------------------
>
>                 Key: RF-12619
>                 URL: https://issues.jboss.org/browse/RF-12619
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-a4j-core
>    Affects Versions: 4.3.0.M2
>         Environment: Windows, JDK 1.7.0_09, Glassfish 3.1.2.2 with Mojarra 
> 2.1.14 (at least >= 2.1.8), RF 4.3.0 M2 (also on RF 4.2.x), Weld 1.1.8 and 
> SeamFaces 3.1.0.
>            Reporter: Fab Mars
>              Labels: a4j:commandbutton, cdi, facelets, seamfaces, viewscoped
>         Attachments: TestViewScope.zip
>
>
> Here is a weird case I found after updating a project of mine from JSF 1.2 & 
> RF 3.x to JSF 2.1 and RF 4.2.3/4.3.0M2. See attached project.
> On a part of the page which is into a Facelets insert, I can click on a 
> <a4j:commandButton/> to trigger the creation of some entity instance and 
> dynamically display another form associated to that entity in another part of 
> the page. So, there are 2 forms on the screen, one for the creation button, 
> another one to edit the entity, both are always displayed but the content of 
> the latter isn't rendered until the entity exists. The page actions are held 
> by some backing bean which also contains the form.
> From the second form, I can submit the entity once updated. The buttons are 
> <h:commandButton/> this time and the action returns null so I can stay on the 
> same view and keep on working.
> Back with RF 3.x, I used the keepAlive tag to maintain the page's backing 
> bean along the page life. All worked fine. After JSF 2.1 and RF 4 and CDI 
> were released, I intended on using @ViewScoped instead. Naturally I had to 
> add SeamFaces so my @ViewScoped beans were actually CDI-managed, and I 
> updated my whole codebase.
> Well, now, when the creation button is used, the form dynamically displays 
> all right BUT when I try to submit the second form, my @ViewScoped bean 
> vanishes (pbly the viewMap vanishes entirely).
> However, if I use <h:commandButton><f:ajax/></h:commandButton> instead, 
> everything works fine. hich leads me to believe there is a bug/regression 
> from RF3.3 on a4j:command* components (maybe a4j:ajax/a4j:poll, didn't check).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
richfaces-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/richfaces-issues

Reply via email to