You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Thomas Andraschko (Jira)" <de...@myfaces.apache.org> on 2024/03/19 16:53:00 UTC

[jira] [Comment Edited] (MYFACES-4656) Component with overriden isRequired method does not evaluate plain string value

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

Thomas Andraschko edited comment on MYFACES-4656 at 3/19/24 4:52 PM:
---------------------------------------------------------------------

TBH i think your case is just invalid
the base setRequired uses the enum as key, your overwritten as string as key
this just cant match

if you add

{code:java}
    @Override
    public void setRequired(boolean required)
    {
        getStateHelper().put("required", required );
    }
{code}


its working fine


was (Author: tandraschko):
TBH i think your case is just invalid
the base setRequired uses the enum as key, your overwritten as string as key
this just cant match

if you add
```
    @Override
    public void setRequired(boolean required)
    {
        getStateHelper().put("required", required );
    }
```

its working fine

> Component with overriden isRequired method does not evaluate plain string value
> -------------------------------------------------------------------------------
>
>                 Key: MYFACES-4656
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4656
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 4.0.2
>            Reporter: chaloma1
>            Priority: Minor
>             Fix For: 5.0.0, 4.1.0-RC2, 4.0.3
>
>         Attachments: primefaces-test-git.zip
>
>
> Component with overriden isRequired() method using "required" instead PropertyKeys.required string as in UIInput parent class (you can add default value here if attribute is not found or set). Works with #\{true} or #\{xxxController.isComponentRequired} {*}but not with plain string like "true"{*}.
> See ThirdComponent in attached example. You can execute the sample with mvn jetty:run -Pmyfaces40 command and hit [http://localhost:8080/primefaces-test] to run the page.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)