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 2006/04/12 20:03:58 UTC
[Myfaces Wiki] Update of "Use Facelets with Tomahawk" by AndrewRobinson
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 AndrewRobinson:
http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk
The comment on the change is:
Added tag handler for the t:dataTable component
------------------------------------------------------------------------------
Andrew Robinson
----
+
+ Like the tree2, the extended tomahawk data table uses "non-standard" attribute names for some of the properties and without the tag, the attributes are not set correctly. The following code can be used as a tag handler to make sure these row attributes are set correctly on the data table component:
+
+ {{{
+ import org.apache.myfaces.renderkit.JSFAttr;
+
+ import com.sun.facelets.tag.MetaRuleset;
+ import com.sun.facelets.tag.jsf.ComponentConfig;
+ import com.sun.facelets.tag.jsf.ComponentHandler;
+
+ public class DataTableExTagHandler
+ extends ComponentHandler
+ {
+ public DataTableExTagHandler(ComponentConfig cfg)
+ {
+ super(cfg);
+ }
+
+ @Override
+ protected MetaRuleset createMetaRuleset(Class type)
+ {
+ return super.createMetaRuleset(type)
+ .alias("rowId", JSFAttr.ROW_ID)
+ .alias("rowStyleClass", JSFAttr.ROW_STYLECLASS_ATTR)
+ .alias("rowStyle", JSFAttr.ROW_STYLE_ATTR);
+ }
+ }
+ }}}
+
+ Also please node that you are welcome to use and contribute to the "tagHandlers" release of
+ [http://jsf-comp.sourceforge.net jsf-comp]. I will probably add this to that project (tagHandlers.jar). There
+ is already one for <t:updateActionListener />
+
+ Andrew Robinson
+
+ ----
+
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.
It can be obtained from [http://satva.skalasoft.com/~martin/dl/tomahawk-facelets.jar here]