You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2007/09/18 03:57:43 UTC

[jira] Created: (MYFACES-1729) label attribute does not resolve EL expresion (JSR 252 Issue 6 related)

label attribute does not resolve EL expresion (JSR 252 Issue 6 related)
-----------------------------------------------------------------------

                 Key: MYFACES-1729
                 URL: https://issues.apache.org/jira/browse/MYFACES-1729
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-252
    Affects Versions: 1.2.1-SNAPSHOT
         Environment: Tomcat 6, Windows XP
            Reporter: Leonardo Uribe


When validation is applied to the following page:

<%@ page session="false" contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

<html>
<f:view>
	<%@include file="inc/head.inc"%>
	<body>
    <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
    <h1>Myfaces Examples JSF 1.2 Additions</h1>	
        <h:messages id="messageList" styleClass="error"/>
        <h:form id="form1">
            <h:panelGrid columns="4">
                <h:outputLabel for="form1:number1"
                    value="#{example_messages['sample1_number']} 1 :" />
                <h:outputText value="#{validationController.number1ValidationLabel}" />
                <h:inputText label="#{example_messages['sample1_number']}" 
                id="number1" value="#{calcForm.number1}" maxlength="10"
                    size="25" required="true">
                    <f:validateLongRange minimum="1" maximum="10" />
                </h:inputText>
                <h:message id="number1Error" for="form1:number1" styleClass="error" />
            </h:panelGrid>
            <h:panelGrid columns="4">
                <h:outputLabel for="form1:number2"
                    value="#{example_messages['sample1_form']} 2 :" />
                <h:outputText value="#{validationController.number2ValidationLabel}" />

                <h:inputText label="#{example_messages['sample1_form']}" 
                    id="number2" value="#{calcForm.number2}" maxlength="10"
                    size="25" required="true">
                    <f:validateLongRange minimum="20" maximum="50" />
                </h:inputText>
                <h:message id="number2Error" for="form1:number2" styleClass="error" />
            </h:panelGrid>
            <h:panelGrid columns="2">
                <h:outputLabel for="form1:result"
                    value="#{example_messages['sample1_result']} :" />
                <h:outputText id="result" value="#{calcForm.result}" />
            </h:panelGrid>

            <h:panelGrid columns="4">
                <h:commandButton id="addButton"
                    value="#{example_messages['sample1_add']}" action="none">
                    <f:actionListener
                        type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
                </h:commandButton>
                <h:commandButton id="subtractButton"
                    value="#{example_messages['sample1_sub']}" action="none">
                    <f:actionListener
                        type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
                </h:commandButton>

                <h:commandLink id="href1" action="none">
                    <h:outputText value="#{example_messages['sample1_add_link']}" />
                    <f:actionListener
                        type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
                </h:commandLink>
                <h:commandLink id="href2" action="none">
                    <h:outputText value="#{example_messages['sample1_sub_link']}" />
                    <f:actionListener
                        type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
                </h:commandLink>
            </h:panelGrid>
        </h:form>
	</body>
</f:view>
</html>


If you use the attribute label on inputText like this:

                <h:inputText label="#{example_messages['sample1_number']}" 
                id="number1" value="#{calcForm.number1}" maxlength="10"
                    size="25" required="true">
                    <f:validateLongRange minimum="1" maximum="10" />
                </h:inputText>

and a validation error happens, the EL expression inside label attribute returns null. On a message box this looks like:

null: Validation Error: Specified attribute is not between the expected values of 20 and 50.

 On JSF RI 1.2 this works correctly. null is replaced by the expression inside the bundle.


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


[jira] Commented: (MYFACES-1729) label attribute does not resolve EL expresion (JSR 252 Issue 6 related)

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12531183 ] 

Leonardo Uribe commented on MYFACES-1729:
-----------------------------------------

Hi

Based on this course of action

1. Change the way the validation messages are resolved to make similar as JSF RI (on render response phase). 

I have found a possible solution without implement f:loadBundle with state (if we do that, several incompatibilities with facelets arise. I have probed this and discard this solution). 

The idea is evaluate the label on HtmlMessageRenderer and HtmlMessagesRenderer. So, the loadBundle is registered before and the label value is available.

The idea is first resolve the data on Validators and Converters for example from this:

