You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Simon Kitching (JIRA)" <my...@incubator.apache.org> on 2005/10/17 00:30:45 UTC

[jira] Created: (MYFACES-707) Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly

Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly
-------------------------------------------------------------------------------------------------

         Key: MYFACES-707
         URL: http://issues.apache.org/jira/browse/MYFACES-707
     Project: MyFaces
        Type: New Feature
  Components: Implementation  
    Reporter: Simon Kitching
    Priority: Minor


Currently, org.apache.myfaces.renderkit.html.HtmlTableRenderer calls "component.getChildren" directly from a number of methods.

I would like to see a new method "getChildren(UIComponent component)" defined whose default behaviour is just to return "component.getChildren", and calls to component.getChildren changed to call this new method.

This would allow me to override this new getChildren method in a subclass in order to be able to control the order in which child components are rendered by this component. In particular, I'm trying to extend the table renderer to allow user-customisable column ordering. Currently I have to implement this by having my custom renderer sort the elements in the child list of the component directly which isn't elegant and (I'm afraid) may not beportable or robust across releases of the library. Well it's that or duplicate every method that makes this call (which is most of them).

Perhaps this new method could even be defined in class org.apache.myfaces.renderkit.html so it's available for all renderers? 
Probably method getChildCount(Component) would need to be defined at the same time, just in case someone wants to write a renderer that actually hides some child components from a parent renderer.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-707) Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly

Posted by "Martin Marinschek (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-707?page=comments#action_12332340 ] 

Martin Marinschek commented on MYFACES-707:
-------------------------------------------

Patch on this welcome - if you  do it, I'll commit it.

regards,

Martin

> Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly
> -------------------------------------------------------------------------------------------------
>
>          Key: MYFACES-707
>          URL: http://issues.apache.org/jira/browse/MYFACES-707
>      Project: MyFaces
>         Type: New Feature
>   Components: Implementation
>     Reporter: Simon Kitching
>     Priority: Minor

