Author: adubovsky
Date: 2008-07-17 07:44:52 -0400 (Thu, 17 Jul 2008)
New Revision: 9648
Modified:
trunk/test-applications/facelets/src/main/java/sb/Sb.java
trunk/test-applications/facelets/src/main/webapp/SuggestionBox/SuggestionBox.xhtml
trunk/test-applications/facelets/src/main/webapp/SuggestionBox/SuggestionBoxProperty.xhtml
Log:
changes in modalPanel
Modified: trunk/test-applications/facelets/src/main/java/sb/Sb.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/sb/Sb.java 2008-07-17 11:16:52 UTC (rev
9647)
+++ trunk/test-applications/facelets/src/main/java/sb/Sb.java 2008-07-17 11:44:52 UTC (rev
9648)
@@ -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;
@@ -37,7 +40,14 @@
private String value;
private String dir;
private int requestDelay;
- private HtmlSuggestionBox htmlSB = null;
+ 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",
@@ -58,14 +68,21 @@
private static final String[] citySEAsia = {"SouthEast Asia",
"Ashmore and Cartier Islands", "Brunei", "Burma",
"Cambodia", "Christmas Island", "Cocos (Keeling) Islands",
"East Timor", "Hong Kong", "Indonesia", "Laos",
"Malaysia", "Paracel Islands", "Philippines",
"Singapore", "Spratly Islands", "Taiwan",
"Thailand", "Vietnam"};
private static final String[] cityCaribbean = {"The Caribbean",
"Anguilla", "Antigua and Barbuda", "Aruba",
"Barbados", "British Virgin Islands", "Cayman Islands",
"Cuba", "Dominica", "Dominican Republic",
"Grenada", "Guadeloupe", "Haiti", "Jamaica",
"Martinique", "Montserrat", "Navassa Island",
"Netherlands Antilles", "Puerto Rico", "Saint Barthelemy",
"Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the
Grenadines", "The Bahamas", "Trinidad and Tobago", "Turks
and Caicos Islands", "Virgin Islands"};
-
+
+ public void addHtmlSuggestionBox(){
+ ComponentInfo info = ComponentInfo.getInstance();
+ info.addField(mySuggestionBox);
+ }
+
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";
@@ -73,7 +90,6 @@
shadowOpacity = "1";
shadowDepth = Integer.toString(SuggestionBoxRenderer.SHADOW_DEPTH);
zindex = 3;
- focus = true;
rows = "0";
first = 0;
cellspacing = "2";
@@ -81,9 +97,23 @@
minchars = "1";
frequency = 0;
rules = "none";
+ bindLabel = "Not checked";
+ bypassUpdates = true;
+ frame = "void";
+ nothingLabel = "Nothinf label works!";
+ usingSuggestObjects = true;
setCities(getAllData());
}
-
+
+ public void selectValue(ActionEvent actionEvent){
+ System.out.println("----inside selectValue(ActionEvent actionEvent)-----");
+ }
+
+ public void checkBinding(ActionEvent actionEvent) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ bindLabel = mySuggestionBox.getClientId(context) + "; param: " +
mySuggestionBox.getParam();
+ }
+
public List autocomplete(Object event) {
String pref = event.toString();
ArrayList result = new ArrayList();
@@ -100,12 +130,6 @@
return result;
}
- public String add(){
- ComponentInfo info = ComponentInfo.getInstance();
- info.addField(htmlSB);
- return null;
- }
-
public ArrayList getCities() {
return cities;
}
@@ -414,11 +438,67 @@
this.dir = dir;
}
- public HtmlSuggestionBox getHtmlSB() {
- return htmlSB;
+ public HtmlSuggestionBox getMySuggestionBox() {
+ return mySuggestionBox;
}
- public void setHtmlSB(HtmlSuggestionBox htmlSB) {
- this.htmlSB = htmlSB;
+ 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/facelets/src/main/webapp/SuggestionBox/SuggestionBox.xhtml
===================================================================
---
trunk/test-applications/facelets/src/main/webapp/SuggestionBox/SuggestionBox.xhtml 2008-07-17
11:16:52 UTC (rev 9647)
+++
trunk/test-applications/facelets/src/main/webapp/SuggestionBox/SuggestionBox.xhtml 2008-07-17
11:44:52 UTC (rev 9648)
@@ -1,21 +1,62 @@
<f:subview
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
id="suggestionBoxSubviewID">
- <h:messages showDetail="true" />
+<h:messages showDetail="true" />
<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"
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}"
- binding="#{sb.htmlSB}">
- <h:column>
+ <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}"
+ popupStyle="background-color: black;"
+ usingSuggestObjects="#{sb.usingSuggestObjects}"
+ reRender="label"
+ rendered="#{sb.rendered}"
+ requestDelay="#{sb.requestDelay}"
+ selfRendered="#{sb.selfRendered}"
+ 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"
+ style="#{style.style}"
+ styleClass="#{style.styleClass}"
+ selectedClass="#{style.selectedClass}"
+ rowClasses="#{style.rowClasses}" >
+
+ <h:column>
<h:outputText value="#{result.city}" />
</h:column>
<h:column>
@@ -25,7 +66,7 @@
<h:outputText value="#{result.flag}" />
</h:column>
<h:column>
- <h:outputLink
value="http://www.jboss.com/"><f:verbatim>Link</f:v...
+ <a4j:htmlCommandLink actionListener="#{sb.selectValue}"
value="Click me!"/>
</h:column>
</rich:suggestionbox>
<div style="position: relative; font-size: 50px; z-index: 2; color:
navy">z-index</div>
Modified:
trunk/test-applications/facelets/src/main/webapp/SuggestionBox/SuggestionBoxProperty.xhtml
===================================================================
---
trunk/test-applications/facelets/src/main/webapp/SuggestionBox/SuggestionBoxProperty.xhtml 2008-07-17
11:16:52 UTC (rev 9647)
+++
trunk/test-applications/facelets/src/main/webapp/SuggestionBox/SuggestionBoxProperty.xhtml 2008-07-17
11:44:52 UTC (rev 9648)
@@ -5,94 +5,134 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
id="suggestionboxPropertySubviewID">
- <h:commandButton action="#{sb.add}" value="add test" />
+
+ <h:commandButton value="add test"
action="#{sb.addHtmlSuggestionBox}"></h:commandButton>
<h:panelGrid columns="2" cellpadding="5px">
+ <h:outputText value="ajaxSingle"></h:outputText>
+ <h:selectBooleanCheckbox value="#{sb.ajaxSingle}"
onchange="submit();"></h:selectBooleanCheckbox>
- <h:outputText value="z-index"></h:outputText>
- <h:selectOneRadio value="#{sb.zindex}">
- <f:selectItem itemLabel="1" itemValue="1" />
- <f:selectItem itemLabel="3" itemValue="3" />
- <a4j:support event="onclick"
reRender="suggestionBoxId"></a4j:support>
- </h:selectOneRadio>
+ <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:outputText value="requestDelay"></h:outputText>
- <h:inputText value="#{sb.requestDelay}">
+ <h:commandButton id="bindingButtonID"
+ actionListener="#{sb.checkBinding}" value="binding and param"
/>
+ <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="value" />
- <h:inputText value="#{sb.value}">
+ <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="Frequency" />
- <h:inputText value="#{sb.frequency}">
+ <h:outputText value="cellspacing" />
+ <h:inputText value="#{sb.cellspacing}">
<a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
</h:inputText>
- <h:outputText value="Border" />
- <h:inputText value="#{sb.border}">
+ <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="Width" />
- <h:inputText value="#{sb.width}">
+ <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: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}">
+ <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="Cellspacing" />
- <h:inputText value="#{sb.cellspacing}">
+ <h:outputText value="nothingLabel" />
+ <h:inputText value="#{sb.nothingLabel}">
<a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
</h:inputText>
- <h:outputText value="First" />
- <h:inputText value="#{sb.first}">
+ <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" />
+ <f:selectItem itemLabel="3" itemValue="3" />
+ <a4j:support event="onclick"
reRender="suggestionBoxId"></a4j:support>
+ </h:selectOneRadio>
+
+ <h:outputText value="requestDelay"></h:outputText>
+ <h:inputText value="#{sb.requestDelay}">
<a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
</h:inputText>
- <h:outputText value="tokens:"></h:outputText>
- <h:inputText value="#{sb.tokens}"></h:inputText>
+ <h:outputText value="value" />
+ <h:inputText value="#{sb.value}">
+ <a4j:support event="onchange"
reRender="suggestionBoxId"></a4j:support>
+ </h:inputText>
- <f:verbatim>MinChars</f:verbatim>
- <h:inputText value="#{sb.minchars}">
+ <h:outputText value="Width" />
+ <h:inputText value="#{sb.width}">
<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="tokens:"></h:outputText>
+ <h:inputText value="#{sb.tokens}"></h:inputText>
-
- <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" />
@@ -116,9 +156,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>
@@ -128,11 +165,4 @@
</h:panelGrid>
<br />
<br />
- <div style="FONT-WEIGHT: bold;">rich:findComponent</div>
- <h:panelGrid columns="2">
- <a4j:commandLink value="getSubmitedValue"
reRender="findID"></a4j:commandLink>
-
- <h:outputText id="findID"
- value="#{rich:findComponent('suggestionBoxId').submitedValue}"
/>
- </h:panelGrid>
</f:subview>
\ No newline at end of file