Author: adubovsky
Date: 2008-06-23 09:33:44 -0400 (Mon, 23 Jun 2008)
New Revision: 9159
Modified:
trunk/test-applications/jsp/src/main/java/sb/Data.java
trunk/test-applications/jsp/src/main/java/sb/Sb.java
trunk/test-applications/jsp/src/main/java/util/event/Event.java
trunk/test-applications/jsp/src/main/webapp/SuggestionBox/SuggestionBox.jsp
trunk/test-applications/jsp/src/main/webapp/SuggestionBox/SuggestionBoxProperty.jsp
trunk/test-applications/jsp/src/main/webapp/pages/Action/EventInfo.jsp
trunk/test-applications/jsp/src/main/webapp/styles/styles.css
Log:
Modify and Add some attributes for suggestionBox
Modified: trunk/test-applications/jsp/src/main/java/sb/Data.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/sb/Data.java 2008-06-23 12:17:40 UTC (rev
9158)
+++ trunk/test-applications/jsp/src/main/java/sb/Data.java 2008-06-23 13:33:44 UTC (rev
9159)
@@ -4,6 +4,7 @@
private String city;
private String contry;
private boolean flag;
+ private String text;
public Data(String city, String contry, boolean flag) {
this.city = city;
@@ -36,10 +37,14 @@
}
public String getText() {
- return city + " (" + contry + ")";
+ return city + " - " + contry;
}
public String toString() {
return city + " (" + contry + ")";
}
+
+ public void setText(String text) {
+ this.text = text;
+ }
}
Modified: trunk/test-applications/jsp/src/main/java/sb/Sb.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/sb/Sb.java 2008-06-23 12:17:40 UTC (rev
9158)
+++ trunk/test-applications/jsp/src/main/java/sb/Sb.java 2008-06-23 13:33:44 UTC (rev
9159)
@@ -5,6 +5,9 @@
import java.util.Iterator;
import java.util.List;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
import org.richfaces.component.html.HtmlSuggestionBox;
import org.richfaces.renderkit.html.SuggestionBoxRenderer;
@@ -35,6 +38,14 @@
private String value;
private String dir;
private int requestDelay;
+ private HtmlSuggestionBox mySuggestionBox = null;
+ private String bindLabel;
+ private boolean bypassUpdates;
+ private String frame;
+ private boolean ignoreDupResponses;
+ private boolean immediate;
+ private String nothingLabel;
+ private boolean usingSuggestObjects;
/*
* private static final String[] cit = { "Abba", "Abbeville",
"Acworth",
@@ -57,12 +68,14 @@
public Sb() {
+ ignoreDupResponses = true;
+ immediate = true;
dir = "LTR";
ajaxSingle = false;
rendered = true;
selfRendered = false;
value = "a, ";
- requestDelay = 100;
+ requestDelay = 500;
tokens = "[ ,";
border = "1";
width = "200";
@@ -70,7 +83,6 @@
shadowOpacity = "1";
shadowDepth = Integer.toString(SuggestionBoxRenderer.SHADOW_DEPTH);
zindex = 3;
- focus = true;
rows = "0";
first = 0;
cellspacing = "2";
@@ -78,9 +90,19 @@
minchars = "1";
frequency = 0;
rules = "none";
+ bindLabel = "Not checked";
+ bypassUpdates = true;
+ frame = "void";
+ nothingLabel = "Nothinf label works!";
+ usingSuggestObjects = true;
setCities(getAllData());
}
+ public void checkBinding(ActionEvent actionEvent) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ bindLabel = mySuggestionBox.getClientId(context);
+ }
+
public List autocomplete(Object event) {
String pref = event.toString();
ArrayList result = new ArrayList();
@@ -404,4 +426,68 @@
public void setDir(String dir) {
this.dir = dir;
}
+
+ public HtmlSuggestionBox getMySuggestionBox() {
+ return mySuggestionBox;
+ }
+
+ public void setMySuggestionBox(HtmlSuggestionBox mySuggestionBox) {
+ this.mySuggestionBox = mySuggestionBox;
+ }
+
+ public String getBindLabel() {
+ return bindLabel;
+ }
+
+ public void setBindLabel(String bindLabel) {
+ this.bindLabel = bindLabel;
+ }
+
+ public boolean isBypassUpdates() {
+ return bypassUpdates;
+ }
+
+ public void setBypassUpdates(boolean bypassUpdates) {
+ this.bypassUpdates = bypassUpdates;
+ }
+
+ public String getFrame() {
+ return frame;
+ }
+
+ public void setFrame(String frame) {
+ this.frame = frame;
+ }
+
+ public boolean isIgnoreDupResponses() {
+ return ignoreDupResponses;
+ }
+
+ public void setIgnoreDupResponses(boolean ignoreDupResponses) {
+ this.ignoreDupResponses = ignoreDupResponses;
+ }
+
+ public boolean isImmediate() {
+ return immediate;
+ }
+
+ public void setImmediate(boolean immediate) {
+ this.immediate = immediate;
+ }
+
+ public String getNothingLabel() {
+ return nothingLabel;
+ }
+
+ public void setNothingLabel(String nothingLabel) {
+ this.nothingLabel = nothingLabel;
+ }
+
+ public boolean isUsingSuggestObjects() {
+ return usingSuggestObjects;
+ }
+
+ public void setUsingSuggestObjects(boolean usingSuggestObjects) {
+ this.usingSuggestObjects = usingSuggestObjects;
+ }
}
Modified: trunk/test-applications/jsp/src/main/java/util/event/Event.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/event/Event.java 2008-06-23 12:17:40
UTC (rev 9158)
+++ trunk/test-applications/jsp/src/main/java/util/event/Event.java 2008-06-23 13:33:44
UTC (rev 9159)
@@ -112,6 +112,7 @@
private String onbeforehide;
private String onbeforeshow;
private String opened;
+ private String onobjectchange;
public String getOpened() {
return opened;
@@ -123,6 +124,7 @@
// showEvent('onkeypressInputID', 'onkeypress work!')
public Event() {
+ onobjectchange = "showEvent('onobjectchangeInputID',
'onobjectchange work!')";
onLoadMap = "showEvent('onLoadMapInputID', 'onLoadMap
work!')";
opened = "showEvent('openedInputID', 'opened work!')";
onRowClick = "showEvent('onRowClickInputID', 'onRowClick
work!')";
@@ -1262,4 +1264,12 @@
this.onbeforeshow = onbeforeshow;
}
+ public String getOnobjectchange() {
+ return onobjectchange;
+ }
+
+ public void setOnobjectchange(String onobjectchange) {
+ this.onobjectchange = onobjectchange;
+ }
+
}
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/SuggestionBox/SuggestionBox.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/SuggestionBox/SuggestionBox.jsp 2008-06-23
12:17:40 UTC (rev 9158)
+++ trunk/test-applications/jsp/src/main/webapp/SuggestionBox/SuggestionBox.jsp 2008-06-23
13:33:44 UTC (rev 9159)
@@ -8,18 +8,63 @@
<f:verbatim>Suggestion Box will suggest you Town's names if it's started
with the "a" or "A" letter
<br />
</f:verbatim>
- <h:inputText value="#{sb.property}" id="text" />
- <rich:suggestionbox id="suggestionBoxId" frame="below"
param="param:#{result.text}" eventsQueue="myEventsQueue"
ajaxSingle="#{sb.ajaxSingle}" dir="#{sb.dir}"
- rendered="#{sb.rendered}" requestDelay="#{sb.requestDelay}"
selfRendered="#{sb.selfRendered}" value="#{sb.value}"
for="text"
- var="result" fetchValue="#{result.text}"
suggestionAction="#{sb.autocomplete}" width="#{sb.width}"
height="#{sb.height}"
- border="#{sb.border}" zindex="#{sb.zindex}"
rules="#{sb.rules}" cellpadding="#{sb.cellpadding}"
- cellspacing="#{sb.cellspacing}" first="#{sb.first}"
minChars="#{sb.minchars}" tokens="#{sb.tokens}"
bgcolor="#{sb.bgColor}"
- focus="#{sb.forcus}" title="#{result.text}"
summary="summary" shadowOpacity="#{sb.shadowOpacity}"
- shadowDepth="#{sb.shadowDepth}" selectValueClass="mousemove"
frequency="#{sb.frequency}" nothingLabel="nothingLabel work! "
- entryClass="#{style.entryClass}" popupClass="#{style.popupClass}"
popupStyle="#{style.popupStyle}" style="#{style.style}"
styleClass="#{style.styleClass}"
selectedClass="#{style.selectedClass}"
rowClasses="#{style.rowClasses}"
- oncomplete="#{event.oncomplete}" onselect="#{event.onselect}"
onbeforedomupdate="#{event.onbeforedomupdate}"
onsubmit="#{event.onsubmit}">
+ <h:inputText value="#{sb.property}" id="text">
+ <f:validateLength minimum="0" maximum="30"/>
+ </h:inputText>
+ <rich:suggestionbox id="suggestionBoxId"
+ ajaxSingle="#{sb.ajaxSingle}"
+ bgcolor="#{sb.bgColor}"
+ binding="#{sb.mySuggestionBox}"
+ bypassUpdates="#{sb.bypassUpdates}"
+ cellpadding="#{sb.cellpadding}"
+ cellspacing="#{sb.cellspacing}"
+ dir="#{sb.dir}"
+ entryClass="#{style.entryClass}"
+ eventsQueue="myEventsQueue"
+ fetchValue="#{result.text}"
+ first="#{sb.first}"
+ for="text"
+ frame="#{sb.frame}"
+ frequency="#{sb.frequency}"
+ height="#{sb.height}"
+ ignoreDupResponses="#{sb.ignoreDupResponses}"
+ immediate="#{sb.immediate}"
+ limitToList="false"
+ minChars="#{sb.minchars}"
+ nothingLabel="#{sb.nothingLabel}"
+ onbeforedomupdate="#{event.onbeforedomupdate}"
+ oncomplete="#{event.oncomplete}"
+ onobjectchange="#{event.onobjectchange}"
+ onselect="#{event.onselect}"
+ onsubmit="#{event.onsubmit}"
- <h:column>
+ usingSuggestObjects="true"
+ reRender="label"
+ param="param:#{result.text}"
+ rendered="#{sb.rendered}"
+ requestDelay="#{sb.requestDelay}"
+ selfRendered="#{sb.selfRendered}"
+ value="#{sb.value}"
+ var="result"
+ suggestionAction="#{sb.autocomplete}"
+ width="#{sb.width}"
+ border="#{sb.border}"
+ zindex="#{sb.zindex}"
+ rules="#{sb.rules}"
+ tokens="#{sb.tokens}"
+ title="#{result.text}"
+ summary="summary"
+ shadowOpacity="#{sb.shadowOpacity}"
+ shadowDepth="#{sb.shadowDepth}"
+ selectValueClass="mousemove"
+ popupClass="#{style.popupClass}"
+ popupStyle="#{style.popupStyle}"
+ style="#{style.style}"
+ styleClass="#{style.styleClass}"
+ selectedClass="#{style.selectedClass}"
+ rowClasses="#{style.rowClasses}" >
+
+ <h:column>
<h:outputText value="#{result.city}" />
</h:column>
<h:column>
@@ -32,5 +77,5 @@
<h:outputLink
value="http://www.jboss.com/"><f:verbatim>Link</f:v...
</h:column>
</rich:suggestionbox>
- <div style="position: relative; font-size: 50px; z-index: 2; color:
navy">z-index</div>
+ <div id="label" style="position: relative; font-size: 50px; z-index:
2; color: navy">z-index</div>
</f:subview>
Modified:
trunk/test-applications/jsp/src/main/webapp/SuggestionBox/SuggestionBoxProperty.jsp
===================================================================
---
trunk/test-applications/jsp/src/main/webapp/SuggestionBox/SuggestionBoxProperty.jsp 2008-06-23
12:17:40 UTC (rev 9158)
+++
trunk/test-applications/jsp/src/main/webapp/SuggestionBox/SuggestionBoxProperty.jsp 2008-06-23
13:33:44 UTC (rev 9159)
@@ -5,7 +5,102 @@
<f:subview id="suggestionboxPropertySubviewID">
<h:panelGrid columns="2" cellpadding="5px">
+ <h:outputText value="ajaxSingle"></h:outputText>
+ <h:selectBooleanCheckbox value="#{sb.ajaxSingle}"
onchange="submit();"></h:selectBooleanCheckbox>
+
+ <h:outputText value="bgcolor"></h:outputText>
+ <h:selectOneMenu value="#{sb.bgColor}">
+ <f:selectItem itemLabel="none" itemValue="none" />
+ <f:selectItem itemLabel="aqua" itemValue="aqua" />
+ <f:selectItem itemLabel="blue" itemValue="blue" />
+ <f:selectItem itemLabel="fuchsia" itemValue="fuchsia" />
+ <f:selectItem itemLabel="gray" itemValue="gray" />
+ <f:selectItem itemLabel="lime" itemValue="lime" />
+ <f:selectItem itemLabel="maroon" itemValue="maroon" />
+ <f:selectItem itemLabel="purple" itemValue="purple" />
+ <f:selectItem itemLabel="red" itemValue="red" />
+ <f:selectItem itemLabel="silver" itemValue="silver" />
+ <f:selectItem itemLabel="teal" itemValue="teal" />
+ <f:selectItem itemLabel="yellow" itemValue="yellow" />
+ <f:selectItem itemLabel="white" itemValue="white" />
+ <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
+ </h:selectOneMenu>
+
+ <h:commandButton id="bindingButtonID"
actionListener="#{sb.checkBinding}" value="binding" />
+ <h:outputText value="#{sb.bindLabel}" />
+
+ <h:outputText value="border"/>
+ <h:inputText value="#{sb.border}">
+ <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="bypassUpdates"></h:outputText>
+ <h:selectBooleanCheckbox value="#{sb.bypassUpdates}"
onchange="submit();"/>
+
+ <h:outputText value="cellpadding"/>
+ <h:inputText value="#{sb.cellpadding}">
+ <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
+ </h:inputText>
+ <h:outputText value="cellspacing"/>
+ <h:inputText value="#{sb.cellspacing}">
+ <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="dir"></h:outputText>
+ <h:selectOneMenu value="#{sb.dir}">
+ <f:selectItem itemLabel="RTL" itemValue="RTL" />
+ <f:selectItem itemLabel="LTR" itemValue="LTR" />
+ </h:selectOneMenu>
+
+ <h:outputText value="first" />
+ <h:inputText value="#{sb.first}">
+ <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="frame"></h:outputText>
+ <h:selectOneMenu value="#{sb.frame}">
+ <f:selectItem itemLabel="void" itemValue="void" />
+ <f:selectItem itemLabel="above" itemValue="above" />
+ <f:selectItem itemLabel="below" itemValue="below" />
+ <f:selectItem itemLabel="hsides" itemValue="hsides" />
+ <f:selectItem itemLabel="lhs" itemValue="lhs" />
+ <f:selectItem itemLabel="rhs" itemValue="rhs" />
+ <f:selectItem itemLabel="vsides" itemValue="vsides" />
+ <f:selectItem itemLabel="box" itemValue="box" />
+ <f:selectItem itemLabel="border " itemValue="border " />
+ <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
+ </h:selectOneMenu>
+
+ <h:outputText value="frequency"/>
+ <h:inputText value="#{sb.frequency}">
+ <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="height"/>
+ <h:inputText value="#{sb.height}">
+ <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="ignoreDupResponses"></h:outputText>
+ <h:selectBooleanCheckbox value="#{sb.ignoreDupResponses}"
onchange="submit();"></h:selectBooleanCheckbox>
+
+ <h:outputText value="immediate"></h:outputText>
+ <h:selectBooleanCheckbox value="#{sb.immediate}"
onchange="submit();"></h:selectBooleanCheckbox>
+
+ <h:outputText value="minChars"/>
+ <h:inputText value="#{sb.minchars}">
+ <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="nothingLabel"/>
+ <h:inputText value="#{sb.nothingLabel}">
+ <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="usingSuggestObjects"></h:outputText>
+ <h:selectBooleanCheckbox value="#{sb.usingSuggestObjects}"
onchange="submit();"></h:selectBooleanCheckbox>
+
<h:outputText value="z-index"></h:outputText>
<h:selectOneRadio value="#{sb.zindex}">
<f:selectItem itemLabel="1" itemValue="1" />
@@ -23,40 +118,10 @@
<a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
</h:inputText>
- <h:outputText value="Frequency"/>
- <h:inputText value="#{sb.frequency}">
- <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
- </h:inputText>
-
- <h:outputText value="Border"/>
- <h:inputText value="#{sb.border}">
- <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
- </h:inputText>
-
<h:outputText value="Width"/>
<h:inputText value="#{sb.width}">
<a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
</h:inputText>
-
- <h:outputText value="Height"/>
- <h:inputText value="#{sb.height}">
- <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
- </h:inputText>
-
- <h:outputText value="Cellpadding"/>
- <h:inputText value="#{sb.cellpadding}">
- <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
- </h:inputText>
-
- <h:outputText value="Cellspacing"/>
- <h:inputText value="#{sb.cellspacing}">
- <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
- </h:inputText>
-
- <h:outputText value="First" />
- <h:inputText value="#{sb.first}">
- <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
- </h:inputText>
<h:outputText value="tokens:"></h:outputText>
<h:inputText value="#{sb.tokens}"></h:inputText>
@@ -65,32 +130,7 @@
<h:inputText value="#{sb.minchars}">
<a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
</h:inputText>
-
- <h:outputText value="dir"></h:outputText>
- <h:selectOneMenu value="#{sb.dir}">
- <f:selectItem itemLabel="RTL" itemValue="RTL" />
- <f:selectItem itemLabel="LTR" itemValue="LTR" />
- </h:selectOneMenu>
-
- <h:outputText value="Background Colour"></h:outputText>
- <h:selectOneMenu value="#{sb.bgColor}">
- <f:selectItem itemLabel="none" itemValue="none" />
- <f:selectItem itemLabel="aqua" itemValue="aqua" />
- <f:selectItem itemLabel="blue" itemValue="blue" />
- <f:selectItem itemLabel="fuchsia" itemValue="fuchsia" />
- <f:selectItem itemLabel="gray" itemValue="gray" />
- <f:selectItem itemLabel="lime" itemValue="lime" />
- <f:selectItem itemLabel="maroon" itemValue="maroon" />
- <f:selectItem itemLabel="purple" itemValue="purple" />
- <f:selectItem itemLabel="red" itemValue="red" />
- <f:selectItem itemLabel="silver" itemValue="silver" />
- <f:selectItem itemLabel="teal" itemValue="teal" />
- <f:selectItem itemLabel="yellow" itemValue="yellow" />
- <f:selectItem itemLabel="white" itemValue="white" />
- <a4j:support event="onclick"
reRender="suggestionBoxId"></a4j:support>
- </h:selectOneMenu>
-
<h:outputText value="Shadow Opacity"></h:outputText>
<h:selectOneRadio value="#{sb.shadowOpacity}">
<f:selectItem itemLabel="1" itemValue="1" />
@@ -113,9 +153,6 @@
<f:selectItem itemLabel="7" itemValue="6" />
<a4j:support event="onclick"
reRender="suggestionBoxId"></a4j:support>
</h:selectOneRadio>
-
- <h:outputText value="ajaxSingle"></h:outputText>
- <h:selectBooleanCheckbox value="#{sb.ajaxSingle}"
onchange="submit();"></h:selectBooleanCheckbox>
<h:outputText value="selfRendered"></h:outputText>
<h:selectBooleanCheckbox value="#{sb.selfRendered}"
onchange="submit();"></h:selectBooleanCheckbox>
Modified: trunk/test-applications/jsp/src/main/webapp/pages/Action/EventInfo.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/pages/Action/EventInfo.jsp 2008-06-23
12:17:40 UTC (rev 9158)
+++ trunk/test-applications/jsp/src/main/webapp/pages/Action/EventInfo.jsp 2008-06-23
13:33:44 UTC (rev 9159)
@@ -108,4 +108,6 @@
<f:verbatim><div style="position: relative"><input
id="onbeforehideInputID" type="hidden" value="don't
work!" size="42" /></div></f:verbatim>
<f:verbatim><div style="position: relative"><input
id="onbeforeshowInputID" type="hidden" value="don't
work!" size="42" /></div></f:verbatim>
<f:verbatim><div style="position: relative"><input
id="openedInputID" type="hidden" value="don't work!"
size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input
id="onobjectchangeInputID" type="hidden" value="don't
work!" size="42" /></div></f:verbatim>
+
</f:subview>
Modified: trunk/test-applications/jsp/src/main/webapp/styles/styles.css
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/styles/styles.css 2008-06-23 12:17:40 UTC
(rev 9158)
+++ trunk/test-applications/jsp/src/main/webapp/styles/styles.css 2008-06-23 13:33:44 UTC
(rev 9159)
@@ -2,6 +2,13 @@
.dr-stglpanel-marker {
float: right;
}
+
+/* Suggestion Box */
+.entryClass {
+ color: red;
+ background: yellow;
+}
+
/* Message and messages */
.rich-message-label {
padding: 0px 10px;