[ 
http://issues.apache.org/jira/browse/MYFACES-1197?page=comments#action_12436379 
] 
            
Martin Marinschek commented on MYFACES-1197:
--------------------------------------------

Not quite - you wouldn't need to provide a var, cause the 
parentComponentClientId would always store the client-id of its immediate 
parent (optionally, one might supply a for-attribute for the then renamed 
component).

So it would look like this:

<h:form id="someForm">
  
  <t:storeParentComponentClientId/>

    <h:inputText id="name" required="true"/>
    <h:panelGroup rendered="#{myfacesContext.ifMessage['name']}">
        <!-- some markup to support the error message -->
        <h:message for="name"/>
    </h:panelGroup>
</h:form> 

and the internal implementation of ifMessage would look up the component by 
finding first the parent component (for which it has the client-id) and then 
finding the component with the id name on the parent.

regards,

Martin

> Docs for ifMessage component
> ----------------------------
>
>                 Key: MYFACES-1197
>                 URL: http://issues.apache.org/jira/browse/MYFACES-1197
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Mike Youngstrom
>         Assigned To: Martin Marinschek
>         Attachments: ifMessageDocs.patch
>
>
> Here is a patch with docs for the ifMessage component I donated.

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

        

Reply via email to