You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2007/03/12 20:52:03 UTC
[Myfaces Wiki] Update of "Use Facelets with Tomahawk" by Sagar
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.
The following page has been changed by Sagar:
http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk
------------------------------------------------------------------------------
Dmitry Zemnitskiy
----
+ Or it can be implemented as
+ {{{
+ package ui.control;
+
+ import com.sun.facelets.tag.MetaRuleset;
+ import com.sun.facelets.tag.MethodRule;
+ import com.sun.facelets.tag.jsf.ComponentConfig;
+ import com.sun.facelets.tag.jsf.ComponentHandler;
+ import org.apache.myfaces.custom.tabbedpane.TabChangeEvent;
+
+ public class TabbedPaneComponentHandler extends ComponentHandler {
+ static final String METHOD_BINDING_ATTR_NAME = "tabChangeListener";
+ static final Class[] METHOD_BINDING_SIGNATURE = {TabChangeEvent.class};
+
+ protected final static MethodRule actionListenerTagRule = new MethodRule(
+ METHOD_BINDING_ATTR_NAME, void.class, METHOD_BINDING_SIGNATURE );
+
+ public TabbedPaneComponentHandler(ComponentConfig config) {
+ super(config);
+ }
+
+
+ protected MetaRuleset createMetaRuleset(Class type) {
+
+ return super.createMetaRuleset(type).addRule( actionListenerTagRule );
+
+ }
+
+ }
+
+ }}}
+
+ Sagar
+ ----
I've put together a tomahawk-facelets library, that provides custom tag handlers for components that have 'special' attributes, requiring Boolean or Integer options. It includes a modified facelets library description XML.