{2}: Validation Error: Specified attribute is not between the expected values of {0} and {1}.

to this

{0}: Validation Error: Specified attribute is not between the expected values of 10 and 50.

Then, on HtmlMessageRenderer and HtmlMessagesRenderer we resolve the label and get this:

LABEL: Validation Error: Specified attribute is not between the expected values of 10 and 50.

This is possible because we have a clientId of the owner of the message.

For do this we have to change all _MessageUtils.getLabel call to a simple "{0}" and change the implementations of getSummary and getDetail of
the renderer.

I provide a patch from on practice this solution.

Sounds good to me but I'm open to any suggestion, critic or improvement.



> label attribute does not resolve EL expresion (JSR 252 Issue 6 related)
> -----------------------------------------------------------------------
>
>                 Key: MYFACES-1729
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1729
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions: 1.2.1-SNAPSHOT
>         Environment: Tomcat 6, Windows XP
>            Reporter: Leonardo Uribe
>         Attachments: patchLoadBundleWithoutImplementState.patch
>
>
> When validation is applied to the following page:
> <%@ page session="false" contentType="text/html;charset=utf-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <html>
> <f:view>
> 	<%@include file="inc/head.inc"%>
> 	<body>
>     <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
>     <h1>Myfaces Examples JSF 1.2 Additions</h1>	
>         <h:messages id="messageList" styleClass="error"/>
>         <h:form id="form1">
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number1"
>                     value="#{example_messages['sample1_number']} 1 :" />
>                 <h:outputText value="#{validationController.number1ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
>                 <h:message id="number1Error" for="form1:number1" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number2"
>                     value="#{example_messages['sample1_form']} 2 :" />
>                 <h:outputText value="#{validationController.number2ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_form']}" 
>                     id="number2" value="#{calcForm.number2}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="20" maximum="50" />
>                 </h:inputText>
>                 <h:message id="number2Error" for="form1:number2" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="2">
>                 <h:outputLabel for="form1:result"
>                     value="#{example_messages['sample1_result']} :" />
>                 <h:outputText id="result" value="#{calcForm.result}" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:commandButton id="addButton"
>                     value="#{example_messages['sample1_add']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandButton id="subtractButton"
>                     value="#{example_messages['sample1_sub']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandLink id="href1" action="none">
>                     <h:outputText value="#{example_messages['sample1_add_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>                 <h:commandLink id="href2" action="none">
>                     <h:outputText value="#{example_messages['sample1_sub_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>             </h:panelGrid>
>         </h:form>
> 	</body>
> </f:view>
> </html>
> If you use the attribute label on inputText like this:
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
> and a validation error happens, the EL expression inside label attribute returns null. On a message box this looks like:
> null: Validation Error: Specified attribute is not between the expected values of 20 and 50.
>  On JSF RI 1.2 this works correctly. null is replaced by the expression inside the bundle.

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


[jira] Commented: (MYFACES-1729) label attribute does not resolve EL expresion (JSR 252 Issue 6 related)

Posted by "Volker Weber (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529884 ] 

Volker Weber commented on MYFACES-1729:
---------------------------------------

The probelm is the request-scope of f:loadBundle.
The bundle is stored in request-scope and not availiable in case of validation error.

