You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Paul Palaszewski (JIRA)" <de...@myfaces.apache.org> on 2007/02/28 18:41:57 UTC

[jira] Created: (TOMAHAWK-912) HtmlDataTable's column groupBy should work with HtmlCommandLinks ...

HtmlDataTable's column groupBy should work with HtmlCommandLinks ...
--------------------------------------------------------------------

                 Key: TOMAHAWK-912
                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-912
             Project: MyFaces Tomahawk
          Issue Type: Improvement
          Components: Extended Datatable
    Affects Versions: 1.1.3, 1.1.5-SNAPSHOT
            Reporter: Paul Palaszewski


Hi!

I'm using the extended data table with groupBy which works fine for outputText (any ValueHolder derived from UIOutput), but it ignores commandLinks, which is anoying if the column's value is only displayed as link.

I've checked versions 1.1.3 and 1.1.5 snapshot ... imho, the issue is in HtmlTableRenderer#createColumnInfos somewhere around line 286 which looks like ..

                    UIComponent currentColumnChild = (UIComponent) currentColumnChildren.get(j);
                    if (currentColumnChild.isRendered() && currentColumnChild instanceof ValueHolder)
                    {
                        Object value = ((ValueHolder) currentColumnChild).getValue();
                        if (value != null) {
                            Converter converter =
                                HtmlRendererUtils.findUIOutputConverterFailSafe(facesContext, currentColumnChild);
                            currentColumnContent.append(
                                RendererUtils.getConvertedStringValue(facesContext, currentColumnChild,
                                                                      converter, value)); // TODO converter
                        }
                    }

HtmlCommandLinks are UICommands and not UIOutputs which implement ValueHolder. To fix this, I tried to patch HtmlCommandLink to implement ValueHolder, but this results in a class cast exception since some part of #findUIOutputConverterFailSafe tries to cast the component as UIOutput. So I've added another instance of, which works fine for me:

                    UIComponent currentColumnChild = (UIComponent) currentColumnChildren.get(j);
                    if (currentColumnChild.isRendered()) {
                        if (currentColumnChild instanceof ValueHolder)
                        {
                            Object value = ((ValueHolder) currentColumnChild).getValue();
                            if (value != null) {
                                Converter converter =
                                    HtmlRendererUtils.findUIOutputConverterFailSafe(facesContext, currentColumnChild);
                                currentColumnContent.append(
                                    RendererUtils.getConvertedStringValue(facesContext, currentColumnChild,
                                                                          converter, value)); // TODO converter
                            }
                        } else if (currentColumnChild instanceof UICommand) {
                            Object value = ((UICommand) currentColumnChild).getValue();
                            if (value != null) {
                                currentColumnContent.append(value);
                            }
                        }
                    }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Updated: (TOMAHAWK-912) HtmlDataTable's column groupBy should work with HtmlCommandLinks ...

Posted by Mike Kienenberger <mk...@gmail.com>.
Paul,

Your logic sounds reasonable to me, but I've never used groupBy.


On 2/28/07, Paul Palaszewski (JIRA) <de...@myfaces.apache.org> wrote:
>
>      [ https://issues.apache.org/jira/browse/TOMAHAWK-912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Paul Palaszewski updated TOMAHAWK-912:
> --------------------------------------
>
>     Status: Patch Available  (was: Open)
>
> > HtmlDataTable's column groupBy should work with HtmlCommandLinks ...
> > --------------------------------------------------------------------
> >
> >                 Key: TOMAHAWK-912
> >                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-912
> >             Project: MyFaces Tomahawk
> >          Issue Type: Improvement
> >          Components: Extended Datatable
> >    Affects Versions: 1.1.3, 1.1.5-SNAPSHOT
> >            Reporter: Paul Palaszewski
> >
> > Hi!
> > I'm using the extended data table with groupBy which works fine for outputText (any ValueHolder derived from UIOutput), but it ignores commandLinks, which is anoying if the column's value is only displayed as link.
> > I've checked versions 1.1.3 and 1.1.5 snapshot ... imho, the issue is in HtmlTableRenderer#createColumnInfos somewhere around line 286 which looks like ..
> >                     UIComponent currentColumnChild = (UIComponent) currentColumnChildren.get(j);
> >                     if (currentColumnChild.isRendered() && currentColumnChild instanceof ValueHolder)
> >                     {
> >                         Object value = ((ValueHolder) currentColumnChild).getValue();
> >                         if (value != null) {
> >                             Converter converter =
> >                                 HtmlRendererUtils.findUIOutputConverterFailSafe(facesContext, currentColumnChild);
> >                             currentColumnContent.append(
> >                                 RendererUtils.getConvertedStringValue(facesContext, currentColumnChild,
> >                                                                       converter, value)); // TODO converter
> >                         }
> >                     }
> > HtmlCommandLinks are UICommands and not UIOutputs which implement ValueHolder. To fix this, I tried to patch HtmlCommandLink to implement ValueHolder, but this results in a class cast exception since some part of #findUIOutputConverterFailSafe tries to cast the component as UIOutput. So I've added another instance of, which works fine for me:
> >                     UIComponent currentColumnChild = (UIComponent) currentColumnChildren.get(j);
> >                     if (currentColumnChild.isRendered()) {
> >                         if (currentColumnChild instanceof ValueHolder)
> >                         {
> >                             Object value = ((ValueHolder) currentColumnChild).getValue();
> >                             if (value != null) {
> >                                 Converter converter =
> >                                     HtmlRendererUtils.findUIOutputConverterFailSafe(facesContext, currentColumnChild);
> >                                 currentColumnContent.append(
> >                                     RendererUtils.getConvertedStringValue(facesContext, currentColumnChild,
> >                                                                           converter, value)); // TODO converter
> >                             }
> >                         } else if (currentColumnChild instanceof UICommand) {
> >                             Object value = ((UICommand) currentColumnChild).getValue();
> >                             if (value != null) {
> >                                 currentColumnContent.append(value);
> >                             }
> >                         }
> >                     }
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

[jira] Commented: (TOMAHAWK-912) HtmlDataTable's column groupBy should work with HtmlCommandLinks ...

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485351 ] 

