Is it possible to get the behaviour of a h:commandLink without using javascript? I’m using JSF2
If I want to use a lightbox component, I will need to have the full generated URL beforehand. If my URLs are action-based, I can only use h:commandLink, which generates javascript binded to the mouse click action.
I would like to have the JSF navigation features (eg: use action="#{bean.action}" to generate links) and have a way to get the full generated URL.
Use
<h:outputLink>or<h:link>instead. This generates a plain HTML<a>element without the need for a<h:form>. To invoke actions, you have to move the logic from the bean action method to the constructor or@PostConstructof the managed bean which is associated with the opened view.If you need to pass parameters, use
<f:param>to append them as a query string. You can use<managed-property>infaces-config.xml(or@ManagedPropertywhen you’re already on JSF 2.0) to set those parameters in the bean. You can access them in@PostConstructmethod.