Author: ndkhoiits
Date: 2010-05-20 04:30:19 -0400 (Thu, 20 May 2010)
New Revision: 3138
Modified:
portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISampleMultiValueInputSet.java
Log:
GTNPORTAL-1223 Set constructor for UIFormColorPicker and pass parameters into it
Modified:
portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISampleMultiValueInputSet.java
===================================================================
---
portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISampleMultiValueInputSet.java 2010-05-20
08:29:02 UTC (rev 3137)
+++
portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISampleMultiValueInputSet.java 2010-05-20
08:30:19 UTC (rev 3138)
@@ -21,6 +21,8 @@
import org.exoplatform.webui.form.UIFormTextAreaInput;
import org.exoplatform.webui.form.UIFormUploadInput;
import org.exoplatform.webui.form.ext.UIFormColorPicker;
+import org.exoplatform.webui.form.ext.UIFormColorPicker.Colors;
+import org.exoplatform.webui.form.ext.UIFormColorPicker.Colors.Color;
@ComponentConfig(lifecycle = UIFormLifecycle.class, template =
"system:/groovy/webui/form/UIFormWithTitle.gtmpl", events =
{@EventConfig(listeners = UISampleMultiValueInputSet.SubmitActionListener.class)})
public class UISampleMultiValueInputSet extends UIForm
@@ -40,14 +42,19 @@
public UISampleMultiValueInputSet() throws Exception
{
+ UIFormMultiValueInputSet uiFormMultiValueInputSet;
+
// UIFormUploadInput
- addUIFormInput(makeMultiValueInputSet(MULTI_UPLOAD, UIFormUploadInput.class));
-
+ addUIFormInput(makeMultiValueInputSet(MULTI_UPLOAD, UIFormUploadInput.class, new
Class[] {String.class, String.class, int.class}));
// UIFormDateTimeInput
addUIFormInput(makeMultiValueInputSet(MULTI_DATE, UIFormDateTimeInput.class));
// UIFormColorPicker
- addUIFormInput(makeMultiValueInputSet(MULTI_COLOR, UIFormColorPicker.class));
+ uiFormMultiValueInputSet = new UIFormMultiValueInputSet(MULTI_COLOR, MULTI_COLOR);
+ uiFormMultiValueInputSet.setType(UIFormColorPicker.class);
+ uiFormMultiValueInputSet.setConstructorParameterTypes(new Class[] {String.class,
String.class, String.class});
+ uiFormMultiValueInputSet.setConstructorParameterValues(new Object[]
{"ABC", "XYZ", null});
+ addUIFormInput(uiFormMultiValueInputSet);
// UIFormStringInput
addUIFormInput(makeMultiValueInputSet(MULTI_STRING, UIFormStringInput.class));
@@ -65,6 +72,23 @@
multiInput.setType(type);
return multiInput;
}
+
+ private UIFormInput makeMultiValueInputSetHasValue(String name, Class<? extends
UIFormInputBase> type, Object[] parameterValues) throws Exception
+ {
+ UIFormMultiValueInputSet multiInput = new UIFormMultiValueInputSet(name, null);
+ multiInput.setType(type);
+ multiInput.setConstructorParameterTypes(new Class[] {String.class, String.class,
String.class});
+ multiInput.setConstructorParameterValues(parameterValues);
+ return multiInput;
+ }
+
+ private UIFormInput makeMultiValueInputSet(String name, Class<? extends
UIFormInputBase> type, Class<?>... parameterTypes) throws Exception
+ {
+ UIFormMultiValueInputSet multiInput = new UIFormMultiValueInputSet(name, null);
+ multiInput.setType(type);
+ multiInput.setConstructorParameterTypes(parameterTypes);
+ return multiInput;
+ }
static public class SubmitActionListener extends
EventListener<UISampleMultiValueInputSet>
{
Show replies by date