是否有可能覆盖richfaces标签的实现?

时间:2018-04-19 12:14:38

标签: java jsf richfaces

例如rich:dataScroller具有以下实现类:

<component-type>org.richfaces.DataScroller</component-type>
<component-class>org.richfaces.component.UIDataScroller</component-class>
<cdk:handler-class>org.richfaces.taglib.DataScrollerHandler</cdk:handler-class>
<cdk:renderer-type>org.richfaces.DataScrollerRenderer</cdk:renderer-type>

是否可以将这些类切换到其他类?新类可能会扩展onces,但会覆盖一些方法。 DataScrollerHandler(超类ComponentHandler)具有以下两种方法: -onComponentCreated -onComponentPopulated

所以问题是:是否可以在不定义新的自定义标记的情况下覆盖这些类?所以实现onComponentCreated并仍然使用:

xmlns:rich="http://richfaces.org/rich"
...
rich:dataScroller id="scroller" execute=....

Richfaces 4.2.2 jsf 2.1.7

2 个答案:

答案 0 :(得分:0)

您可以在应用的faces-config.xml中更改组件定义,例如

<component>
    <component-type>org.richfaces.DataScroller</component-type>
    <component-class>com.example.myNewScroller</component-class>
</component>

答案 1 :(得分:0)

该解决方案适用于组件类。对于以下配置的渲染器,可以使用:

    <render-kit>
    <renderer>
        <component-family>org.richfaces.DataScroller</component-family>
        <renderer-type>org.richfaces.DataScrollerRenderer</renderer-type>
        <renderer-class>com.agentes.rfa.richfaces.RfaDataScrollerRenderer</renderer-class>
    </renderer>
    </render-kit>

我仍然没有找到覆盖处理程序类的好解决方案。也许是这样的Override ui:insert and ui:include-Handler

相关问题