tags:

views:

382

answers:

1

I found a problem when using the h:commandLink in a page included by Tiles, the action/actionlistener associated with the h:commandLink is simply not being invoked. Is there any solution?

Note that there are no validation errors or such any other error.

+7  A: 

Whenever an UICommand component fails to invoke the associated action, verify the following:

  1. UICommand components must be placed inside an UIForm component (e.g. h:form).
  2. You cannot nest multiple UIForm components in each other (watch out with include files!).
  3. No validation/conversion error should have been occurred (use h:messages to get them all).
  4. If UICommand components are placed inside an UIData component, ensure that exactly the same DataModel (the object behind the UIData's value attribute) is preserved.
  5. The rendered and disabled attributes of the component and all of the parent components should not evaluate to false during apply request values phase.
  6. Be sure that no PhaseListener or any EventListener in the request-response chain has changed the JSF lifecycle to skip the invoke action phase.
  7. Be sure that no Filter or Servlet in the same request-response chain has blocked the request fo the FacesServlet somehow.

My bet that your problem is caused by point 2: nested forms. You probably already have a h:form in the parent page which wraps the include file. The include file itself should not have a h:form. You can also fix it the other way round, ensure that the parent page does not have a h:form around the place of the include file.

BalusC
Thanks, It worked with me :)
Mohammed
You're welcome.
BalusC
@BalusC your 2nd point made me think -- for a long while. I just found out that an f:view tag in my main file was the cause of most of my problems. And probably because it renders a form, right?
Paulo Guedes