Author: ndkhoiits
Date: 2010-05-21 03:36:46 -0400 (Fri, 21 May 2010)
New Revision: 3165
Modified:
portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISampleUIForm.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/ext/UIFormComboBox.java
Log:
GTNPORTAL-1236 Persist value after re-render UIFormComboBox and bonus UIFormComboBox into
SampleUIForm
Modified:
portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISampleUIForm.java
===================================================================
---
portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISampleUIForm.java 2010-05-21
07:06:30 UTC (rev 3164)
+++
portal/trunk/testsuite/webuibasedsamples/src/main/java/org/exoplatform/sample/webui/component/UISampleUIForm.java 2010-05-21
07:36:46 UTC (rev 3165)
@@ -44,6 +44,7 @@
import org.exoplatform.webui.form.UIFormTextAreaInput;
import org.exoplatform.webui.form.UIFormInputWithActions.ActionData;
import org.exoplatform.webui.form.ext.UIFormColorPicker;
+import org.exoplatform.webui.form.ext.UIFormComboBox;
import org.exoplatform.webui.form.validator.MandatoryValidator;
/**
@@ -74,6 +75,8 @@
private static final String DATE_OF_BIRTH = "dateOfBirth";
private static final String DESCRIPTION = "description";
+
+ private static final String COMBOBOX = "ComboBox";
private List<String> userNames = new ArrayList<String>();
@@ -107,6 +110,12 @@
List<SelectItemOption<String>> selectItemOptions =
makeSelectItemOptions();
inputSet.addUIFormInput(new UIFormSelectBox(POSITION, null, selectItemOptions));
inputSet.addUIFormInput(new UIFormCheckBoxInput<String>(RECEIVE_EMAIL, null,
"test"));
+
+ List<SelectItemOption<String>> comboBoxItemOptions = new
ArrayList<SelectItemOption<String>>();
+ comboBoxItemOptions.add(new SelectItemOption<String>(("VI")));
+ comboBoxItemOptions.add(new SelectItemOption<String>(("UK")));
+ comboBoxItemOptions.add(new SelectItemOption<String>(("FR")));
+ inputSet.addUIFormInput(new UIFormComboBox(COMBOBOX, COMBOBOX,
comboBoxItemOptions));
}
private List<SelectItemOption<String>> makeRadioOptions()
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/ext/UIFormComboBox.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/ext/UIFormComboBox.java 2010-05-21
07:06:30 UTC (rev 3164)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/ext/UIFormComboBox.java 2010-05-21
07:36:46 UTC (rev 3165)
@@ -201,7 +201,13 @@
text += " />";
text +=
"<input class='UIComboboxInput' options=\"" + options
- + "\" onkeyup='eXo.webui.UICombobox.complete(this,event);'
type='text' " + renderJsActions() + " /></div>";
+ + "\" onkeyup='eXo.webui.UICombobox.complete(this,event);'
type='text' " + renderJsActions();
+ if(value_ != null && value_.trim().length() > 0)
+ {
+ text += "value='" + encodeValue(value_).toString() +
"'";
+ }
+
+ text += " /></div>";
w.write(text);
}
Show replies by date