Author: gmaksimenko
Date: 2008-04-21 05:33:30 -0400 (Mon, 21 Apr 2008)
New Revision: 7978
Modified:
trunk/test-applications/facelets/src/main/java/combobox/Combobox.java
Log:
Add test for Binding
Modified: trunk/test-applications/facelets/src/main/java/combobox/Combobox.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/combobox/Combobox.java 2008-04-21
09:32:07 UTC (rev 7977)
+++ trunk/test-applications/facelets/src/main/java/combobox/Combobox.java 2008-04-21
09:33:30 UTC (rev 7978)
@@ -3,6 +3,9 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
+import org.richfaces.component.html.HtmlComboBox;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
@@ -36,6 +39,8 @@
public String listHeight;
public String listWidth;
public ArrayList<SelectItem> selectItem;
+ private HtmlComboBox myComboBox = null;
+ private String bindLabel;
public Combobox() {
this.disabled = false;
@@ -60,6 +65,7 @@
this.listWidth = "350";
this.suggestionValues = new ArrayList<String>();
this.selectItem = new ArrayList<SelectItem>();
+ this.bindLabel = "Click Binding";
Random r = new Random();
for(int i = 0; i < 10; i++){
suggestionValues.add("suggestionValues " + r.nextInt(10) + " N=" +
i);
@@ -247,4 +253,25 @@
this.inputSize = inputSize;
}
+ public HtmlComboBox getMyComboBox() {
+ return myComboBox;
+ }
+
+ public void setMyComboBox(HtmlComboBox myComboBox) {
+ this.myComboBox = myComboBox;
+ }
+
+ public String getBindLabel() {
+ return bindLabel;
+ }
+
+ public void setBindLabel(String bindLabel) {
+ this.bindLabel = bindLabel;
+ }
+
+ public void checkBinding(ActionEvent actionEvent){
+ FacesContext context = FacesContext.getCurrentInstance();
+ bindLabel = myComboBox.getClientId(context);
+ }
+
}