> label attribute does not resolve EL expresion (JSR 252 Issue 6 related)
> -----------------------------------------------------------------------
>
>                 Key: MYFACES-1729
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1729
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions: 1.2.1-SNAPSHOT
>         Environment: Tomcat 6, Windows XP
>            Reporter: Leonardo Uribe
>
> When validation is applied to the following page:
> <%@ page session="false" contentType="text/html;charset=utf-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <html>
> <f:view>
> 	<%@include file="inc/head.inc"%>
> 	<body>
>     <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
>     <h1>Myfaces Examples JSF 1.2 Additions</h1>	
>         <h:messages id="messageList" styleClass="error"/>
>         <h:form id="form1">
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number1"
>                     value="#{example_messages['sample1_number']} 1 :" />
>                 <h:outputText value="#{validationController.number1ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
>                 <h:message id="number1Error" for="form1:number1" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number2"
>                     value="#{example_messages['sample1_form']} 2 :" />
>                 <h:outputText value="#{validationController.number2ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_form']}" 
>                     id="number2" value="#{calcForm.number2}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="20" maximum="50" />
>                 </h:inputText>
>                 <h:message id="number2Error" for="form1:number2" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="2">
>                 <h:outputLabel for="form1:result"
>                     value="#{example_messages['sample1_result']} :" />
>                 <h:outputText id="result" value="#{calcForm.result}" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:commandButton id="addButton"
>                     value="#{example_messages['sample1_add']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandButton id="subtractButton"
>                     value="#{example_messages['sample1_sub']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandLink id="href1" action="none">
>                     <h:outputText value="#{example_messages['sample1_add_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>                 <h:commandLink id="href2" action="none">
>                     <h:outputText value="#{example_messages['sample1_sub_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>             </h:panelGrid>
>         </h:form>
> 	</body>
> </f:view>
> </html>
> If you use the attribute label on inputText like this:
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
> and a validation error happens, the EL expression inside label attribute returns null. On a message box this looks like:
> null: Validation Error: Specified attribute is not between the expected values of 20 and 50.
>  On JSF RI 1.2 this works correctly. null is replaced by the expression inside the bundle.

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


[jira] Updated: (MYFACES-1729) label attribute does not resolve EL expresion (JSR 252 Issue 6 related)

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe updated MYFACES-1729:
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.2.1-SNAPSHOT
         Assignee: Leonardo Uribe
           Status: Resolved  (was: Patch Available)

fixed at revision  600207

> label attribute does not resolve EL expresion (JSR 252 Issue 6 related)
> -----------------------------------------------------------------------
>
>                 Key: MYFACES-1729
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1729
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions: 1.2.1-SNAPSHOT
>         Environment: Tomcat 6, Windows XP
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 1.2.1-SNAPSHOT
>
>         Attachments: patchFinalSolution.patch
>
>
> When validation is applied to the following page:
> <%@ page session="false" contentType="text/html;charset=utf-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <html>
> <f:view>
> 	<%@include file="inc/head.inc"%>
> 	<body>
>     <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
>     <h1>Myfaces Examples JSF 1.2 Additions</h1>	
>         <h:messages id="messageList" styleClass="error"/>
>         <h:form id="form1">
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number1"
>                     value="#{example_messages['sample1_number']} 1 :" />
>                 <h:outputText value="#{validationController.number1ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
>                 <h:message id="number1Error" for="form1:number1" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number2"
>                     value="#{example_messages['sample1_form']} 2 :" />
>                 <h:outputText value="#{validationController.number2ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_form']}" 
>                     id="number2" value="#{calcForm.number2}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="20" maximum="50" />
>                 </h:inputText>
>                 <h:message id="number2Error" for="form1:number2" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="2">
>                 <h:outputLabel for="form1:result"
>                     value="#{example_messages['sample1_result']} :" />
>                 <h:outputText id="result" value="#{calcForm.result}" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:commandButton id="addButton"
>                     value="#{example_messages['sample1_add']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandButton id="subtractButton"
>                     value="#{example_messages['sample1_sub']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandLink id="href1" action="none">
>                     <h:outputText value="#{example_messages['sample1_add_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>                 <h:commandLink id="href2" action="none">
>                     <h:outputText value="#{example_messages['sample1_sub_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>             </h:panelGrid>
>         </h:form>
> 	</body>
> </f:view>
> </html>
> If you use the attribute label on inputText like this:
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
> and a validation error happens, the EL expression inside label attribute returns null. On a message box this looks like:
> null: Validation Error: Specified attribute is not between the expected values of 20 and 50.
>  On JSF RI 1.2 this works correctly. null is replaced by the expression inside the bundle.

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


[jira] Commented: (MYFACES-1729) label attribute does not resolve EL expresion (JSR 252 Issue 6 related)

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533027 ] 

Leonardo Uribe commented on MYFACES-1729:
-----------------------------------------


Again, thinking more carefully the previous solution let me a bitter flavor. I don't like change the detail and summary implementation
on HtmlMessage(s)Renderer, because it's a source of incompatibilities. It should be better to create a class that extends from FacesMessage called _LabeledFacesMessage, that evaluate the ELExpression of label only when the method getDetail and getSummary is called. 

Again, I provide this patch, and finally I feel that this is a correct solution for this issue.