>
> Currently, org.apache.myfaces.renderkit.html.HtmlTableRenderer calls "component.getChildren" directly from a number of methods.
> I would like to see a new method "getChildren(UIComponent component)" defined whose default behaviour is just to return "component.getChildren", and calls to component.getChildren changed to call this new method.
> This would allow me to override this new getChildren method in a subclass in order to be able to control the order in which child components are rendered by this component. In particular, I'm trying to extend the table renderer to allow user-customisable column ordering. Currently I have to implement this by having my custom renderer sort the elements in the child list of the component directly which isn't elegant and (I'm afraid) may not beportable or robust across releases of the library. Well it's that or duplicate every method that makes this call (which is most of them).
> Perhaps this new method could even be defined in class org.apache.myfaces.renderkit.html so it's available for all renderers? 
> Probably method getChildCount(Component) would need to be defined at the same time, just in case someone wants to write a renderer that actually hides some child components from a parent renderer.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (MYFACES-707) Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly

Posted by "Simon Kitching (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-707?page=all ]

Simon Kitching updated MYFACES-707:
-----------------------------------

    Attachment: HtmlRenderer.java.patch

This adds methods "getChildren" and "getChildCount" to the base class that all the html renderers inherit from, ie
  share/src/java/org/apache/myfaces/renderkit/html/HtmlRenderer.java

This prepares the ground for patches to make renderers use these new methods.

> Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly
> -------------------------------------------------------------------------------------------------
>
>          Key: MYFACES-707
>          URL: http://issues.apache.org/jira/browse/MYFACES-707
>      Project: MyFaces
>         Type: New Feature
>   Components: Implementation
>     Reporter: Simon Kitching
>     Assignee: Martin Marinschek
>     Priority: Minor
>  Attachments: HtmlRenderer.java.patch
>
> Currently, org.apache.myfaces.renderkit.html.HtmlTableRenderer calls "component.getChildren" directly from a number of methods.
> I would like to see a new method "getChildren(UIComponent component)" defined whose default behaviour is just to return "component.getChildren", and calls to component.getChildren changed to call this new method.
> This would allow me to override this new getChildren method in a subclass in order to be able to control the order in which child components are rendered by this component. In particular, I'm trying to extend the table renderer to allow user-customisable column ordering. Currently I have to implement this by having my custom renderer sort the elements in the child list of the component directly which isn't elegant and (I'm afraid) may not beportable or robust across releases of the library. Well it's that or duplicate every method that makes this call (which is most of them).
> Perhaps this new method could even be defined in class org.apache.myfaces.renderkit.html so it's available for all renderers? 
> Probably method getChildCount(Component) would need to be defined at the same time, just in case someone wants to write a renderer that actually hides some child components from a parent renderer.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-707) Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly

Posted by "Simon Kitching (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-707?page=comments#action_12332414 ] 

Simon Kitching commented on MYFACES-707:
----------------------------------------

Thanks for the encouragement Martin. A patch will be posted soon...

> Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly
> -------------------------------------------------------------------------------------------------
>
>          Key: MYFACES-707
>          URL: http://issues.apache.org/jira/browse/MYFACES-707
>      Project: MyFaces
>         Type: New Feature
>   Components: Implementation
>     Reporter: Simon Kitching
>     Assignee: Martin Marinschek
>     Priority: Minor

>
> Currently, org.apache.myfaces.renderkit.html.HtmlTableRenderer calls "component.getChildren" directly from a number of methods.
> I would like to see a new method "getChildren(UIComponent component)" defined whose default behaviour is just to return "component.getChildren", and calls to component.getChildren changed to call this new method.
> This would allow me to override this new getChildren method in a subclass in order to be able to control the order in which child components are rendered by this component. In particular, I'm trying to extend the table renderer to allow user-customisable column ordering. Currently I have to implement this by having my custom renderer sort the elements in the child list of the component directly which isn't elegant and (I'm afraid) may not beportable or robust across releases of the library. Well it's that or duplicate every method that makes this call (which is most of them).
> Perhaps this new method could even be defined in class org.apache.myfaces.renderkit.html so it's available for all renderers? 
> Probably method getChildCount(Component) would need to be defined at the same time, just in case someone wants to write a renderer that actually hides some child components from a parent renderer.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (MYFACES-707) Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-707?page=all ]
     
Martin Marinschek closed MYFACES-707:
-------------------------------------

    Fix Version: Nightly
     Resolution: Fixed

> Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly
> -------------------------------------------------------------------------------------------------
>
>          Key: MYFACES-707
>          URL: http://issues.apache.org/jira/browse/MYFACES-707
>      Project: MyFaces
>         Type: New Feature
>   Components: Implementation
>     Reporter: Simon Kitching
>     Assignee: Martin Marinschek
>     Priority: Minor
>      Fix For: Nightly
>  Attachments: HtmlGridRendererBase.java.patch, HtmlLinkRendererBase.java.patch, HtmlRenderer.java.patch, HtmlTableRendererBase.java.patch
>
> Currently, org.apache.myfaces.renderkit.html.HtmlTableRenderer calls "component.getChildren" directly from a number of methods.
> I would like to see a new method "getChildren(UIComponent component)" defined whose default behaviour is just to return "component.getChildren", and calls to component.getChildren changed to call this new method.
> This would allow me to override this new getChildren method in a subclass in order to be able to control the order in which child components are rendered by this component. In particular, I'm trying to extend the table renderer to allow user-customisable column ordering. Currently I have to implement this by having my custom renderer sort the elements in the child list of the component directly which isn't elegant and (I'm afraid) may not beportable or robust across releases of the library. Well it's that or duplicate every method that makes this call (which is most of them).
> Perhaps this new method could even be defined in class org.apache.myfaces.renderkit.html so it's available for all renderers? 
> Probably method getChildCount(Component) would need to be defined at the same time, just in case someone wants to write a renderer that actually hides some child components from a parent renderer.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (MYFACES-707) Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly

Posted by "Simon Kitching (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-707?page=all ]

Simon Kitching updated MYFACES-707:
-----------------------------------

    Attachment: HtmlTableRendererBase.java.patch
                HtmlLinkRendererBase.java.patch
                HtmlGridRendererBase.java.patch

Update renderers to use new inherited getChildCount(comp) and getChildren(comp) methods instead of comp.getChildCount() and comp.getChildren().
This allows child renderers to override these methods and change what child components a parent renderer sees.

By the way, I've noticed that HtmlGridRendererBase.java has no svn properties set. In particular it doesn't have eol-style set, and was checked in originally from a windows machine so I see DOS-style CR/LF line endings. I suggest setting:
  svn:keywords : Author Date Id Revision
  svn:eol-style : native

Regards,  Simon

> Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly
> -------------------------------------------------------------------------------------------------
>
>          Key: MYFACES-707
>          URL: http://issues.apache.org/jira/browse/MYFACES-707
>      Project: MyFaces
>         Type: New Feature
>   Components: Implementation
>     Reporter: Simon Kitching
>     Assignee: Martin Marinschek
>     Priority: Minor
>  Attachments: HtmlGridRendererBase.java.patch, HtmlLinkRendererBase.java.patch, HtmlRenderer.java.patch, HtmlTableRendererBase.java.patch
>
> Currently, org.apache.myfaces.renderkit.html.HtmlTableRenderer calls "component.getChildren" directly from a number of methods.
> I would like to see a new method "getChildren(UIComponent component)" defined whose default behaviour is just to return "component.getChildren", and calls to component.getChildren changed to call this new method.
> This would allow me to override this new getChildren method in a subclass in order to be able to control the order in which child components are rendered by this component. In particular, I'm trying to extend the table renderer to allow user-customisable column ordering. Currently I have to implement this by having my custom renderer sort the elements in the child list of the component directly which isn't elegant and (I'm afraid) may not beportable or robust across releases of the library. Well it's that or duplicate every method that makes this call (which is most of them).
> Perhaps this new method could even be defined in class org.apache.myfaces.renderkit.html so it's available for all renderers? 
> Probably method getChildCount(Component) would need to be defined at the same time, just in case someone wants to write a renderer that actually hides some child components from a parent renderer.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-707) Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly

Posted by "Simon Kitching (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-707?page=comments#action_12356465 ] 

Simon Kitching commented on MYFACES-707:
----------------------------------------

Is there any chance someone could check & commit the attached patches soon?

I've got a custom table renderer that outputs the table columns in an order chosen by the user. My current code implements this by *sorting* the child elements of the component so that the inherited rendering stuff sees the order I want. Yes, this sorting is very hacky but the alternative is to copy/paste much of the standard table renderer into my custom renderer. 

However recent commits to _ComponentChildrenList, HtmlDataTableHack and similar classes effectively and thoroughly breaks my hacky approach.

The provided patches should allow me (and others) to implement this sort of functionality in a far cleaner way, by presenting a "filtered" view of the child objects to the parent renderer. It's also a pretty low-risk patch.

Thanks.

> Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly
> -------------------------------------------------------------------------------------------------
>
>          Key: MYFACES-707
>          URL: http://issues.apache.org/jira/browse/MYFACES-707
>      Project: MyFaces
>         Type: New Feature
>   Components: Implementation
>     Reporter: Simon Kitching
>     Assignee: Martin Marinschek
>     Priority: Minor
>  Attachments: HtmlGridRendererBase.java.patch, HtmlLinkRendererBase.java.patch, HtmlRenderer.java.patch, HtmlTableRendererBase.java.patch
>
> Currently, org.apache.myfaces.renderkit.html.HtmlTableRenderer calls "component.getChildren" directly from a number of methods.
> I would like to see a new method "getChildren(UIComponent component)" defined whose default behaviour is just to return "component.getChildren", and calls to component.getChildren changed to call this new method.
> This would allow me to override this new getChildren method in a subclass in order to be able to control the order in which child components are rendered by this component. In particular, I'm trying to extend the table renderer to allow user-customisable column ordering. Currently I have to implement this by having my custom renderer sort the elements in the child list of the component directly which isn't elegant and (I'm afraid) may not beportable or robust across releases of the library. Well it's that or duplicate every method that makes this call (which is most of them).
> Perhaps this new method could even be defined in class org.apache.myfaces.renderkit.html so it's available for all renderers? 
> Probably method getChildCount(Component) would need to be defined at the same time, just in case someone wants to write a renderer that actually hides some child components from a parent renderer.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-707) Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-707?page=comments#action_12357259 ] 

Martin Marinschek commented on MYFACES-707:
-------------------------------------------

Finally committed.

Sorry for the delay.

regards,

Martin

> Define renderer method getChildren(UIComponent) instead of calling component.getChildren directly
> -------------------------------------------------------------------------------------------------
>
>          Key: MYFACES-707
>          URL: http://issues.apache.org/jira/browse/MYFACES-707
>      Project: MyFaces
>         Type: New Feature
>   Components: Implementation
>     Reporter: Simon Kitching
>     Assignee: Martin Marinschek
>     Priority: Minor
>  Attachments: HtmlGridRendererBase.java.patch, HtmlLinkRendererBase.java.patch, HtmlRenderer.java.patch, HtmlTableRendererBase.java.patch
>
> Currently, org.apache.myfaces.renderkit.html.HtmlTableRenderer calls "component.getChildren" directly from a number of methods.
> I would like to see a new method "getChildren(UIComponent component)" defined whose default behaviour is just to return "component.getChildren", and calls to component.getChildren changed to call this new method.
> This would allow me to override this new getChildren method in a subclass in order to be able to control the order in which child components are rendered by this component. In particular, I'm trying to extend the table renderer to allow user-customisable column ordering. Currently I have to implement this by having my custom renderer sort the elements in the child list of the component directly which isn't elegant and (I'm afraid) may not beportable or robust across releases of the library. Well it's that or duplicate every method that makes this call (which is most of them).
> Perhaps this new method could even be defined in class org.apache.myfaces.renderkit.html so it's available for all renderers? 
> Probably method getChildCount(Component) would need to be defined at the same time, just in case someone wants to write a renderer that actually hides some child components from a parent renderer.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira