You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Daniel Herb (JIRA)" <de...@myfaces.apache.org> on 2007/09/05 07:44:32 UTC

[jira] Created: (TOMAHAWK-1105) t:columns and findComponent

t:columns and findComponent
---------------------------

                 Key: TOMAHAWK-1105
                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1105
             Project: MyFaces Tomahawk
          Issue Type: Bug
    Affects Versions: 1.1.6
            Reporter: Daniel Herb


Hi,
i've written a phaseListener to replace the validation-errors with custom-errors. To do this I've used "viewRoot.findComponent" to get the right component for a clientId. It all worked fine till I've used it on a page with the t:columns-tag. After some debugging I found out the following:

Assume that the id which we are searching looks like this:
mainBody:mainForm:mainTable:0:columns:0_0:componentId

The findComponent-method is called recursive:
mainBody:mainForm:mainTable:0:columns:0_0:componentId
- Search for Id "mainBody" => found

mainForm:mainTable:0:columns:0_0:componentId
- Search for Id "mainForm" => found

mainTable:0:columns:0_0:componentId
- Search for Id "mainTable" => found
- The following "0" is the rowindex of the component so the findComponent-Method was overwritten by the HtmlDataTable to remove this also from the id and use it as index.
- Returned is an object from the type "UIComponentPerspective" which points at the correct row and delegate all methods to the child-component

columns:0_0:componentId
- Search for Id "columns" => found
- The following "0_0" is the row and column information which should be replaced by an overwritten version of findComponent from HtmlColumns but there is' no overwritten method.

0_0:componentId
- Search for Id "0_0" => not found!
- Because the columns-tag didn't removed the row and column information the next recursive call is to find an id "0_0" which can't exists.



I think the findComponent-Method of HtmlColumns should work like that one from dataTable and return an UIComponentPerspective-object

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


[jira] Commented: (TOMAHAWK-1105) t:columns and findComponent

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

Martin Marinschek commented on TOMAHAWK-1105:
---------------------------------------------

Hi Daniel,

this is not really a bug - the UIComponentPerspective is really only a "workaround" in JSF 1.1. E.g., with the RI, you'll never have this working. In JSF 1.2, you can use invokeOnComponent instead of findComponent, and everything will work just nicely.

regards,

Martin

> t:columns and findComponent
> ---------------------------
>
>                 Key: TOMAHAWK-1105
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1105
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>            Reporter: Daniel Herb
>
> Hi,
> i've written a phaseListener to replace the validation-errors with custom-errors. To do this I've used "viewRoot.findComponent" to get the right component for a clientId. It all worked fine till I've used it on a page with the t:columns-tag. After some debugging I found out the following:
> Assume that the id which we are searching looks like this:
> mainBody:mainForm:mainTable:0:columns:0_0:componentId
> The findComponent-method is called recursive:
> mainBody:mainForm:mainTable:0:columns:0_0:componentId
> - Search for Id "mainBody" => found
> mainForm:mainTable:0:columns:0_0:componentId
> - Search for Id "mainForm" => found
> mainTable:0:columns:0_0:componentId
> - Search for Id "mainTable" => found
> - The following "0" is the rowindex of the component so the findComponent-Method was overwritten by the HtmlDataTable to remove this also from the id and use it as index.
> - Returned is an object from the type "UIComponentPerspective" which points at the correct row and delegate all methods to the child-component
> columns:0_0:componentId
> - Search for Id "columns" => found
> - The following "0_0" is the row and column information which should be replaced by an overwritten version of findComponent from HtmlColumns but there is' no overwritten method.
> 0_0:componentId
> - Search for Id "0_0" => not found!
> - Because the columns-tag didn't removed the row and column information the next recursive call is to find an id "0_0" which can't exists.
> I think the findComponent-Method of HtmlColumns should work like that one from dataTable and return an UIComponentPerspective-object

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