You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/08/02 16:00:24 UTC
svn commit: r681979 -
/myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/component/UISelectMany.java
Author: lu4242
Date: Sat Aug 2 07:00:23 2008
New Revision: 681979
URL: http://svn.apache.org/viewvc?rev=681979&view=rev
Log:
MYFACES-1899 RequiredMessage is not supported in SelectMany components
Modified:
myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/component/UISelectMany.java
Modified: myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/component/UISelectMany.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/component/UISelectMany.java?rev=681979&r1=681978&r2=681979&view=diff
==============================================================================
--- myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/component/UISelectMany.java (original)
+++ myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/component/UISelectMany.java Sat Aug 2 07:00:23 2008
@@ -312,7 +312,15 @@
// if UISelectMany is required, then there must be some selected values
if (isRequired() && !hasValues)
{
- _MessageUtils.addErrorMessage(context, this, REQUIRED_MESSAGE_ID, new Object[]{_MessageUtils.getLabel(context,this)});
+ 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;
}