Facelet or JSF Component?
ohughes Jul 1, 2009 8:11 AMHi,
I have a project which is made up mostly of Facelet components due to their ease of development, but now I need to introduce SEAM into the mix, but it seems that SEAM has a problem with the parameters that are being passed into the facelet, which are generally standard java beans, it resolves these beans to be null, whereas without using seam components they are resolved fine.
For example, we have an action button facelet component, which takes an ActionButton bean as a parameter, and this bean tells it which image to use, etc, and there is an interface registered with the ActionButton bean which then notifies the listener class when an action is performed, i.e.
Facelet:
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:ice="http://www.icesoft.com/icefaces/component"> <ui:param name="actionButton" value="#{actionButton}"/> <ui:param name="disabled" value="#{disabled}"/> <ice:commandLink action="#{actionButton.notifyOfSelection}" style="text-decoration: none;" disabled="#{actionButton.disabled or disabled}" partialSubmit="false"> .... </ice:commandLink> </ui:composition>
ActionButton bean:
public abstract class ActionButton<E> implements Serializable { public ActionButton(ActionButtonListener actionButtonListener) { this.actionButtonListener = actionButtonListener; } .... public String notifyOfSelection() { return actionButtonListener.actionPerformed(this); } }
But when I change the commandLink to be an s:link, it can't resolve the actionButton, it says that it is null.
Is this somethig to do with different phases being executed for Facelet EL?
Would I have to re-write all of the Facelet components we have as full JSF components? If yes, then we end up having lots and lots of view logic in the code instead of as a collection of tags as it would be in a facelet.
Am I heading down the right road with this?? Or am I totally on the wrong path :)
Any tips or ideas are more than welcome,
Thanks,
Osian