You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Venkat Sadasivam (JIRA)" <de...@myfaces.apache.org> on 2008/07/21 06:29:31 UTC

[jira] Created: (MYFACES-1899) Why RequiredMessage is not supported in SelectMany components?

Why RequiredMessage is not supported in SelectMany components?
--------------------------------------------------------------

                 Key: MYFACES-1899
                 URL: https://issues.apache.org/jira/browse/MYFACES-1899
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-252
            Reporter: Venkat Sadasivam


All the select many components doesn't support attribute "requiredMessage". Example SelectManyCheckbox.

<h:selectManyCheckbox value="#{ElExpression}" required="true" requiredMessage="Value is required">

For the above component it always shows the myfaces default error message. I had a look into UISelectMany.java seems requiredMessage is not been taken care.

Please fix the issue, if you have any specific reason for not supporting requiredMessage, do let me know.

Thanks,
Venkat

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


[jira] Commented: (MYFACES-1899) Why RequiredMessage is not supported in SelectMany components?

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

Leonardo Uribe commented on MYFACES-1899:
-----------------------------------------


Checking the code it is clear the missing check for requiredMessage!=null on method validateValue of UISelectMany

The solution is do the same as UIInput:

        if (isRequired() && !hasValues)
        {
            if(getRequiredMessage() != null)
            {
                String requiredMessage = getRequiredMessage();
                context.addMessage(this.getClientId(context),new FacesMessage(FacesMessage.SEVERITY_ERROR,requiredMessage,requiredMessage));
            }
            else
            {
                _MessageUtils.addErrorMessage(context, this, REQUIRED_MESSAGE_ID, new Object[]{_MessageUtils.getLabel(context,this)});                
            }
            setValid(false);
            return;
        }


> Why RequiredMessage is not supported in SelectMany components?
> --------------------------------------------------------------
>
>                 Key: MYFACES-1899
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1899
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>            Reporter: Venkat Sadasivam
>
> All the select many components doesn't support attribute "requiredMessage". Example SelectManyCheckbox.
> <h:selectManyCheckbox value="#{ElExpression}" required="true" requiredMessage="Value is required">
> For the above component it always shows the myfaces default error message. I had a look into UISelectMany.java seems requiredMessage is not been taken care.
> Please fix the issue, if you have any specific reason for not supporting requiredMessage, do let me know.
> Thanks,
> Venkat

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