Mike Kienenberger commented on TOMAHAWK-912:
--------------------------------------------

You'll need to provide this in the form of a patch, preferably a unified diff.

> HtmlDataTable's column groupBy should work with HtmlCommandLinks ...
> --------------------------------------------------------------------
>
>                 Key: TOMAHAWK-912
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-912
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Extended Datatable
>    Affects Versions: 1.1.3, 1.1.5-SNAPSHOT
>            Reporter: Paul Palaszewski
>
> Hi!
> I'm using the extended data table with groupBy which works fine for outputText (any ValueHolder derived from UIOutput), but it ignores commandLinks, which is anoying if the column's value is only displayed as link.
> I've checked versions 1.1.3 and 1.1.5 snapshot ... imho, the issue is in HtmlTableRenderer#createColumnInfos somewhere around line 286 which looks like ..
>                     UIComponent currentColumnChild = (UIComponent) currentColumnChildren.get(j);
>                     if (currentColumnChild.isRendered() && currentColumnChild instanceof ValueHolder)
>                     {
>                         Object value = ((ValueHolder) currentColumnChild).getValue();
>                         if (value != null) {
>                             Converter converter =
>                                 HtmlRendererUtils.findUIOutputConverterFailSafe(facesContext, currentColumnChild);
>                             currentColumnContent.append(
>                                 RendererUtils.getConvertedStringValue(facesContext, currentColumnChild,
>                                                                       converter, value)); // TODO converter
>                         }
>                     }
> HtmlCommandLinks are UICommands and not UIOutputs which implement ValueHolder. To fix this, I tried to patch HtmlCommandLink to implement ValueHolder, but this results in a class cast exception since some part of #findUIOutputConverterFailSafe tries to cast the component as UIOutput. So I've added another instance of, which works fine for me:
>                     UIComponent currentColumnChild = (UIComponent) currentColumnChildren.get(j);
>                     if (currentColumnChild.isRendered()) {
>                         if (currentColumnChild instanceof ValueHolder)
>                         {
>                             Object value = ((ValueHolder) currentColumnChild).getValue();
>                             if (value != null) {
>                                 Converter converter =
>                                     HtmlRendererUtils.findUIOutputConverterFailSafe(facesContext, currentColumnChild);
>                                 currentColumnContent.append(
>                                     RendererUtils.getConvertedStringValue(facesContext, currentColumnChild,
>                                                                           converter, value)); // TODO converter
>                             }
>                         } else if (currentColumnChild instanceof UICommand) {
>                             Object value = ((UICommand) currentColumnChild).getValue();
>                             if (value != null) {
>                                 currentColumnContent.append(value);
>                             }
>                         }
>                     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TOMAHAWK-912) HtmlDataTable's column groupBy should work with HtmlCommandLinks ...

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TOMAHAWK-912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Kienenberger updated TOMAHAWK-912:
---------------------------------------

    Status: Open  (was: Patch Available)

