Author: vmolotkov
Date: 2008-04-10 11:27:22 -0400 (Thu, 10 Apr 2008)
New Revision: 7738
Modified:
trunk/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
Log:
http://jira.jboss.com/jira/browse/RF-2045
Modified: trunk/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
===================================================================
---
trunk/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2008-04-10
15:27:18 UTC (rev 7737)
+++
trunk/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2008-04-10
15:27:22 UTC (rev 7738)
@@ -640,6 +640,20 @@
}
}
+ protected boolean isListEmpty(Object value) {
+ return super.isEmpty(value);
+ }
+
+ protected void validateValue(FacesContext context, Object value) {
+ Object[] values = (Object[]) value;
+ boolean[] requiredValues = {isSourceRequired(), isTargetRequired()};
+
+ for (int i = 0; i < values.length; i++) {
+ Object v = values[i];
+ validateListValue(context, v, isListEmpty(v), requiredValues[i]);
+ }
+ }
+
protected void resetDataModel() {
super.resetDataModel();
@@ -674,6 +688,12 @@
public abstract String getListClass();
public abstract void setListClass(String listClass);
+
+ public abstract boolean isSourceRequired();
+ public abstract void setSourceRequired(boolean sourceRequired);
+
+ public abstract boolean isTargetRequired();
+ public abstract void setTargetRequired(boolean targetRequired);
private void createValueHolder() {
if (valueHolder == null) {