> label attribute does not resolve EL expresion (JSR 252 Issue 6 related)
> -----------------------------------------------------------------------
>
>                 Key: MYFACES-1729
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1729
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions: 1.2.1-SNAPSHOT
>         Environment: Tomcat 6, Windows XP
>            Reporter: Leonardo Uribe
>         Attachments: patchLoadBundleWithEL.patch, patchLoadBundleWithoutImplementState.patch
>
>
> When validation is applied to the following page:
> <%@ page session="false" contentType="text/html;charset=utf-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <html>
> <f:view>
> 	<%@include file="inc/head.inc"%>
> 	<body>
>     <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
>     <h1>Myfaces Examples JSF 1.2 Additions</h1>	
>         <h:messages id="messageList" styleClass="error"/>
>         <h:form id="form1">
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number1"
>                     value="#{example_messages['sample1_number']} 1 :" />
>                 <h:outputText value="#{validationController.number1ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
>                 <h:message id="number1Error" for="form1:number1" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number2"
>                     value="#{example_messages['sample1_form']} 2 :" />
>                 <h:outputText value="#{validationController.number2ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_form']}" 
>                     id="number2" value="#{calcForm.number2}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="20" maximum="50" />
>                 </h:inputText>
>                 <h:message id="number2Error" for="form1:number2" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="2">
>                 <h:outputLabel for="form1:result"
>                     value="#{example_messages['sample1_result']} :" />
>                 <h:outputText id="result" value="#{calcForm.result}" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:commandButton id="addButton"
>                     value="#{example_messages['sample1_add']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandButton id="subtractButton"
>                     value="#{example_messages['sample1_sub']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandLink id="href1" action="none">
>                     <h:outputText value="#{example_messages['sample1_add_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>                 <h:commandLink id="href2" action="none">
>                     <h:outputText value="#{example_messages['sample1_sub_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>             </h:panelGrid>
>         </h:form>
> 	</body>
> </f:view>
> </html>
> If you use the attribute label on inputText like this:
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
> and a validation error happens, the EL expression inside label attribute returns null. On a message box this looks like:
> null: Validation Error: Specified attribute is not between the expected values of 20 and 50.
>  On JSF RI 1.2 this works correctly. null is replaced by the expression inside the bundle.

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


[jira] Commented: (MYFACES-1729) label attribute does not resolve EL expresion (JSR 252 Issue 6 related)

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530836 ] 

Leonardo Uribe commented on MYFACES-1729:
-----------------------------------------

Hi

A possible first solution should follow this two objectives:

1. Save the state of f:loadBundle on the component tree
2. Restore the state before the validation phase to make the bundle available.

I have made a simple probe. 

1. Suppose that you save the state of f:loadBundle, adding a class that extends from UIComponentBase called
UILoadBundle, and overriding the class LoadBundleTag, extends from UIComponentELTagBase. In simple words, make f:loadBundle a
UIComponent and not just a tag. 

2. Then I wrote a Phase Listener that after RestoreView phase check for UILoadBundle components and restore the state adding the bundle to the RequestMap, using a algorithm that inspect all the tree.

3. Then make a project testing how this works.

The solution works, but I have a bad feeling making f:loadBundle an UIComponent, because it's added to the component tree.

Looking more deep, comparing JSF RI and Myfaces I have found the following conclusion:

