Issue 51: HtmlRenderer not usable without HtmlHeader in taglib
Status:  Fixed
Owner: ----
Closed:  Nov 2007
Reported by acleme...@gmail.com, Nov 8, 2007
When using taglib there is the possibility of specifying a HeaderRenderer
instead of the default.

Here is the the code in HtmlColumnTag class method getColumn : 
 HeaderEditor headerEditor = getColumnHeaderEditor(facadeTag);
        if (headerEditor != null) {
            column.getHeaderRenderer().setHeaderEditor(headerEditor);
        }

The getColumnHeaderEditory returns null if nothing was specified in taglib
and the headerEditory is therefore never injected in the custom
HeaderRenderer giving a NullPointerException when trying to use it.

Or maybe I misunderstood the way to use all this...

Arthur CLEMENT
 
Nov 8, 2007
#1 extremec...@gmail.com
This is a bug!

What you could do right now is set the default HeaderEditor explicitly. By that I
mean set it to org.jmesa.view.html.editor.HtmlHeaderEditor.

<jmesa:htmlColumn headerEditor="org.jmesa.view.html.editor.HtmlHeaderEditor"/>

Also, just to validate that this is what you want... The HeaderEditor specifies what
you want the header to do, and the renderer specifies what the header looks like. I
put the renderer as a tag attribute to be complete, but I wasn't sure if developers
would actually find swapping out the renderer to be useful. You might want to look at
the source implementations to understand the differences if you are not sure.

Status: Accepted
Labels: -Priority-Medium Priority-High
Nov 9, 2007
#2 acleme...@gmail.com
I did look at the source implementations.
Ok the reason I want to change to headerRenderer is because the default
implementation renders td tags and I want th tags. Actually you might want to change
the implementation to render th tags.
I had to do this to comply with the css I was given to render the table.
Anyway, I had already done what you suggested in your comment in the first place but
then I had to write my own HeaderEditor to handle the sort arrows a bit differently.
Thanks for the quick replies.

Jmesa is an excellent library.

I have more suggestions about pluggable editors and renderers but this is probably
not the place.

Arthur


Nov 24, 2007
#3 extremec...@gmail.com
The renderers and editors will now use the defaults if nothing is specified. This
presented itself as a great opportunity to refactor those methods and make them much
more simply and robust at the same time.

Also, the renderer element can now be specified as a td or a th element. The default
is a td element and can be overridden in the preferences file.

html.column.header.renderer.element=td
Status: Fixed