0

for example the rich:dataScroller has the following implementation classes:

<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>

would it be possible to switch these classes to some other classes? the new classes would probably extend the onces up, but would override some methods. DataScrollerHandler (super class ComponentHandler) has the following 2 methods: -onComponentCreated -onComponentPopulated

so the question would be: is it possible to override these classes without defining a new custom tag? so implement the onComponentCreated and still use:

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

Richfaces 4.2.2 jsf 2.1.7

Szilard K
  • 48
  • 10
  • _"is it possible to override these classes without defining a new custom tag? "_ Yes you can... Try... you already seem to know where to change things... – Kukeltje Apr 19 '18 at 18:01

2 Answers2

0

You can change the component definition in your app's faces-config.xml, e.g.

<component>
    <component-type>org.richfaces.DataScroller</component-type>
    <component-class>com.example.myNewScroller</component-class>
</component>
Makhiel
  • 3,874
  • 1
  • 15
  • 21
0

the solution works for the component class. for the renderer following configuration can be used:

    <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>

i still did not find a good solution to override the handler-class. maybe something like this Override ui:insert and ui:include-Handler

Szilard K
  • 48
  • 10