1. f:loadBundle works very similar in both jsf implementations (It's just a tag without state). So what's change? the WAY the messages that are
EVALUATED and RENDERED. In JSF RI, the messages are resolved on the render response phase (so the f:loadBundle does not need state to be saved) , but in Myfaces this is done in the process validation phase. 

Two possible courses of action:

1. Change the way the validation messages are resolved to make similar as JSF RI (on render response phase).

2. Implement f:loadBundle with state, creating it as UIComponent, and adding a PhaseListenerLoadBundle to restore it's particular state. 

I don't know how to do

Any suggestions? Suggestions and Expert opinions are welcome.




> label attribute does not resolve EL expresion (JSR 252 Issue 6 related)
> -----------------------------------------------------------------------
>
>                 Key: MYFACES-1729
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1729
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions: 1.2.1-SNAPSHOT
>         Environment: Tomcat 6, Windows XP
>            Reporter: Leonardo Uribe
>
> When validation is applied to the following page:
> <%@ page session="false" contentType="text/html;charset=utf-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <html>
> <f:view>
> 	<%@include file="inc/head.inc"%>
> 	<body>
>     <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
>     <h1>Myfaces Examples JSF 1.2 Additions</h1>	
>         <h:messages id="messageList" styleClass="error"/>
>         <h:form id="form1">
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number1"
>                     value="#{example_messages['sample1_number']} 1 :" />
>                 <h:outputText value="#{validationController.number1ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
>                 <h:message id="number1Error" for="form1:number1" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number2"
>                     value="#{example_messages['sample1_form']} 2 :" />
>                 <h:outputText value="#{validationController.number2ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_form']}" 
>                     id="number2" value="#{calcForm.number2}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="20" maximum="50" />
>                 </h:inputText>
>                 <h:message id="number2Error" for="form1:number2" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="2">
>                 <h:outputLabel for="form1:result"
>                     value="#{example_messages['sample1_result']} :" />
>                 <h:outputText id="result" value="#{calcForm.result}" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:commandButton id="addButton"
>                     value="#{example_messages['sample1_add']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandButton id="subtractButton"
>                     value="#{example_messages['sample1_sub']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandLink id="href1" action="none">
>                     <h:outputText value="#{example_messages['sample1_add_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>                 <h:commandLink id="href2" action="none">
>                     <h:outputText value="#{example_messages['sample1_sub_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>             </h:panelGrid>
>         </h:form>
> 	</body>
> </f:view>
> </html>
> If you use the attribute label on inputText like this:
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
> and a validation error happens, the EL expression inside label attribute returns null. On a message box this looks like:
> null: Validation Error: Specified attribute is not between the expected values of 20 and 50.
>  On JSF RI 1.2 this works correctly. null is replaced by the expression inside the bundle.

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


[jira] Commented: (MYFACES-1729) label attribute does not resolve EL expresion (JSR 252 Issue 6 related)

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

Martin Marinschek commented on MYFACES-1729:
--------------------------------------------

Ok, I like your last solution best as well, but I wonder if there are any compatibility problems here. 

May I ask you to look at the RI as well? Why is it working there? I think they will have a different trick, can we check if the two tricks together will remain compatible?

regards,

Martin

> label attribute does not resolve EL expresion (JSR 252 Issue 6 related)
> -----------------------------------------------------------------------
>
>                 Key: MYFACES-1729
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1729
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions: 1.2.1-SNAPSHOT
>         Environment: Tomcat 6, Windows XP
>            Reporter: Leonardo Uribe
>         Attachments: patchFinalSolution.patch
>
>
> When validation is applied to the following page:
> <%@ page session="false" contentType="text/html;charset=utf-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <html>
> <f:view>
> 	<%@include file="inc/head.inc"%>
> 	<body>
>     <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
>     <h1>Myfaces Examples JSF 1.2 Additions</h1>	
>         <h:messages id="messageList" styleClass="error"/>
>         <h:form id="form1">
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number1"
>                     value="#{example_messages['sample1_number']} 1 :" />
>                 <h:outputText value="#{validationController.number1ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
>                 <h:message id="number1Error" for="form1:number1" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number2"
>                     value="#{example_messages['sample1_form']} 2 :" />
>                 <h:outputText value="#{validationController.number2ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_form']}" 
>                     id="number2" value="#{calcForm.number2}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="20" maximum="50" />
>                 </h:inputText>
>                 <h:message id="number2Error" for="form1:number2" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="2">
>                 <h:outputLabel for="form1:result"
>                     value="#{example_messages['sample1_result']} :" />
>                 <h:outputText id="result" value="#{calcForm.result}" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:commandButton id="addButton"
>                     value="#{example_messages['sample1_add']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandButton id="subtractButton"
>                     value="#{example_messages['sample1_sub']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandLink id="href1" action="none">
>                     <h:outputText value="#{example_messages['sample1_add_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>                 <h:commandLink id="href2" action="none">
>                     <h:outputText value="#{example_messages['sample1_sub_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>             </h:panelGrid>
>         </h:form>
> 	</body>
> </f:view>
> </html>
> If you use the attribute label on inputText like this:
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
> and a validation error happens, the EL expression inside label attribute returns null. On a message box this looks like:
> null: Validation Error: Specified attribute is not between the expected values of 20 and 50.
>  On JSF RI 1.2 this works correctly. null is replaced by the expression inside the bundle.

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


[jira] Commented: (MYFACES-1729) label attribute does not resolve EL expresion (JSR 252 Issue 6 related)

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539295 ] 

