-
1. Re: a4j:commandButton does nothing on first click, works on second click
blabno Jan 19, 2012 2:40 AM (in response to mark.robinson)What version fo RF?
Is navigation triggered by navigation rules in faces-config? If so show it.
-
2. Re: a4j:commandButton does nothing on first click, works on second click
mark.robinson Jan 19, 2012 12:41 PM (in response to blabno)Hi Bernard,
This is RF 4.1 and the navigation is done rules in faces-config.
<navigation-rule>
<from-view-id>/login.jsf</from-view-id>
<navigation-case>
<from-outcome>registration</from-outcome>
<to-view-id>/registration.jsf</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/registration.jsf</from-view-id>
<navigation-case>
<from-outcome>login</from-outcome>
<to-view-id>/login.jsf</to-view-id>
</navigation-case>
</navigation-rule> -
3. Re: a4j:commandButton does nothing on first click, works on second click
blabno Jan 20, 2012 2:24 AM (in response to mark.robinson)Shouldn't page id in from-view-id and to-view-id be with ".xhtml" extension?
I've had problem with double click when I was rerendering the entire form (or component surrounding form) from other form.
-
4. Re: a4j:commandButton does nothing on first click, works on second click
mark.robinson Jan 20, 2012 12:19 PM (in response to blabno)I don't think it should be .xhtml, the files are named .jsf. I did try switching it to .xhtml, it worked but the issues remained.
How did you solve the issue with double click on multiple forms? I think it might be related.
-
5. Re: a4j:commandButton does nothing on first click, works on second click
blabno Jan 20, 2012 4:35 PM (in response to mark.robinson)You just don't re-render forms or their parents from outside of them. What I do is to put some component like h:panelGroup (make sure it renders on page by giving it an id or styleClass) inside the form and nest all other form contents in it. Then I re-render only that h:panelGroup instead of form. That's it. It's a bug in JSF 2.0 (and probably 2.1) specification and this is the dummy workaround but we've got to live with it.
-
6. Re: a4j:commandButton does nothing on first click, works on second click
alv21 Aug 3, 2012 6:14 AM (in response to blabno)Bernard Labno ha scritto:
You just don't re-render forms or their parents from outside of them. What I do is to put some component like h:panelGroup (make sure it renders on page by giving it an id or styleClass) inside the form and nest all other form contents in it. Then I re-render only that h:panelGroup instead of form. That's it. It's a bug in JSF 2.0 (and probably 2.1) specification and this is the dummy workaround but we've got to live with it.
finally this is what I need to know and it solved my problems after 3 hours! (using jsf2 and richfaces4)
but I used <a4j:outputPanel instead h:panelGroup
thanks
-
7. Re: a4j:commandButton does nothing on first click, works on second click
healeyb Aug 5, 2012 6:19 PM (in response to alv21)Perhaps worth noting that JSF 2 has implicit navigation so you can just have <h:commandButton action="login" and it will try
to navigate to login.xhtml (or whatever default suffix is) with nothing in faces-config. I tried your code (minus the composite
component) including the nav rules in faces-config and it worked first time every time for me, which made me wonder if there
might be another factor involved which we've not considered yet. What state saving are you using in web.xml, and are you
using prefix or suffix mapping for FacesServlet?
It's also never a bad idea to make sure that there are no javascript errors by running with the javascript console from your
browser/developer tools/error console (whichever).
-
8. Re: a4j:commandButton does nothing on first click, works on second click
navurinv Aug 5, 2012 2:56 AM (in response to mark.robinson)please use execute attribute it may solve your problem