Author: gmaksimenko
Date: 2008-04-21 05:31:42 -0400 (Mon, 21 Apr 2008)
New Revision: 7975
Modified:
trunk/test-applications/jsp/src/main/java/combobox/Combobox.java
Log:
Add test for Binding
Modified: trunk/test-applications/jsp/src/main/java/combobox/Combobox.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/combobox/Combobox.java 2008-04-21 09:31:26
UTC (rev 7974)
+++ trunk/test-applications/jsp/src/main/java/combobox/Combobox.java 2008-04-21 09:31:42
UTC (rev 7975)
@@ -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;
@@ -32,7 +35,9 @@
public String listHeight;
public String listWidth;
public ArrayList<SelectItem> selectItem;
-
+ private HtmlComboBox myComboBox = null;
+ private String bindLabel;
+
public Combobox() {
this.disabled = false;
this.defaultLabel = "defaultLabel";
@@ -56,6 +61,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);
@@ -242,4 +248,25 @@
public void setListWidth(String listWidth) {
this.listWidth = listWidth;
}
+
+ 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);
+ }
}
Show replies by date