> HtmlDataTable's column groupBy should work with HtmlCommandLinks ...
> --------------------------------------------------------------------
>
>                 Key: TOMAHAWK-912
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-912
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Extended Datatable
>    Affects Versions: 1.1.3, 1.1.5-SNAPSHOT
>            Reporter: Paul Palaszewski
>
> Hi!
> I'm using the extended data table with groupBy which works fine for outputText (any ValueHolder derived from UIOutput), but it ignores commandLinks, which is anoying if the column's value is only displayed as link.
> I've checked versions 1.1.3 and 1.1.5 snapshot ... imho, the issue is in HtmlTableRenderer#createColumnInfos somewhere around line 286 which looks like ..
>                     UIComponent currentColumnChild = (UIComponent) currentColumnChildren.get(j);
>                     if (currentColumnChild.isRendered() && currentColumnChild instanceof ValueHolder)
>                     {
>                         Object value = ((ValueHolder) currentColumnChild).getValue();
>                         if (value != null) {
>                             Converter converter =
>                                 HtmlRendererUtils.findUIOutputConverterFailSafe(facesContext, currentColumnChild);
>                             currentColumnContent.append(
>                                 RendererUtils.getConvertedStringValue(facesContext, currentColumnChild,
>                                                                       converter, value)); // TODO converter
>                         }
>                     }
> HtmlCommandLinks are UICommands and not UIOutputs which implement ValueHolder. To fix this, I tried to patch HtmlCommandLink to implement ValueHolder, but this results in a class cast exception since some part of #findUIOutputConverterFailSafe tries to cast the component as UIOutput. So I've added another instance of, which works fine for me:
>                     UIComponent currentColumnChild = (UIComponent) currentColumnChildren.get(j);
>                     if (currentColumnChild.isRendered()) {
>                         if (currentColumnChild instanceof ValueHolder)
>                         {
>                             Object value = ((ValueHolder) currentColumnChild).getValue();
>                             if (value != null) {
>                                 Converter converter =
>                                     HtmlRendererUtils.findUIOutputConverterFailSafe(facesContext, currentColumnChild);
>                                 currentColumnContent.append(
>                                     RendererUtils.getConvertedStringValue(facesContext, currentColumnChild,
>                                                                           converter, value)); // TODO converter
>                             }
>                         } else if (currentColumnChild instanceof UICommand) {
>                             Object value = ((UICommand) currentColumnChild).getValue();
>                             if (value != null) {
>                                 currentColumnContent.append(value);
>                             }
>                         }
>                     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TOMAHAWK-912) HtmlDataTable's column groupBy should work with HtmlCommandLinks ...

Posted by "Paul Palaszewski (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TOMAHAWK-912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Palaszewski updated TOMAHAWK-912:
--------------------------------------

    Status: Patch Available  (was: Open)

> HtmlDataTable's column groupBy should work with HtmlCommandLinks ...
> --------------------------------------------------------------------
>
>                 Key: TOMAHAWK-912
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-912
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Extended Datatable
>    Affects Versions: 1.1.3, 1.1.5-SNAPSHOT
>            Reporter: Paul Palaszewski
>
> Hi!
> I'm using the extended data table with groupBy which works fine for outputText (any ValueHolder derived from UIOutput), but it ignores commandLinks, which is anoying if the column's value is only displayed as link.
> I've checked versions 1.1.3 and 1.1.5 snapshot ... imho, the issue is in HtmlTableRenderer#createColumnInfos somewhere around line 286 which looks like ..
>                     UIComponent currentColumnChild = (UIComponent) currentColumnChildren.get(j);
>                     if (currentColumnChild.isRendered() && currentColumnChild instanceof ValueHolder)
>                     {
>                         Object value = ((ValueHolder) currentColumnChild).getValue();
>                         if (value != null) {
>                             Converter converter =
>                                 HtmlRendererUtils.findUIOutputConverterFailSafe(facesContext, currentColumnChild);
>                             currentColumnContent.append(
>                                 RendererUtils.getConvertedStringValue(facesContext, currentColumnChild,
>                                                                       converter, value)); // TODO converter
>                         }
>                     }
> HtmlCommandLinks are UICommands and not UIOutputs which implement ValueHolder. To fix this, I tried to patch HtmlCommandLink to implement ValueHolder, but this results in a class cast exception since some part of #findUIOutputConverterFailSafe tries to cast the component as UIOutput. So I've added another instance of, which works fine for me:
>                     UIComponent currentColumnChild = (UIComponent) currentColumnChildren.get(j);
>                     if (currentColumnChild.isRendered()) {
>                         if (currentColumnChild instanceof ValueHolder)
>                         {
>                             Object value = ((ValueHolder) currentColumnChild).getValue();
>                             if (value != null) {
>                                 Converter converter =
>                                     HtmlRendererUtils.findUIOutputConverterFailSafe(facesContext, currentColumnChild);
>                                 currentColumnContent.append(
>                                     RendererUtils.getConvertedStringValue(facesContext, currentColumnChild,
>                                                                           converter, value)); // TODO converter
>                             }
>                         } else if (currentColumnChild instanceof UICommand) {
>                             Object value = ((UICommand) currentColumnChild).getValue();
>                             if (value != null) {
>                                 currentColumnContent.append(value);
>                             }
>                         }
>                     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.