Author: abelevich
Date: 2008-01-14 05:28:18 -0500 (Mon, 14 Jan 2008)
New Revision: 5340
Modified:
trunk/sandbox/samples/combobox-sample/src/main/java/org/richfaces/samples/Bean.java
trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp
Log:
new Demo
Modified:
trunk/sandbox/samples/combobox-sample/src/main/java/org/richfaces/samples/Bean.java
===================================================================
---
trunk/sandbox/samples/combobox-sample/src/main/java/org/richfaces/samples/Bean.java 2008-01-14
10:27:44 UTC (rev 5339)
+++
trunk/sandbox/samples/combobox-sample/src/main/java/org/richfaces/samples/Bean.java 2008-01-14
10:28:18 UTC (rev 5340)
@@ -37,8 +37,25 @@
String suggestions =
"Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Maryland,Massachusetts,Michigan,Georgia,Hawaii,Idaho,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Minnesota,Mississippi,Missouri,Montana,Nebraska";
List selectItems = new ArrayList();
+ private boolean disabled = false;
+ private boolean enableManualInput = false;
+ private boolean selectFirstOnUpdate = true;
+ private boolean filterNewValues = true;
+ private boolean directInputSuggestions = true;
+ private String defaultMessage = "default message ...";
+ private String width = "150px";
+ private String listWidth = "150px";
+ private String listHeight = "100px";
+ private String inputSize;
+ private String onchangeScript;
+ private String onlistcallScript;
+ private String onitemselectedScript;
+
+
private String state="";
-
+
+
+
public String getState() {
return state;
}
@@ -83,5 +100,109 @@
public void setSelectItems(List selectItems) {
this.selectItems = selectItems;
}
+
+ public boolean isDisabled() {
+ return disabled;
+ }
+
+ public void setDisabled(boolean disabled) {
+ this.disabled = disabled;
+ }
+
+ public boolean isEnableManualInput() {
+ return enableManualInput;
+ }
+
+ public void setEnableManualInput(boolean enableManualInput) {
+ this.enableManualInput = enableManualInput;
+ }
+
+ public boolean isSelectFirstOnUpdate() {
+ return selectFirstOnUpdate;
+ }
+
+ public void setSelectFirstOnUpdate(boolean selectFirstOnUpdate) {
+ this.selectFirstOnUpdate = selectFirstOnUpdate;
+ }
+
+ public boolean isFilterNewValues() {
+ return filterNewValues;
+ }
+
+ public void setFilterNewValues(boolean filterNewValues) {
+ this.filterNewValues = filterNewValues;
+ }
+
+ public boolean isDirectInputSuggestions() {
+ return directInputSuggestions;
+ }
+
+ public void setDirectInputSuggestions(boolean directInputSuggestions) {
+ this.directInputSuggestions = directInputSuggestions;
+ }
+
+ public String getDefaultMessage() {
+ return defaultMessage;
+ }
+
+ public void setDefaultMessage(String defaultMessage) {
+ this.defaultMessage = defaultMessage;
+ }
+
+ public String getWidth() {
+ return width;
+ }
+
+ public void setWidth(String width) {
+ this.width = width;
+ }
+
+ public String getListWidth() {
+ return listWidth;
+ }
+
+ public void setListWidth(String listWidth) {
+ this.listWidth = listWidth;
+ }
+
+ public String getListHeight() {
+ return listHeight;
+ }
+
+ public void setListHeight(String listHeight) {
+ this.listHeight = listHeight;
+ }
+
+ public String getInputSize() {
+ return inputSize;
+ }
+
+ public void setInputSize(String inputSize) {
+ this.inputSize = inputSize;
+ }
+
+ public String getOnchangeScript() {
+ return onchangeScript;
+ }
+
+ public void setOnchangeScript(String onchangeScript) {
+ this.onchangeScript = onchangeScript;
+ }
+
+ public String getOnlistcallScript() {
+ return onlistcallScript;
+ }
+
+ public void setOnlistcallScript(String onlistcallScript) {
+ this.onlistcallScript = onlistcallScript;
+ }
+
+ public String getOnitemselectedScript() {
+ return onitemselectedScript;
+ }
+
+ public void setOnitemselectedScript(String onitemselectedScript) {
+ this.onitemselectedScript = onitemselectedScript;
+ }
}
\ No newline at end of file
Modified: trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/faces-config.xml 2008-01-14
10:27:44 UTC (rev 5339)
+++
trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/faces-config.xml 2008-01-14
10:28:18 UTC (rev 5340)
@@ -3,8 +3,14 @@
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<managed-bean>
- <managed-bean-name>bean</managed-bean-name>
- <managed-bean-class>org.richfaces.samples.Bean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>org.richfaces.samples.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
</managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>skinBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.SkinBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+</managed-bean>
</faces-config>
Modified: trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/web.xml 2008-01-14
10:27:44 UTC (rev 5339)
+++ trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/web.xml 2008-01-14
10:28:18 UTC (rev 5340)
@@ -8,7 +8,7 @@
</context-param>
<context-param>
<param-name>org.ajax4jsf.SKIN</param-name>
- <param-value>blueSky</param-value>
+ <param-value>#{skinBean.skin}</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
Modified: trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp 2008-01-14
10:27:44 UTC (rev 5339)
+++ trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp 2008-01-14
10:28:18 UTC (rev 5340)
@@ -1,5 +1,6 @@
<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j" %>
<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/ui/combobox"
prefix="cmb"%>
<html>
<head>
@@ -7,8 +8,79 @@
</head>
<body>
<f:view>
+
<h:form>
- <cmb:comboBox value="#{bean.state}"
valueChangeListener="#{bean.selectionChanged}"
suggestionValues="#{bean.suggestions}" listWidth="150px">
+ <h:selectOneRadio binding="#{skinBean.component}" />
+ <h:commandLink action="#{skinBean.change}" value="set skin"
/>
+ <h:outputText value="Current skin: #{skinBean.skin}"/><br />
+ </h:form>
+
+ <h:form>
+ <h:panelGrid columns="2">
+ <h:outputText value="is disable (default: false):" />
+ <h:selectBooleanCheckbox value="#{bean.disabled}" />
+
+ <h:outputText value="enableManualInput (default: false):" />
+ <h:selectBooleanCheckbox value="#{bean.enableManualInput}" />
+
+ <h:outputText value="selectFirstOnUpdate (default: true):" />
+ <h:selectBooleanCheckbox value="#{bean.selectFirstOnUpdate}" />
+
+ <h:outputText value="filterNewValues (default: true):" />
+ <h:selectBooleanCheckbox value="#{bean.filterNewValues}" />
+
+ <h:outputText value="directInputSuggestions (default: true):" />
+ <h:selectBooleanCheckbox value="#{bean.directInputSuggestions}" />
+
+ <h:outputText value="defaultMessage is:" />
+ <h:inputText value="#{bean.defaultMessage}" />
+
+ <h:outputText value="width (in 'px'):" />
+ <h:inputText value="#{bean.width}" />
+
+ <h:outputText value="listWidth (in 'px'):" />
+ <h:inputText value="#{bean.listWidth}" />
+
+ <h:outputText value="listHeight (in 'px'):" />
+ <h:inputText value="#{bean.listHeight}" />
+
+ <h:outputText value="inputSize:" />
+ <h:inputText value="#{bean.inputSize}" />
+
+ <h:outputText value="onchange event script:" />
+ <h:inputText value="#{bean.onchangeScript}" />
+
+ <h:outputText value="onlistcall event script:" />
+ <h:inputText value="#{bean.onlistcallScript}" />
+
+ <h:outputText value="onitemselected event script:" />
+ <h:inputText value="#{bean.onitemselectedScript}" />
+
+ </h:panelGrid>
+
+
+ <cmb:comboBox
+ disabled="#{bean.disabled}"
+ inputClass="inputClass"
+ buttonDisabledClass="buttonDisabledClass"
+ buttonClass="buttonClass"
+ listClass="listClass"
+ value="#{bean.defaultMessage}"
+ valueChangeListener="#{bean.selectionChanged}"
+ suggestionValues="#{bean.suggestions}"
+ width = "#{bean.width}"
+ listWidth="#{bean.listWidth}"
+ listHeight="#{bean.listHeight}"
+ enableManualInput="#{bean.enableManualInput}"
+ selectFirstOnUpdate="#{bean.selectFirstOnUpdate}"
+ filterNewValues="#{bean.filterNewValues}"
+ directInputSuggestions="#{bean.directInputSuggestions}"
+ defaultMessage="#{bean.defaultMessage}"
+ inputSize="#{bean.inputSize}"
+ onchange="#{bean.onchangeScript}"
+ onlistcall="#{bean.onlistcallScript}"
+ onitemselected="#{bean.onitemselectedScript}">
+
<f:selectItems value="#{bean.selectItems}"/>
<f:selectItem itemValue="Oregon"/>
<f:selectItem itemValue="Pennsylvania"/>