Leonardo Uribe commented on MYFACES-1729:
-----------------------------------------


Fortunately there was a discussion about this on javaserverfaces dev list that mention this trick the last week that helps me to
understand what are they doing.

I have looked at the RI, and they have this trick on MessageFactory:

     static Object getLabel(FacesContext context, 
                                        UIComponent component) {
                                        
        Object o = component.getAttributes().get("label");
        if (o == null || (o instanceof String && ((String) o).length() == 0)) {
            o = component.getValueExpression("label");
        }
        // Use the "clientId" if there was no label specified.
        if (o == null) {
            o = component.getClientId(context);
        }
        return o;
    }

As I supposed by deduction creating my solution, they return the ValueExpression 
of label for later evaluation. But In my solution I get the expression string instead the ValueExpression Object.

At creating a message:

      static FacesMessage getMessage(Locale locale, 
                                                 String messageId, 
                                                 Object... params) {       

        /*..........  */
        // At this point, we have a summary and a bundle.     
        FacesMessage ret = new BindingFacesMessage(locale, summary, detail, params);
        /*..........  */

       }

So, they have a custom FacesMessage that resolve bindings on demand. The implementation of getDetail shows this:

        public String getDetail() {
            String pattern = super.getDetail();
            resolveBindings();
            return getFormattedString(pattern, resolvedParameters);
        }

My solution evaluate all the detail and summary String in one step, trying to minimize the changes, 
they save the array of params, the message string and resolve them later.

It's a different solution to the same problem, but I think it's compatible with my solution. 


> label attribute does not resolve EL expresion (JSR 252 Issue 6 related)
> -----------------------------------------------------------------------
>
>                 Key: MYFACES-1729
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1729
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions: 1.2.1-SNAPSHOT
>         Environment: Tomcat 6, Windows XP
>            Reporter: Leonardo Uribe
>         Attachments: patchFinalSolution.patch
>
>
> When validation is applied to the following page:
> <%@ page session="false" contentType="text/html;charset=utf-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <html>
> <f:view>
> 	<%@include file="inc/head.inc"%>
> 	<body>
>     <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
>     <h1>Myfaces Examples JSF 1.2 Additions</h1>	
>         <h:messages id="messageList" styleClass="error"/>
>         <h:form id="form1">
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number1"
>                     value="#{example_messages['sample1_number']} 1 :" />
>                 <h:outputText value="#{validationController.number1ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
>                 <h:message id="number1Error" for="form1:number1" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number2"
>                     value="#{example_messages['sample1_form']} 2 :" />
>                 <h:outputText value="#{validationController.number2ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_form']}" 
>                     id="number2" value="#{calcForm.number2}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="20" maximum="50" />
>                 </h:inputText>
>                 <h:message id="number2Error" for="form1:number2" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="2">
>                 <h:outputLabel for="form1:result"
>                     value="#{example_messages['sample1_result']} :" />
>                 <h:outputText id="result" value="#{calcForm.result}" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:commandButton id="addButton"
>                     value="#{example_messages['sample1_add']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandButton id="subtractButton"
>                     value="#{example_messages['sample1_sub']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandLink id="href1" action="none">
>                     <h:outputText value="#{example_messages['sample1_add_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>                 <h:commandLink id="href2" action="none">
>                     <h:outputText value="#{example_messages['sample1_sub_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>             </h:panelGrid>
>         </h:form>
> 	</body>
> </f:view>
> </html>
> If you use the attribute label on inputText like this:
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
> and a validation error happens, the EL expression inside label attribute returns null. On a message box this looks like:
> null: Validation Error: Specified attribute is not between the expected values of 20 and 50.
>  On JSF RI 1.2 this works correctly. null is replaced by the expression inside the bundle.

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


[jira] Commented: (MYFACES-1729) label attribute does not resolve EL expresion (JSR 252 Issue 6 related)

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528511 ] 

Leonardo Uribe commented on MYFACES-1729:
-----------------------------------------

