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)" <de...@myfaces.apache.org> on 2005/11/04 02:49:48 UTC

[jira] Created: (MYFACES-781) UIData accesses its grandchild components directly

UIData accesses its grandchild components directly
--------------------------------------------------

         Key: MYFACES-781
         URL: http://issues.apache.org/jira/browse/MYFACES-781
     Project: MyFaces
        Type: Bug
  Components: Implementation  
    Reporter: Simon Kitching


For an HTML table, much of the decoding process is controlled by the components rather than the renderer.
In the class javax.faces.component.UIData, method "processColumnChildren" (which is called by processDecodes) does this:

  for (Iterator it = getChildren().iterator(); it.hasNext();)
  {
      UIComponent child = (UIComponent) it.next();
      if (child instanceof UIColumn)
      {
          if (!child.isRendered())
          {
              //Column is not visible
              continue;
          }
          for (Iterator columnChildIter = child.getChildren()
              .iterator(); columnChildIter.hasNext();)
          {
             UIComponent columnChild = (UIComponent) columnChildIter
                  .next();
             process(context, columnChild, processAction);
          }
      }
  }

And that last call to process them calls component.processDecodes, which delegates to the renderer as needed.

However this code means UIData is accessing its *grandchildren* directly, rather than just its children. I don't believe this is very nice OO design; UIData's children should be responsible for managing their own children, ie the UIColumn class should be told to process the children rather than calling getChildren on it and manipulating those directly. 

It also makes it impossible for a custom UIColumn class to receive decode calls; they go direct to the custom column's children.

See this email thread for more info, esp. responses by Mike Kienenberger (thanks, Mike):
  http://www.mail-archive.com/users%40myfaces.apache.org/msg11363.html

-- 
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-781) UIData accesses its grandchild components directly

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

    Resolution: Won't Fix

> UIData accesses its grandchild components directly
> --------------------------------------------------
>
>          Key: MYFACES-781
>          URL: http://issues.apache.org/jira/browse/MYFACES-781
>      Project: MyFaces
>         Type: Bug
>   Components: Implementation
>     Reporter: Simon Kitching

>
> For an HTML table, much of the decoding process is controlled by the components rather than the renderer.
> In the class javax.faces.component.UIData, method "processColumnChildren" (which is called by processDecodes) does this:
>   for (Iterator it = getChildren().iterator(); it.hasNext();)
>   {
>       UIComponent child = (UIComponent) it.next();
>       if (child instanceof UIColumn)
>       {
>           if (!child.isRendered())
>           {
>               //Column is not visible
>               continue;
>           }
>           for (Iterator columnChildIter = child.getChildren()
>               .iterator(); columnChildIter.hasNext();)
>           {
>              UIComponent columnChild = (UIComponent) columnChildIter
>                   .next();
>              process(context, columnChild, processAction);
>           }
>       }
>   }
> And that last call to process them calls component.processDecodes, which delegates to the renderer as needed.
> However this code means UIData is accessing its *grandchildren* directly, rather than just its children. I don't believe this is very nice OO design; UIData's children should be responsible for managing their own children, ie the UIColumn class should be told to process the children rather than calling getChildren on it and manipulating those directly. 
> It also makes it impossible for a custom UIColumn class to receive decode calls; they go direct to the custom column's children.
> See this email thread for more info, esp. responses by Mike Kienenberger (thanks, Mike):
>   http://www.mail-archive.com/users%40myfaces.apache.org/msg11363.html

-- 
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-781) UIData accesses its grandchild components directly

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-781?page=comments#action_12356733 ] 

Mike Kienenberger commented on MYFACES-781:
-------------------------------------------

http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/faces/component/UIComponentBase.html#processDecodes(javax.faces.context.FacesContext)

The javadocs state "Call the processDecodes() method of all facets and children of this UIComponent, in the order determined by a call to getFacetsAndChildren()." and that's not currently happening since there are no calls to UIColumn.processDecodes().

> UIData accesses its grandchild components directly
> --------------------------------------------------
>
>          Key: MYFACES-781
>          URL: http://issues.apache.org/jira/browse/MYFACES-781
>      Project: MyFaces
>         Type: Bug
>   Components: Implementation
>     Reporter: Simon Kitching

>
> For an HTML table, much of the decoding process is controlled by the components rather than the renderer.
> In the class javax.faces.component.UIData, method "processColumnChildren" (which is called by processDecodes) does this:
>   for (Iterator it = getChildren().iterator(); it.hasNext();)
>   {
>       UIComponent child = (UIComponent) it.next();
>       if (child instanceof UIColumn)
>       {
>           if (!child.isRendered())
>           {
>               //Column is not visible
>               continue;
>           }
>           for (Iterator columnChildIter = child.getChildren()
>               .iterator(); columnChildIter.hasNext();)
>           {
>              UIComponent columnChild = (UIComponent) columnChildIter
>                   .next();
>              process(context, columnChild, processAction);
>           }
>       }
>   }
> And that last call to process them calls component.processDecodes, which delegates to the renderer as needed.
> However this code means UIData is accessing its *grandchildren* directly, rather than just its children. I don't believe this is very nice OO design; UIData's children should be responsible for managing their own children, ie the UIColumn class should be told to process the children rather than calling getChildren on it and manipulating those directly. 
> It also makes it impossible for a custom UIColumn class to receive decode calls; they go direct to the custom column's children.
> See this email thread for more info, esp. responses by Mike Kienenberger (thanks, Mike):
>   http://www.mail-archive.com/users%40myfaces.apache.org/msg11363.html

-- 
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-781) UIData accesses its grandchild components directly

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-781?page=comments#action_12356794 ] 

Mike Kienenberger commented on MYFACES-781:
-------------------------------------------

Oops!  I made the last comment right before going to sleep, and I didn't notice I was looking at the javadocs for UIComponentBase.html#processDecodes instead of UIData.html#processDecodes!

The javadocs for UIData clearly indicate that UIData is designed to spec.  Sorry for the misinformation.

Might as well close this one as "Won't Fix"


> UIData accesses its grandchild components directly
> --------------------------------------------------
>
>          Key: MYFACES-781
>          URL: http://issues.apache.org/jira/browse/MYFACES-781
>      Project: MyFaces
>         Type: Bug
>   Components: Implementation
>     Reporter: Simon Kitching

>
> For an HTML table, much of the decoding process is controlled by the components rather than the renderer.
> In the class javax.faces.component.UIData, method "processColumnChildren" (which is called by processDecodes) does this:
>   for (Iterator it = getChildren().iterator(); it.hasNext();)
>   {
>       UIComponent child = (UIComponent) it.next();
>       if (child instanceof UIColumn)
>       {
>           if (!child.isRendered())
>           {
>               //Column is not visible
>               continue;
>           }
>           for (Iterator columnChildIter = child.getChildren()
>               .iterator(); columnChildIter.hasNext();)
>           {
>              UIComponent columnChild = (UIComponent) columnChildIter
>                   .next();
>              process(context, columnChild, processAction);
>           }
>       }
>   }
> And that last call to process them calls component.processDecodes, which delegates to the renderer as needed.
> However this code means UIData is accessing its *grandchildren* directly, rather than just its children. I don't believe this is very nice OO design; UIData's children should be responsible for managing their own children, ie the UIColumn class should be told to process the children rather than calling getChildren on it and manipulating those directly. 
> It also makes it impossible for a custom UIColumn class to receive decode calls; they go direct to the custom column's children.
> See this email thread for more info, esp. responses by Mike Kienenberger (thanks, Mike):
>   http://www.mail-archive.com/users%40myfaces.apache.org/msg11363.html

-- 
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