myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Wessendorf" <mat...@apache.org>
Subject Re: HtmlColumn 1.2
Date Wed, 16 Jan 2008 22:30:59 GMT
ah, good.
please do it.

so, we can keep the 1.2.6 plugins, right?
Don't have time to look deeper at it, sorry

-M

On Jan 16, 2008 2:25 PM, Leonardo Uribe <lu4242@gmail.com> wrote:
> Hi
>
> Checking one test for h:column headerClass and footerClass (a test for
> see if  issue 4 of JSR 252), after MYFACES-1790
> does not work.
>
> The change from javax.faces.HtmlColumn to javax.faces.Column let this
> code on shared without effect:
>
> org.apache.myfaces.shared.renderkit.html.HtmlTableRendererBase
>
>     protected void renderColumnChildHeaderOrFooterRow(FacesContext facesContext,
>         ResponseWriter writer, UIComponent uiComponent, String
> styleClass, boolean isHeader) throws IOException
>     {
>         if (uiComponent instanceof UIColumn)
>         {
>             // allow column to override style class, new in JSF 1.2
>             if (uiComponent instanceof HtmlColumn) {
>                 HtmlColumn column = (HtmlColumn)uiComponent;
>                 if (isHeader && column.getHeaderClass()!=null)
>                     styleClass = column.getHeaderClass();
>                 else if (!isHeader && column.getFooterClass()!=null)
>                     styleClass = column.getFooterClass();
>             }
>
>             .........
>
>
> I don't like what spec says (it's just my opinion), because in runtime
> HtmlColumn is never used!.
>
> Testing this against facelets, this library creates UIColumn instances.
>
> Anyway the solution is to make this:
>
>     protected void renderColumnChildHeaderOrFooterRow(FacesContext facesContext,
>         ResponseWriter writer, UIComponent uiComponent, String
> styleClass, boolean isHeader) throws IOException
>     {
>         if (uiComponent instanceof UIColumn)
>         {
>             // allow column to override style class, new in JSF 1.2
>             if (uiComponent instanceof HtmlColumn) {
>                 HtmlColumn column = (HtmlColumn)uiComponent;
>                 if (isHeader && column.getHeaderClass()!=null)
>                     styleClass = column.getHeaderClass();
>                 else if (!isHeader && column.getFooterClass()!=null)
>                     styleClass = column.getFooterClass();
>             }else{
>                 //This code corrects MYFACES-1790, because HtmlColumnTag
>                 //has as component type javax.faces.Column, so as side
>                 //effect it not create HtmlColumn, it create UIColumn
>                 //classes.
>                 UIColumn column = (UIColumn) uiComponent;
>                 if (isHeader){
>                     String headerClass = (String)
> column.getAttributes().get("headerClass");
>                     if (headerClass != null){
>                         styleClass = (String) headerClass;
>                     }
>                 }else{
>                     String footerClass = (String)
> column.getAttributes().get("footerClass");
>                     if (footerClass != null){
>                         styleClass = (String) footerClass;
>                     }
>                 }
>             }
>
>            ......................
>
> I have tested this in both environments (pure myfaces and facelets)
> and works well.
>
> I believe this change fix MYFACES-1790
>



-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org

Mime
View raw message