I have made a simple probe

Insteado doing this:

                <h:inputText label="#{example_messages['sample1_number']}"
                id="number1" value="#{calcForm.number1}" maxlength="10"
                    size="25" required="true">
                    <f:validateLongRange minimum="1" maximum="10" />
                </h:inputText>

I do this

                <h:inputText label="#{calcForm.customMessage}"
                id="number1" value="#{calcForm.number1}" maxlength="10"
                    size="25" required="true">
                    <f:validateLongRange minimum="1" maximum="10" />
                </h:inputText>

The EL is resolved and  the String returned appears when a validation error occur. 

The problem should be on f:loadBundle, because the var is not added to the ELContext, or the ResourceBundle is not resolved
as the spec says. I will try this and see what happens







> label attribute does not resolve EL expresion (JSR 252 Issue 6 related)
> -----------------------------------------------------------------------
>
>                 Key: MYFACES-1729
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1729
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions: 1.2.1-SNAPSHOT
>         Environment: Tomcat 6, Windows XP
>            Reporter: Leonardo Uribe
>
> When validation is applied to the following page:
> <%@ page session="false" contentType="text/html;charset=utf-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <html>
> <f:view>
> 	<%@include file="inc/head.inc"%>
> 	<body>
>     <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
>     <h1>Myfaces Examples JSF 1.2 Additions</h1>	
>         <h:messages id="messageList" styleClass="error"/>
>         <h:form id="form1">
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number1"
>                     value="#{example_messages['sample1_number']} 1 :" />
>                 <h:outputText value="#{validationController.number1ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
>                 <h:message id="number1Error" for="form1:number1" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number2"
>                     value="#{example_messages['sample1_form']} 2 :" />
>                 <h:outputText value="#{validationController.number2ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_form']}" 
>                     id="number2" value="#{calcForm.number2}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="20" maximum="50" />
>                 </h:inputText>
>                 <h:message id="number2Error" for="form1:number2" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="2">
>                 <h:outputLabel for="form1:result"
>                     value="#{example_messages['sample1_result']} :" />
>                 <h:outputText id="result" value="#{calcForm.result}" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:commandButton id="addButton"
>                     value="#{example_messages['sample1_add']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandButton id="subtractButton"
>                     value="#{example_messages['sample1_sub']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandLink id="href1" action="none">
>                     <h:outputText value="#{example_messages['sample1_add_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>                 <h:commandLink id="href2" action="none">
>                     <h:outputText value="#{example_messages['sample1_sub_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>             </h:panelGrid>
>         </h:form>
> 	</body>
> </f:view>
> </html>
> If you use the attribute label on inputText like this:
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
> and a validation error happens, the EL expression inside label attribute returns null. On a message box this looks like:
> null: Validation Error: Specified attribute is not between the expected values of 20 and 50.
>  On JSF RI 1.2 this works correctly. null is replaced by the expression inside the bundle.

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


[jira] Updated: (MYFACES-1729) label attribute does not resolve EL expresion (JSR 252 Issue 6 related)

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe updated MYFACES-1729:
------------------------------------

    Status: Patch Available  (was: Open)

> label attribute does not resolve EL expresion (JSR 252 Issue 6 related)
> -----------------------------------------------------------------------
>
>                 Key: MYFACES-1729
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1729
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions: 1.2.1-SNAPSHOT
>         Environment: Tomcat 6, Windows XP
>            Reporter: Leonardo Uribe
>         Attachments: patchLoadBundleWithoutImplementState.patch
>
>
> When validation is applied to the following page:
> <%@ page session="false" contentType="text/html;charset=utf-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <html>
> <f:view>
> 	<%@include file="inc/head.inc"%>
> 	<body>
>     <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
>     <h1>Myfaces Examples JSF 1.2 Additions</h1>	
>         <h:messages id="messageList" styleClass="error"/>
>         <h:form id="form1">
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number1"
>                     value="#{example_messages['sample1_number']} 1 :" />
>                 <h:outputText value="#{validationController.number1ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
>                 <h:message id="number1Error" for="form1:number1" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number2"
>                     value="#{example_messages['sample1_form']} 2 :" />
>                 <h:outputText value="#{validationController.number2ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_form']}" 
>                     id="number2" value="#{calcForm.number2}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="20" maximum="50" />
>                 </h:inputText>
>                 <h:message id="number2Error" for="form1:number2" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="2">
>                 <h:outputLabel for="form1:result"
>                     value="#{example_messages['sample1_result']} :" />
>                 <h:outputText id="result" value="#{calcForm.result}" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:commandButton id="addButton"
>                     value="#{example_messages['sample1_add']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandButton id="subtractButton"
>                     value="#{example_messages['sample1_sub']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandLink id="href1" action="none">
>                     <h:outputText value="#{example_messages['sample1_add_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>                 <h:commandLink id="href2" action="none">
>                     <h:outputText value="#{example_messages['sample1_sub_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>             </h:panelGrid>
>         </h:form>
> 	</body>
> </f:view>
> </html>
> If you use the attribute label on inputText like this:
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
> and a validation error happens, the EL expression inside label attribute returns null. On a message box this looks like:
> null: Validation Error: Specified attribute is not between the expected values of 20 and 50.
>  On JSF RI 1.2 this works correctly. null is replaced by the expression inside the bundle.

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


