Hey Guys,
I tried hacking the org.apache.myfaces.shared.renderkit.html.HTML constants contained in
<dependency>
<groupId>org.apache.myfaces.shared</groupId>
<artifactId>myfaces-shared-core</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
to see if I could add pass through attributes. I did do a quick test to make
sure the COMMON_PASSTHROUGH_ATTRIBUTES contained the new attributes, but it was
still unsuccessful.
Which I think goes with 1.2.0? My main reason for trying this is that it would
save having to re-implement encodeBegin on the renderer which I think is
necessary if I simply wanted to add another attribute and render it the normal
way.
I'll probably just create a new component/renderer pair, since it seems to be
the least amount of change to manage in the short run.
One thing that might save effort here is if the myfaces library had
encodeBeginStartTag and encodeBeginEndTag template methods that could be
overridden. That way new attributes could be inserted without reimplementing
all code in encodeBegin...Anyone like this idea? Thus inside encodeBegin we
would call these:
encodeBegin()
{
encodeBeginStartTag(component, responseWriter)
encodeBeginEndTag(component, responseWriter)
}
Then the subclassing renderer would just override encodeBeginStartTag and call it first. Then renderer the additional attribute.
The main rationale for doing stuff like this is that quickly adding attributes like
"dojoType" would enable a client side javascript component to wrap the rendered
element, enabling us to have both a server side and client side component tree.
Cheers,
- Ole