You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org> on 2006/04/23 03:16:06 UTC

[jira] Commented: (MYFACES-1110) findComponent return null for a valid clientId

    [ http://issues.apache.org/jira/browse/MYFACES-1110?page=comments#action_12375838 ] 

Martin Marinschek commented on MYFACES-1110:
--------------------------------------------

Hi Dave,

my fix for this kind of things was in definitely after 1/15.

regards,

Martin

> findComponent return null for a valid clientId
> ----------------------------------------------
>
>          Key: MYFACES-1110
>          URL: http://issues.apache.org/jira/browse/MYFACES-1110
>      Project: MyFaces Core
>         Type: Bug

>   Components: General
>     Versions: 1.1.2-SNAPSHOT
>  Environment: JBoss 4.0.3, XP
>     Reporter: Dave
>     Assignee: Martin Marinschek
>     Priority: Critical

>
> In a PhaseListener, first get all the clientId(s) with queued messages, then try to find the components. But ViewRoot.findComponent(clientId) return null.
>  
> public void beforePhase(PhaseEvent event) {
>     FacesContext context = event.getFacesContext();
>     UIViewRoot root = context.getViewRoot();
>     Iterator<String> itr = context.getClientIdsWithMessages();
>     while (itr.hasNext()) {
>       String clientId = itr.next();
>       UIComponent component = root.findComponent(clientId);
>       // ERROR: component is null
>       ....
>     }
> }
> From debugger, clientId is 
> emp:empForm:empTable:1:salary:_idJsp144
> The clientId is returned from context.getClientIdsWithMessages();
> It must be valid, but root.findComponent() returns NULL.
> JSF should have the following API 
> FacesContext.getComponentsWithMessages();
> which is better than getClientIdsWithMessages();

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