[jira] Commented: (MYFACES-1729) label attribute does not resolve EL expresion (JSR 252 Issue 6 related)

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

Martin Marinschek commented on MYFACES-1729:
--------------------------------------------

Can you give us a patch?

regards,

Martin

> label attribute does not resolve EL expresion (JSR 252 Issue 6 related)
> -----------------------------------------------------------------------
>
>                 Key: MYFACES-1729
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1729
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions: 1.2.1-SNAPSHOT
>         Environment: Tomcat 6, Windows XP
>            Reporter: Leonardo Uribe
>
> When validation is applied to the following page:
> <%@ page session="false" contentType="text/html;charset=utf-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <html>
> <f:view>
> 	<%@include file="inc/head.inc"%>
> 	<body>
>     <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages" var="example_messages"/>
>     <h1>Myfaces Examples JSF 1.2 Additions</h1>	
>         <h:messages id="messageList" styleClass="error"/>
>         <h:form id="form1">
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number1"
>                     value="#{example_messages['sample1_number']} 1 :" />
>                 <h:outputText value="#{validationController.number1ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
>                 <h:message id="number1Error" for="form1:number1" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:outputLabel for="form1:number2"
>                     value="#{example_messages['sample1_form']} 2 :" />
>                 <h:outputText value="#{validationController.number2ValidationLabel}" />
>                 <h:inputText label="#{example_messages['sample1_form']}" 
>                     id="number2" value="#{calcForm.number2}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="20" maximum="50" />
>                 </h:inputText>
>                 <h:message id="number2Error" for="form1:number2" styleClass="error" />
>             </h:panelGrid>
>             <h:panelGrid columns="2">
>                 <h:outputLabel for="form1:result"
>                     value="#{example_messages['sample1_result']} :" />
>                 <h:outputText id="result" value="#{calcForm.result}" />
>             </h:panelGrid>
>             <h:panelGrid columns="4">
>                 <h:commandButton id="addButton"
>                     value="#{example_messages['sample1_add']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandButton id="subtractButton"
>                     value="#{example_messages['sample1_sub']}" action="none">
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandButton>
>                 <h:commandLink id="href1" action="none">
>                     <h:outputText value="#{example_messages['sample1_add_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>                 <h:commandLink id="href2" action="none">
>                     <h:outputText value="#{example_messages['sample1_sub_link']}" />
>                     <f:actionListener
>                         type="org.apache.myfaces.examples.example1.CalcActionListener"></f:actionListener>
>                 </h:commandLink>
>             </h:panelGrid>
>         </h:form>
> 	</body>
> </f:view>
> </html>
> If you use the attribute label on inputText like this:
>                 <h:inputText label="#{example_messages['sample1_number']}" 
>                 id="number1" value="#{calcForm.number1}" maxlength="10"
>                     size="25" required="true">
>                     <f:validateLongRange minimum="1" maximum="10" />
>                 </h:inputText>
> and a validation error happens, the EL expression inside label attribute returns null. On a message box this looks like:
> null: Validation Error: Specified attribute is not between the expected values of 20 and 50.
>  On JSF RI 1.2 this works correctly. null is replaced by the expression inside the bundle.

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