[
https://issues.apache.org/jira/browse/MYFACES-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12535867
]
Jan Ziegler commented on MYFACES-1745:
--------------------------------------
Ok, sounds good. So I have to wait until the pom´s updated. The latest version
of the maven-faces-plugin seems to be 1.2.3 (actually the myfaces pom is
refering to 1.2.1.1) - I guess the fix will be in 1.2.4 (snapshot) but this
plugin seems not to be availabe yet.
As I could see on the myfaces dev list they´re working on it to support the new
plugin during next week. So i´ll wait for this...(or maybe play around with the
access control thing ;) in the meantime).
> for-Attribute of UIMessage and HtmlOutputLabel does not work with an EL
> Expression
> ----------------------------------------------------------------------------------
>
> Key: MYFACES-1745
> URL: https://issues.apache.org/jira/browse/MYFACES-1745
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 1.2.1-SNAPSHOT
> Environment: Tomcat 6.0.15 (snapshot), Facelets 1.1.14
> Reporter: Jan Ziegler
> Assignee: Andrew Robinson
> Fix For: 1.2.1-SNAPSHOT
>
> Attachments: MyFaces-1745.patch
>
>
> When using an EL-Expression in the 'for'-Attribute of a UIMessage or
> HtmlOutputPanel, the EL is always resolved to null.
>
> Here is an Example:
> ...
> <h:form>
> <h:outputLabel for="#{testBean.test}" />
> <h:inputText id="#{testBean.test}" value="" required="true" />
> <h:message for="#{testBean.test}" />
> <h:commandButton value="click" />
> </h:form>
> ...
> You see that the 'for'-Attributes of the message and label as well as the
> 'id'-Attribute of the inputText refer to the same value which returns some
> valid string in my TestBean:
> ...
> public String getTest()
> {
> return "testID";
> }
> ...
> When rendering the page, a message will never be rendered (even no value is
> given but the field is required) and the label cannot be linked to the input
> field - there appears two error messages on the console:
> Attribute 'for' of label component with id j_id1:j_id2 is not defined
> Attribute 'for' of UIMessage must not be null
> which means the value of the EL-Expression resolves to null I think. In other
> cases, it is no problem to resolve the value, e.g. in an HtmlOutputText:
> <h:outputText value="#{testBean.test}" />
> Therefor I looked into the source code of UIMessage and HtmlOutputLabel. I
> think I found the bug. Look at the 'getFor()'-function of UIMessage (also in
> HtmlOutputLabel):
> public String getFor()
> {
> if (_for != null)
> {
> return _for;
> }
> ValueExpression expression = getValueExpression("forParam");
> if (expression != null)
> {
> return (String)expression.getValue(getFacesContext().getELContext());
> }
> return null;
> }
> I think 'forParam' is the wrong identifier for the ValueExpression ´cause in
> the Tag-classes, a value expression of the 'for'-Attribute is set via
> comp.setValueExpression("for", _for);
> A fix should be to use 'forParam' as an identifier in the Tag classes or
> 'for' as an identifier in the component-classes to use the same identifier
> for the value expression in all participants
> Am I right with that?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.