Author: mvitenkov
Date: 2008-04-18 06:52:44 -0400 (Fri, 18 Apr 2008)
New Revision: 7927
Modified:
branches/3.1.x/test-applications/jsp/src/main/java/inputNumberSpinner/InputNumberSpinner.java
branches/3.1.x/test-applications/jsp/src/main/webapp/InputNumberSpinner/InputNumberSpinner.jsp
branches/3.1.x/test-applications/jsp/src/main/webapp/InputNumberSpinner/InputNumberSpinnerProperty.jsp
Log:
+binding
+accesKey
+converter
+tabindex
+valueChangeListener
Modified:
branches/3.1.x/test-applications/jsp/src/main/java/inputNumberSpinner/InputNumberSpinner.java
===================================================================
---
branches/3.1.x/test-applications/jsp/src/main/java/inputNumberSpinner/InputNumberSpinner.java 2008-04-18
10:51:19 UTC (rev 7926)
+++
branches/3.1.x/test-applications/jsp/src/main/java/inputNumberSpinner/InputNumberSpinner.java 2008-04-18
10:52:44 UTC (rev 7927)
@@ -1,5 +1,10 @@
package inputNumberSpinner;
+import org.richfaces.component.html.HtmlInputNumberSpinner;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.ValueChangeEvent;
+
public class InputNumberSpinner {
// private String size;
@@ -13,10 +18,13 @@
private String inputStyle;
private String style;
private String btnLabel = "ON";
+ private String bindLabel;
+ private String changeListenerLabel;
private boolean cycled;
private boolean disabled;
private boolean manualInput;
private boolean rendered;
+ private HtmlInputNumberSpinner mySpinner;
public InputNumberSpinner() {
// size= "200";
@@ -26,13 +34,14 @@
manualInput = true;
max = "100";
min = "10";
- // value="50";
+ //value="50";
// controlPosition="outside";
step = "1";
rendered = true;
style = null;
inputStyle = null;
-
+ mySpinner = new HtmlInputNumberSpinner();
+ changeListenerLabel = "";
}
public void doStyles() {
@@ -218,4 +227,41 @@
setTabindex("5");
setValue("101");
}
+
+ public String getBindLabel() {
+ return bindLabel;
+ }
+
+ public void setBindLabel(String bindLabel) {
+ this.bindLabel = bindLabel;
+ }
+
+ public HtmlInputNumberSpinner getMySpinner() {
+ return mySpinner;
+ }
+
+ public void setMySpinner(HtmlInputNumberSpinner mySpinner) {
+ this.mySpinner = mySpinner;
+ }
+
+ public void checkBinding(ActionEvent actionEvent){
+ FacesContext context = FacesContext.getCurrentInstance();
+ bindLabel = mySpinner.getClientId(context).toString();
+ }
+
+ public void valueChangeListener(ValueChangeEvent valueChangeEvent){
+ System.out.println("====valueChangeListener work well=====");
+ StringBuilder sb = new StringBuilder();
+ sb.append("inputNumberSpinner's value is ");
+ sb.append(mySpinner.getValue());
+ changeListenerLabel = sb.toString();
+ }
+
+ public String getChangeListenerLabel() {
+ return changeListenerLabel;
+ }
+
+ public void setChangeListenerLabel(String changeListenerLabel) {
+ this.changeListenerLabel = changeListenerLabel;
+ }
}
Modified:
branches/3.1.x/test-applications/jsp/src/main/webapp/InputNumberSpinner/InputNumberSpinner.jsp
===================================================================
---
branches/3.1.x/test-applications/jsp/src/main/webapp/InputNumberSpinner/InputNumberSpinner.jsp 2008-04-18
10:51:19 UTC (rev 7926)
+++
branches/3.1.x/test-applications/jsp/src/main/webapp/InputNumberSpinner/InputNumberSpinner.jsp 2008-04-18
10:52:44 UTC (rev 7927)
@@ -19,6 +19,7 @@
oninputkeyup="showEvent('onkeyupInputID', 'onkeyup work!')"
oninputmousemove="showEvent('onmousemoveInputID', 'onmousemove
work!')"
oninputmouseout="showEvent('onmouseoutInputID', 'onmouseout
work!')" oninputmouseover="showEvent('onmouseoverInputID',
'onmouseover work!')"
oninputmouseup="showEvent('onmouseupInputID', 'onmouseup
work!')" ondownclick="showEvent('ondownclickInputID',
'ondownclick work!')"
- onupclick="showEvent('onupclickInputID', 'onupclick
work!')"></rich:inputNumberSpinner>
+ onupclick="showEvent('onupclickInputID', 'onupclick
work!')"
+ accesskey="y" binding="#{inputNumberSpinner.mySpinner}"
valueChangeListener="#{inputNumberSpinner.valueChangeListener}"></rich:inputNumberSpinner>
<rich:spacer height="20px"></rich:spacer>
</f:subview>
Modified:
branches/3.1.x/test-applications/jsp/src/main/webapp/InputNumberSpinner/InputNumberSpinnerProperty.jsp
===================================================================
---
branches/3.1.x/test-applications/jsp/src/main/webapp/InputNumberSpinner/InputNumberSpinnerProperty.jsp 2008-04-18
10:51:19 UTC (rev 7926)
+++
branches/3.1.x/test-applications/jsp/src/main/webapp/InputNumberSpinner/InputNumberSpinnerProperty.jsp 2008-04-18
10:52:44 UTC (rev 7927)
@@ -4,51 +4,65 @@
<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="iNSpinnerPropertySubviewID">
- <h:panelGrid columns="2" cellpadding="10px"
border="1">
- <h:outputText value="Max: "></h:outputText>
- <h:inputText value="#{inputNumberSpinner.max}">
- <a4j:support reRender="SpinnerID"
event="onchange"></a4j:support>
- </h:inputText>
+ <h:panelGrid columns="2" cellpadding="10px"
border="1">
+ <h:outputText value="Max: "></h:outputText>
+ <h:inputText value="#{inputNumberSpinner.max}">
+ <a4j:support reRender="SpinnerID"
event="onchange"></a4j:support>
+ </h:inputText>
- <h:outputText value="Min: "></h:outputText>
- <h:inputText value="#{inputNumberSpinner.min}">
- <a4j:support reRender="SpinnerID"
event="onchange"></a4j:support>
- </h:inputText>
+ <h:outputText value="Min: "></h:outputText>
+ <h:inputText value="#{inputNumberSpinner.min}">
+ <a4j:support reRender="SpinnerID"
event="onchange"></a4j:support>
+ </h:inputText>
- <h:outputText value="Step: "></h:outputText>
- <h:inputText value="#{inputNumberSpinner.step}">
- <a4j:support reRender="SpinnerID"
event="onchange"></a4j:support>
- </h:inputText>
+ <h:outputText value="Step: "></h:outputText>
+ <h:inputText value="#{inputNumberSpinner.step}">
+ <a4j:support reRender="SpinnerID"
event="onchange"></a4j:support>
+ </h:inputText>
- <h:outputText value="Size: "></h:outputText>
- <h:inputText value="#{inputNumberSpinner.inputSize}">
- <a4j:support reRender="SpinnerID"
event="onchange"></a4j:support>
- </h:inputText>
+ <h:outputText value="Size: "></h:outputText>
+ <h:inputText value="#{inputNumberSpinner.inputSize}">
+ <a4j:support reRender="SpinnerID"
event="onchange"></a4j:support>
+ </h:inputText>
- <h:outputText value="Value: "></h:outputText>
- <h:inputText value="#{inputNumberSpinner.value}">
- <a4j:support reRender="SpinnerID"
event="onchange"></a4j:support>
- </h:inputText>
+ <h:outputText value="Value: "></h:outputText>
+ <h:inputText value="#{inputNumberSpinner.value}">
+ <a4j:support reRender="SpinnerID"
event="onchange"></a4j:support>
+ </h:inputText>
- <h:outputText value="Cycled:"></h:outputText>
- <h:selectBooleanCheckbox value="#{inputNumberSpinner.cycled}">
- <a4j:support event="onclick"
reRender="SpinnerID"></a4j:support>
- </h:selectBooleanCheckbox>
+ <h:outputText value="Cycled:"></h:outputText>
+ <h:selectBooleanCheckbox value="#{inputNumberSpinner.cycled}">
+ <a4j:support event="onclick"
reRender="SpinnerID"></a4j:support>
+ </h:selectBooleanCheckbox>
- <h:outputText value="Manual Input:"></h:outputText>
- <h:selectBooleanCheckbox value="#{inputNumberSpinner.manualInput}">
- <a4j:support event="onclick"
reRender="SpinnerID"></a4j:support>
- </h:selectBooleanCheckbox>
+ <h:outputText value="Manual Input:"></h:outputText>
+ <h:selectBooleanCheckbox value="#{inputNumberSpinner.manualInput}">
+ <a4j:support event="onclick"
reRender="SpinnerID"></a4j:support>
+ </h:selectBooleanCheckbox>
- <h:outputText value="Disabled:"></h:outputText>
- <h:selectBooleanCheckbox value="#{inputNumberSpinner.disabled}">
- <a4j:support event="onclick"
reRender="SpinnerID"></a4j:support>
- </h:selectBooleanCheckbox>
+ <h:outputText value="Disabled:"></h:outputText>
+ <h:selectBooleanCheckbox value="#{inputNumberSpinner.disabled}">
+ <a4j:support event="onclick"
reRender="SpinnerID"></a4j:support>
+ </h:selectBooleanCheckbox>
- <h:outputText value="Rendered:"></h:outputText>
- <h:selectBooleanCheckbox value="#{inputNumberSpinner.rendered}"
onclick="submit()">
- </h:selectBooleanCheckbox>
- <h:outputText value="Switch Styles:" />
- <h:commandButton action="#{inputNumberSpinner.doStyles}"
value="#{inputNumberSpinner.btnLabel}" />
- </h:panelGrid>
+ <h:outputText value="Rendered:"></h:outputText>
+ <h:selectBooleanCheckbox value="#{inputNumberSpinner.rendered}"
+ onclick="submit()">
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Switch Styles:" />
+ <h:commandButton action="#{inputNumberSpinner.doStyles}"
+ value="#{inputNumberSpinner.btnLabel}" />
+
+ <h:commandButton actionListener="#{inputNumberSpinner.checkBinding}"
+ value="Binding" />
+ <h:outputText value="#{inputNumberSpinner.bindLabel}" />
+
+ <h:outputText value="tabindex:" />
+ <h:inputText value="#{inputNumberSpinner.tabindex}" >
+ <a4j:support reRender="SpinnerID"
event="onchange"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="valueChangeListener" />
+ <h:outputText value="#{inputNumberSpinner.changeListenerLabel}" />
+ </h:panelGrid>
</f:subview>
\ No newline at end of file