[ 
https://issues.apache.org/jira/browse/MYFACES-4059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15414343#comment-15414343
 ] 

Rapster edited comment on MYFACES-4059 at 8/10/16 6:53 AM:
-----------------------------------------------------------

No indeed "for" attribute in h:outputLabel does not have anything to do with 
"required" validation, but it's just a simple phrase to emphase the real 
problem. I'm quite surprised regarding what you just said. I debugged more 
deeply into the code, here is what I see:

1/ HtmlLabelRenderer line 165, once retrieved {{String forAttr = 
getFor(uiComponent);}}, you don't do much with it. Except of course encode the 
"for" attribute ;)

2/ Using Eclipse, I evaluate this expression 
{{((javax.faces.component.html.HtmlInputText)uiComponent.findComponent(forAttr)).isRequired()}}
 which returns false instead of true. In case you're wondering, the component 
returned by {{findComponent}} is of course a Calendar.

There is definitely something wrong. To recall, I'm using myfaces 2.2.10. 
Thanks for having a look again


was (Author: sebastien.lep...@ymail.com):
No indeed "for" attribute in h:outputLabel does not have anything to do with 
"required" validation, but it's just a simple phrase to emphase the real 
problem. I'm quite surprised regarding what you just said. I debugged more 
deeply into the code, here is what I see:

1/ HtmlLabelRenderer line 165, once retrieved {{String forAttr = 
getFor(uiComponent);}}, you don't do much with it. Except of course encode the 
"for" attribute ;)

2/ Using Eclipse, I evaluate this expression 
{{((javax.faces.component.html.HtmlInputText)uiComponent.findComponent(forAttr)).isRequired()}}
 which returns false instead of true.

There is definitely something wrong. To recall, I'm using myfaces 2.2.10. 
Thanks for having a look again

> ValueHolder not required while defined as such
> ----------------------------------------------
>
>                 Key: MYFACES-4059
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4059
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.2.10
>            Reporter: Rapster
>            Assignee: Leonardo Uribe
>
> In a very simple way, here is a composite:
> {code}
> <ui:component 
>     xmlns="http://www.w3.org/1999/xhtml";
>     xmlns:f="http://xmlns.jcp.org/jsf/core";
>     xmlns:h="http://xmlns.jcp.org/jsf/html";
>     xmlns:cc="http://xmlns.jcp.org/jsf/composite";
>     xmlns:ui="http://xmlns.jcp.org/jsf/facelets";
>     xmlns:c="http://xmlns.jcp.org/jsp/jstl/core";
>     xmlns:fn="http://xmlns.jcp.org/jsp/jstl/functions";
>     xmlns:p="http://primefaces.org/ui";
> >
>     <cc:interface>
>         <cc:attribute name="value" />
>         <cc:attribute name="required" />
>     </cc:interface>
>     <cc:implementation>
>         <p:calendar id="calendar" value="#{cc.attrs.value}" 
> required="#{cc.attrs.required}" showOn="button"/>  
>     </cc:implementation>
> </ui:component>
> {code}
> Here how I use it:
> {code}
> <h:outputLabel for="rat:calendar" value="Hello" />
> <my:calendar id="rat" required="true"/>
> {code}
> A required=true icon should be displayed but it does not. input.isRequired() 
> returns false while I explicitly set true.Looks like a JSF problem (I'm using 
> Mojarra 2.2.13 and reproduced on Myfaces 2.2.10 as well) (I used to use 
> outputLabel from Primefaces, but I reproduced the problem with native 
> outputLabel)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to