JBoss Rich Faces SVN: r6538 - in trunk/samples/richfaces-demo/src/main/webapp/richfaces: comboBox and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-04 10:52:26 -0500 (Tue, 04 Mar 2008)
New Revision: 6538
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/examples/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/examples/collection.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/examples/simple.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/usage.xhtml
Log:
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/examples/collection.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/examples/collection.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/examples/collection.xhtml 2008-03-04 15:52:26 UTC (rev 6538)
@@ -0,0 +1,10 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <rich:comboBox value="#{comboBoxBean.value}" suggestionValues="#{capitalsBean.capitalsNames}"/>
+
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/examples/simple.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/examples/simple.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/examples/simple.xhtml 2008-03-04 15:52:26 UTC (rev 6538)
@@ -0,0 +1,13 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <rich:comboBox value="#{comboBoxBean.value}">
+ <f:selectItem itemValue="1"/>
+ </rich:comboBox>
+
+
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/usage.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/comboBox/usage.xhtml 2008-03-04 15:52:26 UTC (rev 6538)
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+ <p>
+ SHORT DESCRIPTION
+ </p>
+ <div class="sample-container" >
+ <ui:include src="/richfaces/comboBox/examples/simple.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/comboBox/examples/simple.xhtml"/>
+ </ui:include>
+ </div>
+ <p>
+ DESCRIPTION
+ </p>
+ <div class="sample-container" >
+ <ui:include src="/richfaces/comboBox/examples/collection.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/comboBox/examples/collection.xhtml"/>
+ </ui:include>
+ </div>
+ <p>
+ DESCRIPTION
+ </p>
+ </ui:define>
+
+ </ui:composition>
+</html>
16 years, 10 months
JBoss Rich Faces SVN: r6537 - in trunk/samples/richfaces-demo/src/main/webapp/richfaces: inplaceInput and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-04 10:52:14 -0500 (Tue, 04 Mar 2008)
New Revision: 6537
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/examples/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/examples/simple.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/selectItems.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/simple.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/usage.xhtml
Log:
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/examples/simple.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/examples/simple.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/examples/simple.xhtml 2008-03-04 15:52:14 UTC (rev 6537)
@@ -0,0 +1,8 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <rich:inplaceInput value="#{inplaceComponentsBean.inputValue}"/>
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/usage.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceInput/usage.xhtml 2008-03-04 15:52:14 UTC (rev 6537)
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+ <p>
+ SHORT DESCRIPTION
+ </p>
+ <div class="sample-container" >
+ <ui:include src="/richfaces/inplaceInput/examples/simple.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/inplaceInput/examples/simple.xhtml"/>
+ </ui:include>
+ </div>
+ <p>
+ DESCRIPTION
+ </p>
+ </ui:define>
+
+ </ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/selectItems.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/selectItems.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/selectItems.xhtml 2008-03-04 15:52:14 UTC (rev 6537)
@@ -0,0 +1,10 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <rich:inplaceSelect value="#{inplaceComponentsBean.inputValue}">
+ <f:selectItems value="#{capitalsBean.capitalsNamesOptions}"/>
+ </rich:inplaceSelect>
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/simple.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/simple.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/examples/simple.xhtml 2008-03-04 15:52:14 UTC (rev 6537)
@@ -0,0 +1,14 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <rich:inplaceSelect value="#{inplaceComponentsBean.inputValue}">
+ <f:selectItem itemValue="1" itemLabel="Option 1"/>
+ <f:selectItem itemValue="2" itemLabel="Option 2"/>
+ <f:selectItem itemValue="3" itemLabel="Option 3"/>
+ <f:selectItem itemValue="4" itemLabel="Option 4"/>
+ <f:selectItem itemValue="5" itemLabel="Option 5"/>
+ </rich:inplaceSelect>
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/usage.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/inplaceSelect/usage.xhtml 2008-03-04 15:52:14 UTC (rev 6537)
@@ -0,0 +1,32 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+ <p>
+ SHORT DESCRIPTION
+ </p>
+ <div class="sample-container" >
+ <ui:include src="/richfaces/inplaceSelect/examples/simple.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/inplaceSelect/examples/simple.xhtml"/>
+ </ui:include>
+ </div>
+ <p>
+ DESCRIPTION
+ </p>
+ <div class="sample-container" >
+ <ui:include src="/richfaces/inplaceSelect/examples/selectItems.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/inplaceSelect/examples/selectItems.xhtml"/>
+ </ui:include>
+ </div>
+ </ui:define>
+
+ </ui:composition>
+</html>
16 years, 10 months
JBoss Rich Faces SVN: r6536 - in trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo: comboBox and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-04 10:45:43 -0500 (Tue, 04 Mar 2008)
New Revision: 6536
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/comboBox/
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/comboBox/ComboBoxBean.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/inplaces/
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/inplaces/InplaceComponentsBean.java
Log:
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/comboBox/ComboBoxBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/comboBox/ComboBoxBean.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/comboBox/ComboBoxBean.java 2008-03-04 15:45:43 UTC (rev 6536)
@@ -0,0 +1,24 @@
+/**
+ *
+ */
+package org.richfaces.demo.comboBox;
+
+/**
+ * @author Ilya Shaikovsky
+ *
+ */
+public class ComboBoxBean {
+
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public ComboBoxBean() {
+ }
+}
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/inplaces/InplaceComponentsBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/inplaces/InplaceComponentsBean.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/inplaces/InplaceComponentsBean.java 2008-03-04 15:45:43 UTC (rev 6536)
@@ -0,0 +1,24 @@
+/**
+ *
+ */
+package org.richfaces.demo.inplaces;
+
+/**
+ * @author Ilya Shaikovsky
+ *
+ */
+public class InplaceComponentsBean {
+
+ private String inputValue;
+
+ public String getInputValue() {
+ return inputValue;
+ }
+
+ public void setInputValue(String inputValue) {
+ this.inputValue = inputValue;
+ }
+
+ public InplaceComponentsBean() {
+ }
+}
16 years, 10 months
JBoss Rich Faces SVN: r6535 - in trunk/samples/richfaces-demo/src/main: resources/org/richfaces/demo/common and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-04 10:45:14 -0500 (Tue, 04 Mar 2008)
New Revision: 6535
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/pickList.xhtml
Log:
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java 2008-03-04 15:39:37 UTC (rev 6534)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java 2008-03-04 15:45:14 UTC (rev 6535)
@@ -7,6 +7,7 @@
import java.util.List;
import javax.faces.FacesException;
+import javax.faces.model.SelectItem;
import org.apache.commons.digester.Digester;
import org.apache.commons.digester.xmlrules.DigesterLoader;
@@ -14,6 +15,8 @@
public class CapitalsBean {
private ArrayList<Capital> capitals = new ArrayList<Capital>();
+ private ArrayList<String> capitalsNames = new ArrayList<String>();
+ private SelectItem[] capitalsNamesOptions;
private String capital = "";
public List<Capital> autocomplete(Object suggest) {
@@ -42,7 +45,16 @@
} catch (SAXException e) {
throw new FacesException(e);
}
-
+ capitalsNames.clear();
+ for (Capital cap : capitals) {
+ capitalsNames.add(cap.getName());
+ }
+ capitalsNamesOptions = new SelectItem[capitals.size()];
+ for (int i=0; i<capitals.size(); i++) {
+ capitalsNamesOptions[i] = new SelectItem();
+ capitalsNamesOptions[i].setLabel(capitals.get(i).getName());
+ capitalsNamesOptions[i].setValue(capitals.get(i).getName());
+ }
}
public String addCapital(Capital capital) {
@@ -61,5 +73,13 @@
public void setCapital(String capital) {
this.capital = capital;
}
+
+ public ArrayList<String> getCapitalsNames() {
+ return capitalsNames;
+ }
+
+ public SelectItem[] getCapitalsNamesOptions() {
+ return capitalsNamesOptions;
+ }
}
Modified: trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2008-03-04 15:39:37 UTC (rev 6534)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2008-03-04 15:45:14 UTC (rev 6535)
@@ -69,8 +69,11 @@
portlet= ajaxMisc, Ajax Portlet, /images/ico_common.gif, /images/cn_AjaxPortlet.gif, RichFacesComponentsLibrary.html#portlet, jbossajax4jsf/freezone/docs/tlddoc/a4j/portlet.html, jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIPortlet.html, /richfaces/portlet.jsf
effect= richMisc, Effect, /images/ico_common.gif, /images/cn_Effect.gif, RichFacesComponentsLibrary.html#effect, jbossrichfaces/freezone/docs/tlddoc/rich/effect.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIEffect.html, /richfaces/effect.jsf
contextMenu= richMenu, Context Menu, /images/ico_dropDownMenu.gif, /images/cn_contextMenu.gif, RichFacesComponentsLibrary.html\#contextMenu, jbossrichfaces/freezone/docs/tlddoc/rich/contextMenu.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIContextMenu.html, /richfaces/contextMenu.jsf
-componentControl= richMisc, Component Control, /images/ico_common.gif, /images/cn_componentControl.gif, RichFacesComponentsLibrary.html\#componentControl, jbossrichfaces/freezone/docs/tlddoc/rich/componentControl.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIcomponentControl.html, /richfaces/componentControl.jsf
-orderingList=richSelect, Ordering List, \t /images/ico_DataTable.gif, /images/cn_orderingList.gif, RichFacesComponentsLibrary.html\#orderingList, jbossrichfaces/freezone/docs/tlddoc/rich/orderingList.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIorderingList.html, /richfaces/orderingList.jsf
-listShuttle=richSelect, List Shuttle, \t\t/images/ico_DataTable.gif, /images/cn_listShuttle.gif, RichFacesComponentsLibrary.html\#listShuttle, jbossrichfaces/freezone/docs/tlddoc/rich/listShuttle.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIlistShuttle.html, /richfaces/listShuttle.jsf
-pickList=richSelect, Pick List, \t\t/images/ico_DataTable.gif, /images/cn_listShuttle.gif, RichFacesComponentsLibrary.html\#pickList, jbossrichfaces/freezone/docs/tlddoc/rich/pickList.html, \t\tjbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIpickList.html, /richfaces/pickList.jsf
-progressBar=richOutputs, Progress Bar, \t\t/images/ico_DataTable.gif, /images/cn_listShuttle.gif, RichFacesComponentsLibrary.html\#progressBar, jbossrichfaces/freezone/docs/tlddoc/rich/progressBar.html, \t\tjbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIprogressBar.html, /richfaces/progressBar.jsf
\ No newline at end of file
+componentControl=richMisc, Component Control, /images/ico_common.gif, \t\t/images/cn_componentControl.gif, RichFacesComponentsLibrary.html\#componentControl, jbossrichfaces/freezone/docs/tlddoc/rich/componentControl.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIcomponentControl.html, /richfaces/componentControl.jsf
+orderingList=richSelect, Ordering List, \t \t/images/ico_DataTable.gif, \t/images/cn_orderingList.gif, RichFacesComponentsLibrary.html\#orderingList, jbossrichfaces/freezone/docs/tlddoc/rich/orderingList.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIorderingList.html, \t\t/richfaces/orderingList.jsf
+listShuttle=richSelect, List Shuttle, \t\t \t\t/images/ico_DataTable.gif, /images/cn_listShuttle.gif, RichFacesComponentsLibrary.html\#listShuttle, jbossrichfaces/freezone/docs/tlddoc/rich/listShuttle.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIlistShuttle.html, \t\t/richfaces/listShuttle.jsf
+pickList=richSelect, Pick List, \t\t\t\t\t/images/ico_DataTable.gif, /images/cn_listShuttle.gif, RichFacesComponentsLibrary.html\#pickList, jbossrichfaces/freezone/docs/tlddoc/rich/pickList.html, \t\tjbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIpickList.html, \t\t\t\t/richfaces/pickList.jsf
+progressBar=richOutputs, Progress Bar, \t\t \t\t/images/ico_DataTable.gif, /images/cn_listShuttle.gif, RichFacesComponentsLibrary.html\#progressBar, jbossrichfaces/freezone/docs/tlddoc/rich/progressBar.html, \t\tjbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIprogressBar.html, \t/richfaces/progressBar.jsf
+comboBox=richInputs, Combo Box, \t\t/images/ico_ComboBox.gif, \t\t/images/cn_ComboBox.gif, RichFacesComponentsLibrary.html\#comboBox, jbossrichfaces/freezone/docs/tlddoc/rich/comboBox.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIcomboBox.html, \t\t\t\t\t/richfaces/comboBox.jsf
+inplaceInput=richInputs, Inplace Input, \t\t/images/ico_InplaceInput.gif, \t\t/images/cn_InplaceInput.gif, RichFacesComponentsLibrary.html\#inplaceInput, jbossrichfaces/freezone/docs/tlddoc/rich/inplaceInput.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIinplaceInput.html, \t\t\t\t\t/richfaces/inplaceInput.jsf
+inplaceSelect=richInputs, Inplace Select, \t\t/images/ico_InplaceSelect.gif, \t\t/images/cn_InplaceSelect.gif, RichFacesComponentsLibrary.html\#inplaceSelect, jbossrichfaces/freezone/docs/tlddoc/rich/inplaceSelect.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIinplaceSelect.html, \t\t\t\t\t/richfaces/inplaceSelect.jsf
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-03-04 15:39:37 UTC (rev 6534)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-03-04 15:45:14 UTC (rev 6535)
@@ -283,6 +283,16 @@
<managed-bean-class>org.richfaces.demo.progressBar.ProgressBarBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>comboBoxBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.comboBox.ComboBoxBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>inplaceComponentsBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.inplaces.InplaceComponentsBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
<navigation-rule>
<from-view-id>/richfaces/include/examples/wstep1.xhtml</from-view-id>
<navigation-case>
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2008-03-04 15:39:37 UTC (rev 6534)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2008-03-04 15:45:14 UTC (rev 6535)
@@ -25,7 +25,7 @@
</context-param>
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
- <param-value>true</param-value>
+ <param-value>false</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.SKIN</param-name>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/pickList.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/pickList.xhtml 2008-03-04 15:39:37 UTC (rev 6534)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/pickList.xhtml 2008-03-04 15:45:14 UTC (rev 6535)
@@ -12,7 +12,7 @@
<ui:include src="/richfaces/pickList/usage.xhtml"/>
</rich:tab>
<ui:include src="/templates/include/tagInfo.xhtml">
- <ui:param name="path" value="a4j/pickList"/>
+ <ui:param name="path" value="rich/pickList"/>
</ui:include>
</rich:tabPanel>
</ui:define>
16 years, 10 months
JBoss Rich Faces SVN: r6534 - trunk/ui/inplaceSelect/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-04 10:39:37 -0500 (Tue, 04 Mar 2008)
New Revision: 6534
Modified:
trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
Log:
Modified: trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
===================================================================
--- trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2008-03-04 15:39:13 UTC (rev 6533)
+++ trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2008-03-04 15:39:37 UTC (rev 6534)
@@ -56,7 +56,7 @@
<name>defaultLabel</name>
<classname>java.lang.String</classname>
<description></description>
- <defaultvalue><![CDATA["Click..."]]></defaultvalue>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>showControls</name>
@@ -126,8 +126,10 @@
<property>
<name>listWidth</name>
<classname>java.lang.String</classname>
- <description>"100px"</description>
+ <description></description>
+ <defaultvalue>"200px"</defaultvalue>
</property>
+
<property>
<name>listHeight</name>
<classname>java.lang.String</classname>
16 years, 10 months
JBoss Rich Faces SVN: r6533 - trunk/ui/inplaceInput/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-04 10:39:13 -0500 (Tue, 04 Mar 2008)
New Revision: 6533
Modified:
trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml
Log:
Modified: trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml
===================================================================
--- trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-03-04 15:16:49 UTC (rev 6532)
+++ trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-03-04 15:39:13 UTC (rev 6533)
@@ -62,7 +62,7 @@
<name>defaultLabel</name>
<classname>java.lang.String</classname>
<description></description>
- <defaultvalue><![CDATA["Click..."]]></defaultvalue>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>showControls</name>
16 years, 10 months
JBoss Rich Faces SVN: r6532 - trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-03-04 10:16:49 -0500 (Tue, 04 Mar 2008)
New Revision: 6532
Modified:
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
RF-1791
Modified: trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2008-03-04 15:06:25 UTC (rev 6531)
+++ trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2008-03-04 15:16:49 UTC (rev 6532)
@@ -555,6 +555,11 @@
var input = $(this.options.selection);
input.value = this.index;
+ var value="";
+ if ( this.fetchValues && (value=this.fetchValues[this.index]) )
+ {
+ $(this.content+"_hiddenFetchValue").value = value;
+ }
this.updateElement(this.getCurrentEntry());
if (this.options.onselect) {
@@ -727,7 +732,7 @@
A4J.AJAX.Submit(this.containerId, this.actionUrl, event, this.options);
},
- onComplete: function(request, event) {
+ onComplete: function(request, event, data) {
LOG.debug("AJAX response complete - updateChoices");
// Calculate height of choices window
if (!this.update.style.position || this.update.style.position
@@ -736,6 +741,7 @@
RichFaces.Position.smartClone(this.element, this.update, this.options);
}
this.updateChoices();
+ this.fetchValues = data;
LOG.debug("Choices updated");
if (this.options.onajaxcomplete) {
this.options.onajaxcomplete(request, event);
16 years, 10 months
JBoss Rich Faces SVN: r6531 - in trunk/ui/inplaceSelect/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-03-04 10:06:25 -0500 (Tue, 04 Mar 2008)
New Revision: 6531
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
button positioning
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss 2008-03-04 14:58:18 UTC (rev 6530)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss 2008-03-04 15:06:25 UTC (rev 6531)
@@ -18,7 +18,7 @@
width : 12px;
position : absolute;
top:1px;
- left : 88px;
+ /*left : 88px;*/
/*background-image:url(images/mark_list.gif);*/
background-position : center right;
background-repeat : no-repeat;
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-03-04 14:58:18 UTC (rev 6530)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-03-04 15:06:25 UTC (rev 6531)
@@ -1,9 +1,10 @@
if(!window.Richfaces) window.Richfaces = {};
Richfaces.InplaceSelect = Class.create(Richfaces.InplaceInput, {
- initialize : function($super, listObj, clientId, temValueKeepId, valueKeepId, tabberId, strutId, attributes, events, classes, barParams) {
+ initialize : function($super, listObj, clientId, temValueKeepId, valueKeepId, tabberId, strutId, attributes, events, classes, barParams, buttonId) {
this.comboList = listObj;
$super(clientId, temValueKeepId, valueKeepId, tabberId, strutId, attributes, events, classes, barParams);
this.clickOnBar = false;
+ this.button = $(buttonId);
},
initHandlers : function($super) {
@@ -16,6 +17,11 @@
this.comboList.listParent.observe("click", function(e){this.listClickHandler(e);}.bindAsEventListener(this));
},
+ setInputWidth : function($super) {
+ $super();
+ this.button.style.left = (parseInt(this.tempValueKeeper.style.width) - 12) + "px";
+ },
+
switchingStatesHandler : function($super, e) {
var el = (e.srcElement) ? e.srcElement : e.target;
if ((el.id == this.inplaceInput.id) || (e.type == "focus")) {
@@ -27,11 +33,17 @@
startEditableState : function($super, textSize) {
$super(textSize);
+ this.button.show();
if (this.attributes.openOnEdit) {
this.comboList.showWithDelay();
}
},
+ endEditableState : function($super) {
+ $super();
+ this.button.hide();
+ },
+
tempKeeperClickHandler : function() {
this.comboList.isList = false;
this.comboList.showWithDelay();
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-03-04 14:58:18 UTC (rev 6530)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-03-04 15:06:25 UTC (rev 6531)
@@ -74,7 +74,7 @@
tabindex='#{component.attributes["tabindex"]}'
readonly="readonly"
class="rich-inplace-select-field"/>
- <input readonly="readonly" type="Text" value="" class="insel_arrow"/>
+ <input id="#{clientId}inselArrow" readonly="readonly" type="Text" value="" class="insel_arrow" style='display:none;'/>
<input id='#{clientId}inplaceValue' name='#{clientId}inplaceValue' type='hidden' value='#{fieldValue}'/>
<div id="#{clientId}bar" class="rich-inplace-select-control-set" style="display:none;">
<jsp:scriptlet>
@@ -182,9 +182,9 @@
Richfaces.InplaceSelect.CLASSES.COMBO_LIST, '#{component.attributes["listWidth"]}', '#{component.attributes["listHeight"]}', #{this:getItemsTextAsJSArray(context, component)}, null,
'#{clientId}inplaceTmpValue', 'shadow#{clientId}', 0, 0);
var richInplaceSelect = new Richfaces.InplaceSelect(richInplaceList, '#{clientId}', '#{clientId}inplaceTmpValue',
- '#{clientId}inplaceValue', '#{clientId}tabber', '#{clientId}inplaceStrut',
+ '#{clientId}inplaceValue', '#{clientId}tabber', '#{clientId}inplaceStrut',
richInplaceSelAttributes, richInplaceSelEvents, Richfaces.InplaceSelect.CLASSES,
- ['#{clientId}bar', '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons', '#{clientId}btns_shadow']);
+ ['#{clientId}bar', '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons', '#{clientId}btns_shadow'], '#{clientId}inselArrow');
</script>
</f:root>
16 years, 10 months
JBoss Rich Faces SVN: r6530 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-03-04 09:58:18 -0500 (Tue, 04 Mar 2008)
New Revision: 6530
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCSettings.xml
Log:
Section 'Oracle AS/OC4J' was added to 'Settings for different environments'.
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCSettings.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCSettings.xml 2008-03-04 14:58:11 UTC (rev 6529)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCSettings.xml 2008-03-04 14:58:18 UTC (rev 6530)
@@ -262,4 +262,17 @@
<para> This is because, EAServer calls servlet init() before the ServletContextInitializer. Not
an EAServer bug, this is in Servlet 2.3 spec.</para>
</section>
+ <section id="Oracle AS/OC4J">
+ <title>Oracle AS/OC4J</title>
+ <para>In order to deploy your project with RichFaces components to an <property>Oracle AS</property> you just have to
+ prevent the application's class loader from importing the Oracle XML parser.
+ Use the following notation in <property>orion-application.xml</property>:</para>
+ <programlisting role="XML"><![CDATA[...
+<imported-shared-libraries>
+ <remove-inherited name="oracle.xml"/>
+ <remove-inherited name="oracle.xml.security"/>
+</imported-shared-libraries>
+...
+]]></programlisting>
+ </section>
</chapter>
16 years, 10 months
JBoss Rich Faces SVN: r6529 - in trunk/ui/suggestionbox/src/main: java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2008-03-04 09:58:11 -0500 (Tue, 04 Mar 2008)
New Revision: 6529
Modified:
trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-1774
Modified: trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
--- trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-03-04 14:03:17 UTC (rev 6528)
+++ trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-03-04 14:58:11 UTC (rev 6529)
@@ -352,6 +352,9 @@
It isn't selectable and list is closed as always after click on it and nothing is put to input.
</description>
</property>
-
+ <property>
+ <name>selectedObjects</name>
+ <classname>java.lang.Object</classname>
+ </property>
</component>
</components>
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2008-03-04 14:03:17 UTC (rev 6528)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2008-03-04 14:58:11 UTC (rev 6529)
@@ -105,6 +105,11 @@
public abstract void setData(Object data);
public abstract Object getData();
+
+ public abstract Object getSelectedObjects();
+
+ public abstract void setSelectedObjects(Object so);
+
/**
@@ -347,7 +352,9 @@
} else {
setRowNumber(-1);
}
- super.processDecodes(context);
+ Object selectedObject = requestParameterMap.get(clientId+"_hiddenFetchValue");
+ setSelectedObjects(selectedObject);
+ super.processDecodes(context);
}
public void setupValue(FacesContext context) {
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-04 14:03:17 UTC (rev 6528)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-04 14:58:11 UTC (rev 6529)
@@ -61,763 +61,820 @@
* Renderer for SuggestionBox component.
*/
public class SuggestionBoxRenderer extends AjaxComponentRendererBase {
- /**
- * Component options.
- */
- private static final String[] OPTIONS = {"popupClass", "popupStyle",
- "width", "height", "entryClass", "selectedClass", "param",
- "frequency", "minChars", "tokens", "rows", "selectValueClass" };
+ /**
+ * Component options.
+ */
+ private static final String[] OPTIONS = { "popupClass", "popupStyle",
+ "width", "height", "entryClass", "selectedClass", "param",
+ "frequency", "minChars", "tokens", "rows", "selectValueClass" };
- /**
- * Shadow depth.
- */
- public static final int SHADOW_DEPTH = 4;
+ /**
+ * Shadow depth.
+ */
+ public static final int SHADOW_DEPTH = 4;
- /**
- * Styles.
- */
- private InternetResource[] styles = {new TemplateCSSResource(
- "org/richfaces/renderkit/html/css/suggestionbox.xcss")};
+ /**
+ * Styles.
+ */
+ private InternetResource[] styles = { new TemplateCSSResource(
+ "org/richfaces/renderkit/html/css/suggestionbox.xcss") };
- /**
- * Additional scripts.
- */
- private final InternetResource[] additionalScripts = {
- new org.ajax4jsf.javascript.PrototypeScript(),
- new org.ajax4jsf.javascript.SmartPositionScript(),
- getResource("/org/richfaces/renderkit/html/scripts/browser_info.js"),
- getResource("scripts/scriptaculo.js"),
- getResource("scripts/suggestionbox.js")};
+ /**
+ * Additional scripts.
+ */
+ private final InternetResource[] additionalScripts = {
+ new org.ajax4jsf.javascript.PrototypeScript(),
+ new org.ajax4jsf.javascript.SmartPositionScript(),
+ getResource("/org/richfaces/renderkit/html/scripts/browser_info.js"),
+ getResource("scripts/scriptaculo.js"),
+ getResource("scripts/suggestionbox.js") };
- /**
- * Template for table.
- */
- private PreparedTemplate body = HtmlCompiler
- .compileResource("org/richfaces/renderkit/html/templates/table.jspx");
+ /**
+ * Template for table.
+ */
+ private PreparedTemplate body = HtmlCompiler
+ .compileResource("org/richfaces/renderkit/html/templates/table.jspx");
- /**
- * Template for popup.
- */
- private PreparedTemplate popup = HtmlCompiler
- .compileResource("org/richfaces/renderkit/html/templates/popup.jspx");
+ /**
+ * Template for popup.
+ */
+ private PreparedTemplate popup = HtmlCompiler
+ .compileResource("org/richfaces/renderkit/html/templates/popup.jspx");
- /**
- * Gets component class.
- *
- * @return component class
- */
- protected final Class getComponentClass() {
- return UISuggestionBox.class;
- }
+ /**
+ * Gets component class.
+ *
+ * @return component class
+ */
+ protected final Class getComponentClass() {
+ return UISuggestionBox.class;
+ }
- /**
- * Is render children.
- *
- * @return boolean
- */
- public final boolean getRendersChildren() {
- return true;
- }
+ /**
+ * Is render children.
+ *
+ * @return boolean
+ */
+ public final boolean getRendersChildren() {
+ return true;
+ }
- /**
- * Decode.
- *
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- *
- * @see org.ajax4jsf.framework.renderer.RendererBase#doDecode(
- * javax.faces.context.FacesContext,
- * javax.faces.component.UIComponent)
- */
- protected final void doDecode(final FacesContext context,
- final UIComponent component) {
- String clientId = component.getClientId(context);
- Map requestParameterMap = context.getExternalContext()
- .getRequestParameterMap();
- String reqValue = (String) requestParameterMap.get(clientId);
- if (reqValue != null && reqValue.equals(clientId)) {
- String paramName = (String) component.getAttributes().get("param");
- if (null == paramName) {
- paramName = "inputvalue";
- }
- Object elementValue = requestParameterMap.get(paramName);
- ((UISuggestionBox)component).setSubmitedValue(elementValue);
- component.queueEvent(
- new AjaxSuggestionEvent(component, elementValue));
- }
- }
+ /**
+ * Decode.
+ *
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ *
+ * @see org.ajax4jsf.framework.renderer.RendererBase#doDecode(
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ protected final void doDecode(final FacesContext context,
+ final UIComponent component) {
+ String clientId = component.getClientId(context);
+ Map requestParameterMap = context.getExternalContext()
+ .getRequestParameterMap();
+ String reqValue = (String) requestParameterMap.get(clientId);
+ if (reqValue != null && reqValue.equals(clientId)) {
+ String paramName = (String) component.getAttributes().get("param");
+ if (null == paramName) {
+ paramName = "inputvalue";
+ }
+ Object elementValue = requestParameterMap.get(paramName);
+ ((UISuggestionBox) component).setSubmitedValue(elementValue);
+ component.queueEvent(new AjaxSuggestionEvent(component,
+ elementValue));
+ }
+ }
- /**
- * Encode begin.
- *
- * @param writer {@link javax.faces.context.ResponseWriter}
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- * @throws IOException
- *
- * @see {@link org.ajax4jsf.framework.renderer.RendererBase#doEncodeBegin}
- */
- protected final void doEncodeBegin(final ResponseWriter writer,
- final FacesContext context,
- final UIComponent component)
- throws IOException {
- super.doEncodeBegin(writer, context, component);
- org.richfaces.component.util.FormUtil.throwEnclFormReqExceptionIfNeed(
- context, component);
- }
+ /**
+ * Encode begin.
+ *
+ * @param writer
+ * {@link javax.faces.context.ResponseWriter}
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @throws IOException
+ *
+ * @see {@link org.ajax4jsf.framework.renderer.RendererBase#doEncodeBegin}
+ */
+ protected final void doEncodeBegin(final ResponseWriter writer,
+ final FacesContext context, final UIComponent component)
+ throws IOException {
+ super.doEncodeBegin(writer, context, component);
+ org.richfaces.component.util.FormUtil.throwEnclFormReqExceptionIfNeed(
+ context, component);
+ }
- /**
- * Encode end.
- *
- * @param writer {@link javax.faces.context.ResponseWriter}
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- * @throws IOException
- *
- * @see {@link org.ajax4jsf.framework.renderer.RendererBase#doEncodeEnd}
- */
- protected void doEncodeEnd(final ResponseWriter writer,
- final FacesContext context,
- final UIComponent component) throws IOException {
- UISuggestionBox suggestionBox = (UISuggestionBox) component;
-
- if (!suggestionBox.isSubmitted()) {
- suggestionBox.setRowIndex(-1);
- writer.startElement(HTML.DIV_ELEM, component);
- getUtils().encodeId(context, component);
+ protected void writeExplicitMarkup(ResponseWriter writer,
+ UISuggestionBox suggestionBox) {
- StringBuffer clazz = new StringBuffer(
- "dr-sb-common-container rich-sb-common-container ");
- clazz.append(suggestionBox.getPopupClass() + " ").
- append(suggestionBox.getStyleClass());
- writer.writeAttribute("class", clazz, "popupClass");
+ String forAttribute = suggestionBox.getFor();
+ if (forAttribute != null && forAttribute.length() > 0) {
+
+ }
+ }
- int zIndex = suggestionBox.getZindex();
+ /**
+ * Encode end.
+ *
+ * @param writer
+ * {@link javax.faces.context.ResponseWriter}
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @throws IOException
+ *
+ * @see {@link org.ajax4jsf.framework.renderer.RendererBase#doEncodeEnd}
+ */
+ protected void doEncodeEnd(final ResponseWriter writer,
+ final FacesContext context, final UIComponent component)
+ throws IOException {
+ UISuggestionBox suggestionBox = (UISuggestionBox) component;
- StringBuffer style = new StringBuffer("display:none; z-index: " + (zIndex + 1) + ";");
+ if (!suggestionBox.isSubmitted()) {
+ suggestionBox.setRowIndex(-1);
- style.append(getSizeForStyle(component, "width", null, false));
- style.append(getSizeForStyle(component, "height", null, false));
+ writer.startElement(HTML.DIV_ELEM, component);
+ getUtils().encodeId(context, component);
- style.append(suggestionBox.getPopupStyle() + ";").
- append(suggestionBox.getStyle() + ";");
- writer.writeAttribute("style", style, "popupStyle");
+ StringBuffer clazz = new StringBuffer(
+ "dr-sb-common-container rich-sb-common-container ");
+ clazz.append(suggestionBox.getPopupClass() + " ").append(
+ suggestionBox.getStyleClass());
+ writer.writeAttribute("class", clazz, "popupClass");
- UIComponent popupFacet = component.getFacet("popup");
- if (null == popupFacet) {
- popup.encode(this, context, component);
- } else {
- // Use facet as content of popup window
- // suggestionBox.setPopup(popupFacet.getClientId(context));
- renderChild(context, popupFacet);
- }
- writer.startElement(HTML.SCRIPT_ELEM, component);
- writer.writeText(getScript(context, component), "script");
- writer.endElement(HTML.SCRIPT_ELEM);
- writer.endElement(HTML.DIV_ELEM);
- writer.startElement("iframe", component);
- writer.writeAttribute("src",
- getResource("/org/richfaces/renderkit/html/images/spacer.gif")
- .getUri(context, null), null);
- writer.writeAttribute("id", component.getClientId(context)
- + "_iframe", null);
- writer.writeAttribute(
- "style", "position:absolute;display:none;z-index:" + zIndex + ";", null);
- writer.endElement("iframe");
-
- writer.startElement("input", component);
- writer.writeAttribute("type", "hidden", null);
- writer.writeAttribute("id", component.getClientId(context)
- + "_hiddenFetchValue", null);
- writer.writeAttribute("name", component.getClientId(context)
- + "_hiddenFetchValue", null);
- writer.endElement("input");
+ int zIndex = suggestionBox.getZindex();
- writer.startElement("input", component);
- writer.writeAttribute("type", "hidden", null);
- writer.writeAttribute("id", component.getClientId(context)
- + "_selection", null);
- writer.writeAttribute("name", component.getClientId(context)
- + "_selection", null);
- writer.endElement("input");
-
- } else {
- suggestionBox.setSubmitted(false);
- }
+ StringBuffer style = new StringBuffer("display:none; z-index: "
+ + (zIndex + 1) + ";");
- // Fix for bug CH-1323.
- ((UISuggestionBox) component).setValue(null);
- }
+ style.append(getSizeForStyle(component, "width", null, false));
+ style.append(getSizeForStyle(component, "height", null, false));
- /**
- * Encode children.
- *
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- * @throws IOException
- *
- * @see javax.faces.render.Renderer#encodeChildren
- */
- public void encodeChildren(final FacesContext context,
- final UIComponent component)
- throws IOException {
- UISuggestionBox suggestionBox = (UISuggestionBox) component;
- if (suggestionBox.isSubmitted()) {
- suggestionBox.setupValue(context);
- body.encode(getTemplateContext(context, suggestionBox));
-
- Object[] values = ((Collection)suggestionBox.getValue()).toArray();
- //Object hiddenFetchValue = suggestionBox.getHiddenFetchValue();
- Collection data = new ArrayList();
- for(int i=0;i<values.length;i++){
-
- String var = (String)suggestionBox.getAttributes().get("var");
- context.getExternalContext().getRequestMap().put(var, values[i]);
- if(suggestionBox.getHiddenFetchValue()!=null){
- data.add(suggestionBox.getHiddenFetchValue());
- }else{
- data.add(suggestionBox.getFetchValue());
- }
-
-
- }
- suggestionBox.setData(data);
- // Replace rendered area ID from component to suggestion table
- suggestionBox.setRowIndex(-1);
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- ajaxContext.removeRenderedArea(component.getClientId(context));
- ajaxContext.addRenderedArea(getContentId(context, component));
- }
- }
+ style.append(suggestionBox.getPopupStyle() + ";").append(
+ suggestionBox.getStyle() + ";");
+ writer.writeAttribute("style", style, "popupStyle");
- /**
- * Gets component.
- *
- * @param component {@link javax.faces.component.UIComponent}
- * @return component
- */
- private UIComponent getTarget(final UIComponent component) {
- String target = ((UISuggestionBox) component).getFor();
- if (null != target) {
- target = RendererUtils.getInstance().correctForIdReference(target,component);
- // Use parent since UIData - naming container
- UIComponent targetComponent = RendererUtils.getInstance().
- findComponentFor(component, target);
- if (null != targetComponent) {
- return targetComponent;
- } else {
- throw new FacesException("Component for target " + target
- + " not found in SuggestionBox " + component.getId());
- }
- } else {
- throw new FacesException("Component SuggestionBox "
- + component.getId() + " don't have property 'for' ");
- }
- }
+ UIComponent popupFacet = component.getFacet("popup");
+ if (null == popupFacet) {
+ popup.encode(this, context, component);
+ } else {
+ // Use facet as content of popup window
+ // suggestionBox.setPopup(popupFacet.getClientId(context));
+ renderChild(context, popupFacet);
+ }
+ writer.startElement(HTML.SCRIPT_ELEM, component);
+ writer.writeText(getScript(context, component), "script");
+ writer.endElement(HTML.SCRIPT_ELEM);
+ writer.endElement(HTML.DIV_ELEM);
+ writer.startElement("iframe", component);
+ writer.writeAttribute("src", getResource(
+ "/org/richfaces/renderkit/html/images/spacer.gif").getUri(
+ context, null), null);
+ writer.writeAttribute("id", component.getClientId(context)
+ + "_iframe", null);
+ writer.writeAttribute("style",
+ "position:absolute;display:none;z-index:" + zIndex + ";",
+ null);
+ writer.endElement("iframe");
- /**
- * Gets script.
- *
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- * @return script
- */
- private String getScript(final FacesContext context,
- final UIComponent component) {
- Map attributes = component.getAttributes();
- StringBuffer script = new StringBuffer(" new ");
- // Build ajax function call
- JSFunction submitSuggest = AjaxRendererUtils.buildAjaxFunction(
- component, context, "RichFaces.Suggestion");
- UIComponent targetComponent = getTarget(component);
- submitSuggest.addParameter(targetComponent.getClientId(context));
- submitSuggest.addParameter(component.getClientId(context));
- submitSuggest.addParameter(component.getAttributes().get("onsubmit"));
- Map options = AjaxRendererUtils.buildEventOptions(context, component);
- options.put("popup", component.getClientId(context));
- for (int i = 0; i < OPTIONS.length; i++) {
- String option = OPTIONS[i];
- Object value = attributes.get(option);
- if (null != value) {
- options.put(option, value);
- }
- }
- // If ajax queue name not set, put clientId
- String eventsQueue = (String) options.get("eventsQueue");
- if (null == eventsQueue) {
- options.put("eventsQueue", component.getClientId(context));
- }
- String onselect = (String) attributes.get("onselect");
- if (null != onselect) {
- JSFunctionDefinition function = new JSFunctionDefinition(
- "suggestion");
- function.addParameter("event");
- function.addToBody(onselect);
+ writer.startElement("input", component);
+ writer.writeAttribute("type", "hidden", null);
+ writer.writeAttribute("id", component.getClientId(context)
+ + "_hiddenFetchValue", null);
+ writer.writeAttribute("name", component.getClientId(context)
+ + "_hiddenFetchValue", null);
+ writer.endElement("input");
- options.put("onselect", function);
+ writer.startElement("input", component);
+ writer.writeAttribute("type", "hidden", null);
+ writer.writeAttribute("id", component.getClientId(context)
+ + "_selection", null);
+ writer.writeAttribute("name", component.getClientId(context)
+ + "_selection", null);
+ writer.endElement("input");
- }
- if (component.getValueBinding("fetchValue") != null
- || attributes.get("fetchValue") != null) {
- options.put("select", attributes.get("selectValueClass"));
- }
+ } else {
+ suggestionBox.setSubmitted(false);
+ }
- submitSuggest.addParameter(options);
- script.append(submitSuggest.toScript()).append(";\n");
- return script.toString();
- }
+ // Fix for bug CH-1323.
+ ((UISuggestionBox) component).setValue(null);
+ }
- /**
- * Gets template.
- *
- * @param context {@link javax.faces.context.FacesContext}
- * @param data
- * @return {@link org.ajax4jsf.framework.renderer.compiler.TemplateContext}
- */
- private TemplateContext getTemplateContext(final FacesContext context,
- final UIData data) {
- data.setRowIndex(-1);
- return new DataTemplateContext(this, context, data);
- }
+ /**
+ * Encode children.
+ *
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @throws IOException
+ *
+ * @see javax.faces.render.Renderer#encodeChildren
+ */
+ public void encodeChildren(final FacesContext context,
+ final UIComponent component) throws IOException {
+ UISuggestionBox suggestionBox = (UISuggestionBox) component;
+ if (suggestionBox.isSubmitted()) {
+ suggestionBox.setupValue(context);
+ body.encode(getTemplateContext(context, suggestionBox));
- /**
- * Special html templates context class with pre-defined properties for
- * iterations over rows and columns.
- *
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.20 $ $Date: 2007/03/01 22:37:49 $
- */
- private static class DataTemplateContext extends TemplateContext {
+ Object[] values = ((Collection) suggestionBox.getValue()).toArray();
+ // Object hiddenFetchValue = suggestionBox.getHiddenFetchValue();
+ Collection data = new ArrayList();
+ for (int i = 0; i < values.length; i++) {
- private List columns;
+ String var = (String) suggestionBox.getAttributes().get("var");
+ context.getExternalContext().getRequestMap()
+ .put(var, values[i]);
+ if (suggestionBox.getHiddenFetchValue() != null) {
+ data.add(suggestionBox.getHiddenFetchValue());
+ } else {
+ data.add(suggestionBox.getFetchValue());
+ }
- private int first;
+ }
+ suggestionBox.setData(data);
+ // Replace rendered area ID from component to suggestion table
+ suggestionBox.setRowIndex(-1);
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ ajaxContext.removeRenderedArea(component.getClientId(context));
+ ajaxContext.addRenderedArea(getContentId(context, component));
+ ajaxContext.getResponseDataMap().put("_ajax:data",data);
+
+ }
+ }
- private int last;
+ /**
+ * Gets component.
+ *
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @return component
+ */
+ private UIComponent getTarget(final UIComponent component) {
+ String target = ((UISuggestionBox) component).getFor();
+ if (null != target) {
+ target = RendererUtils.getInstance().correctForIdReference(target,
+ component);
+ // Use parent since UIData - naming container
+ UIComponent targetComponent = RendererUtils.getInstance()
+ .findComponentFor(component, target);
+ if (null != targetComponent) {
+ return targetComponent;
+ } else {
+ throw new FacesException("Component for target " + target
+ + " not found in SuggestionBox " + component.getId());
+ }
+ } else {
+ return component;
+ }
+ }
- private int rows;
+ /**
+ * Gets script.
+ *
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @return script
+ */
+ private String getScript(final FacesContext context,
+ final UIComponent component) {
+ Map attributes = component.getAttributes();
+ StringBuffer script = new StringBuffer(" new ");
+ // Build ajax function call
+ JSFunction submitSuggest = AjaxRendererUtils.buildAjaxFunction(
+ component, context, "RichFaces.Suggestion");
+ UIComponent targetComponent = getTarget(component);
+ if (targetComponent.equals(component)) {
+ submitSuggest.addParameter(targetComponent.getClientId(context)
+ + "_input");
+ } else {
+ submitSuggest.addParameter(targetComponent.getClientId(context));
+ }
+ submitSuggest.addParameter(component.getClientId(context));
+ submitSuggest.addParameter(component.getAttributes().get("onsubmit"));
+ Map options = AjaxRendererUtils.buildEventOptions(context, component);
+ options.put("popup", component.getClientId(context));
+ for (int i = 0; i < OPTIONS.length; i++) {
+ String option = OPTIONS[i];
+ Object value = attributes.get(option);
+ if (null != value) {
+ options.put(option, value);
+ }
+ }
+ // If ajax queue name not set, put clientId
+ String eventsQueue = (String) options.get("eventsQueue");
+ if (null == eventsQueue) {
+ options.put("eventsQueue", component.getClientId(context));
+ }
+ String onselect = (String) attributes.get("onselect");
+ if (null != onselect) {
+ JSFunctionDefinition function = new JSFunctionDefinition(
+ "suggestion");
+ function.addParameter("event");
+ function.addToBody(onselect);
- private int rowCount;
+ options.put("onselect", function);
- private int current;
+ }
+ if (component.getValueBinding("fetchValue") != null
+ || attributes.get("fetchValue") != null) {
+ options.put("select", attributes.get("selectValueClass"));
+ }
- private String[] rowClasses = new String[0];
+ submitSuggest.addParameter(options);
+ script.append(submitSuggest.toScript()).append(";\n");
+ return script.toString();
+ }
- private String entryClass;
+ /**
+ * Gets template.
+ *
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param data
+ * @return {@link org.ajax4jsf.framework.renderer.compiler.TemplateContext}
+ */
+ private TemplateContext getTemplateContext(final FacesContext context,
+ final UIData data) {
+ data.setRowIndex(-1);
+ return new DataTemplateContext(this, context, data);
+ }
- /**
- * Constructor.
- *
- * @param renderer {@link org.ajax4jsf.framework.renderer.RendererBase}
- * @param facesContext {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- */
- public DataTemplateContext(final RendererBase renderer,
- final FacesContext facesContext,
- final UIComponent component) {
- super(renderer, facesContext, component);
- if (component.getFacet("head") != null) {
- this.putParameter("hasHead", Boolean.TRUE);
- }
- if (component.getFacet("head") != null) {
- this.putParameter("hasHead", Boolean.TRUE);
- }
- // Fill child columns components
- columns = new ArrayList(component.getChildCount());
- for (Iterator iter = component.getChildren().iterator(); iter
- .hasNext();) {
- UIComponent column = (UIComponent) iter.next();
- if (column instanceof UIColumn) {
- columns.add(column);
- if (column.getFacet("head") != null) {
- this.putParameter("hasHead", Boolean.TRUE);
- this.putParameter("hasColumnHead", Boolean.TRUE);
- }
- if (column.getFacet("footer") != null) {
- this.putParameter("hasFooter", Boolean.TRUE);
- this.putParameter("hasColumnFooter", Boolean.TRUE);
- }
- }
- }
- // fill rows counters
- UISuggestionBox box = (UISuggestionBox) component;
- this.first = box.getFirst();
- this.rows = box.getRows();
- this.rowCount = box.getRowCount();
- // return all records; CH-1330
- if (rows <= 0 || true) {
- rows = rowCount - first;
- }
- last = first + rows;
- if (last > rowCount) {
- last = rowCount;
- }
- current = first;
- // rows classes
- entryClass = box.getEntryClass();
- String rowClasses = box.getRowClasses();
- if (null != rowClasses && rowClasses.length() > 0) {
- this.rowClasses = rowClasses.split("\\s+");
- }
+ /**
+ * Special html templates context class with pre-defined properties for
+ * iterations over rows and columns.
+ *
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.20 $ $Date: 2007/03/01 22:37:49 $
+ */
+ private static class DataTemplateContext extends TemplateContext {
- }
+ private List columns;
- /**
- * Gets parameter.
- *
- * @param key parameter key
- * @return parameter
- */
- public Object getParameter(Object key) {
- if ("rows".equals(key)) {
- // Iterate over rows in datatable
- return new Iterator() {
+ private int first;
- public boolean hasNext() {
- if (current >= last) {
- return false;
- }
- UIData data = ((UIData) getComponent());
- data.setRowIndex(current);
- return data.isRowAvailable();
- }
+ private int last;
- public Object next() {
- // TODO reset rows and columns classes counters
- current++;
- return getComponent();
- }
+ private int rows;
- public void remove() {
- throw new UnsupportedOperationException(
- "remove row from UIData not supported");
- }
+ private int rowCount;
- };
- } else if ("rowClass".equals(key)) {
- // Build row class string from entryClass and row classes
- StringBuffer rowClass = new StringBuffer();
- if (null != entryClass) {
- rowClass.append(entryClass);
- if (rowClasses.length > 0) {
- rowClass.append(" ");
- }
- }
- if (rowClasses.length > 0) {
- int currentClass = (current - first - 1)
- % rowClasses.length;
- if (currentClass < 0) {
- currentClass = 0;
- }
- rowClass.append(rowClasses[currentClass]);
- }
- // for iterate over columns
- return rowClass.toString();
- } else if ("columns".equals(key)) {
- // for iterate over columns
- return columns;
- } else if ("columnsCount".equals(key)) {
- return new Integer(columns.size());
- } else {
- return super.getParameter(key);
- }
- }
- }
+ private int current;
- /**
- * Gets opacity style.
- *
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- * @return style
- */
- public final String opacityStyle(final FacesContext context,
- final UIComponent component) {
- String opacity = (String) component.getAttributes().get("shadowOpacity");
- String filterOpacity;
+ private String[] rowClasses = new String[0];
- if (null == opacity) {
- Skin skin = SkinFactory.getInstance().getSkin(context);
- opacity = (String) skin.getParameter(context, "shadowOpacity");
- }
- try {
- Double op = Double.valueOf(opacity);
- filterOpacity = Integer.toString(op.intValue() * 10);
- opacity = Double.toString(op.doubleValue() / 10);
- } catch (Exception e) {
- // illegal opacity
- return ";";
- }
- return "opacity:" + opacity
- + "; filter:alpha(opacity=" + filterOpacity + ");";
- }
+ private String entryClass;
- /**
- * Gets border style.
- *
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- * @return style
- */
- public final String border(final FacesContext context,
- final UIComponent component) {
+ /**
+ * Constructor.
+ *
+ * @param renderer
+ * {@link org.ajax4jsf.framework.renderer.RendererBase}
+ * @param facesContext
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ */
+ public DataTemplateContext(final RendererBase renderer,
+ final FacesContext facesContext, final UIComponent component) {
+ super(renderer, facesContext, component);
+ if (component.getFacet("head") != null) {
+ this.putParameter("hasHead", Boolean.TRUE);
+ }
+ if (component.getFacet("head") != null) {
+ this.putParameter("hasHead", Boolean.TRUE);
+ }
+ // Fill child columns components
+ columns = new ArrayList(component.getChildCount());
+ for (Iterator iter = component.getChildren().iterator(); iter
+ .hasNext();) {
+ UIComponent column = (UIComponent) iter.next();
+ if (column instanceof UIColumn) {
+ columns.add(column);
+ if (column.getFacet("head") != null) {
+ this.putParameter("hasHead", Boolean.TRUE);
+ this.putParameter("hasColumnHead", Boolean.TRUE);
+ }
+ if (column.getFacet("footer") != null) {
+ this.putParameter("hasFooter", Boolean.TRUE);
+ this.putParameter("hasColumnFooter", Boolean.TRUE);
+ }
+ }
+ }
+ // fill rows counters
+ UISuggestionBox box = (UISuggestionBox) component;
+ this.first = box.getFirst();
+ this.rows = box.getRows();
+ this.rowCount = box.getRowCount();
+ // return all records; CH-1330
+ if (rows <= 0 || true) {
+ rows = rowCount - first;
+ }
+ last = first + rows;
+ if (last > rowCount) {
+ last = rowCount;
+ }
+ current = first;
+ // rows classes
+ entryClass = box.getEntryClass();
+ String rowClasses = box.getRowClasses();
+ if (null != rowClasses && rowClasses.length() > 0) {
+ this.rowClasses = rowClasses.split("\\s+");
+ }
- String border = (String) component.getAttributes().get("border");
+ }
- String frame = (String) component.getAttributes().get("frame");
- if (null == frame) {
- frame = "box";
- }
- StringBuffer stringBuffer = new StringBuffer();
+ /**
+ * Gets parameter.
+ *
+ * @param key
+ * parameter key
+ * @return parameter
+ */
+ public Object getParameter(Object key) {
+ if ("rows".equals(key)) {
+ // Iterate over rows in datatable
+ return new Iterator() {
- if (null != border && Pattern.matches("\\d*", border)) {
- border += "px";
- }
+ public boolean hasNext() {
+ if (current >= last) {
+ return false;
+ }
+ UIData data = ((UIData) getComponent());
+ data.setRowIndex(current);
+ return data.isRowAvailable();
+ }
- boolean top = false, right = false, bottom = false, left = false;
- if (frame.equalsIgnoreCase("above")) {
- top = true;
- // else if (frame.equalsIgnoreCase("border") |
- // frame.equalsIgnoreCase("box")) top=right=bottom=left=true;
- } else if (frame.equalsIgnoreCase("below")) {
- bottom = true;
- } else if (frame.equalsIgnoreCase("hsides")) {
- top = true;
- bottom = true;
- } else if (frame.equalsIgnoreCase("lhs")) {
- left = true;
- } else if (frame.equalsIgnoreCase("rhs")) {
- right = true;
- } else if (frame.equalsIgnoreCase("vsides")) {
- right = true;
- left = true;
- } else {
- top = true;
- right = true;
- bottom = true;
- left = true;
- }
- stringBuffer.append("; border-width:");
- if (top) {
- stringBuffer.append(" ").append(border).append(" ");
- } else {
- stringBuffer.append(" 0px ");
- }
- if (right) {
- stringBuffer.append(" ").append(border).append(" ");
- } else {
- stringBuffer.append(" 0px ");
- }
- if (bottom) {
- stringBuffer.append(" ").append(border).append(" ");
- } else {
- stringBuffer.append(" 0px ");
- }
- if (left) {
- stringBuffer.append(" ").append(border).append(" ");
- } else {
- stringBuffer.append(" 0px ");
- }
- stringBuffer.append(";");
- return stringBuffer.toString();
- }
+ public Object next() {
+ // TODO reset rows and columns classes counters
+ current++;
+ return getComponent();
+ }
- /**
- * Gets background-color style.
- *
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- * @return background-color style
- */
- public final String bgcolor(final FacesContext context,
- final UIComponent component) {
- String bgcolor = (String) component.getAttributes().get("bgcolor");
- if (bgcolor != null) {
- return "background-color: " + bgcolor + ";";
- }
- return ";";
- }
+ public void remove() {
+ throw new UnsupportedOperationException(
+ "remove row from UIData not supported");
+ }
- /**
- * Gets cellpadding style.
- *
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- * @return cellpadding style
- */
- public final String cellPadding(final FacesContext context,
- final UIComponent component) {
- UISuggestionBox box = (UISuggestionBox) component;
- String cp = box.getCellpadding();
- if (cp != null) {
- return "padding: " + getUtils().encodePctOrPx(cp) + ";";
- }
- return ";";
- }
+ };
+ } else if ("rowClass".equals(key)) {
+ // Build row class string from entryClass and row classes
+ StringBuffer rowClass = new StringBuffer();
+ if (null != entryClass) {
+ rowClass.append(entryClass);
+ if (rowClasses.length > 0) {
+ rowClass.append(" ");
+ }
+ }
+ if (rowClasses.length > 0) {
+ int currentClass = (current - first - 1)
+ % rowClasses.length;
+ if (currentClass < 0) {
+ currentClass = 0;
+ }
+ rowClass.append(rowClasses[currentClass]);
+ }
+ // for iterate over columns
+ return rowClass.toString();
+ } else if ("columns".equals(key)) {
+ // for iterate over columns
+ return columns;
+ } else if ("columnsCount".equals(key)) {
+ return new Integer(columns.size());
+ } else {
+ return super.getParameter(key);
+ }
+ }
+ }
- /**
- * Gets border size
- *
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- * @return border size if set, 0 if none
- */
- public final String getBorder(final FacesContext context,
- final UIComponent component) {
+ /**
+ * Gets opacity style.
+ *
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @return style
+ */
+ public final String opacityStyle(final FacesContext context,
+ final UIComponent component) {
+ String opacity = (String) component.getAttributes()
+ .get("shadowOpacity");
+ String filterOpacity;
- String border = (String) component.getAttributes().get("border");
- if (border == null || border.length() == 0) {
- return "0";
- }
-
- return border;
- }
+ if (null == opacity) {
+ Skin skin = SkinFactory.getInstance().getSkin(context);
+ opacity = (String) skin.getParameter(context, "shadowOpacity");
+ }
+ try {
+ Double op = Double.valueOf(opacity);
+ filterOpacity = Integer.toString(op.intValue() * 10);
+ opacity = Double.toString(op.doubleValue() / 10);
+ } catch (Exception e) {
+ // illegal opacity
+ return ";";
+ }
+ return "opacity:" + opacity + "; filter:alpha(opacity=" + filterOpacity
+ + ");";
+ }
-
- /**
- * Gets context identifier.
- *
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- * @return context identifier
- */
- public final String getContentId(final FacesContext context,
- final UIComponent component) {
- return component.getClientId(context)
- + NamingContainer.SEPARATOR_CHAR + "suggest";
- }
+ /**
+ * Gets border style.
+ *
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @return style
+ */
+ public final String border(final FacesContext context,
+ final UIComponent component) {
- /**
- * Gets overflow sizes.
- *
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- * @return overflow style
- */
- public final String overflowSize(final FacesContext context,
- final UIComponent component) {
- StringBuffer style = new StringBuffer();
+ String border = (String) component.getAttributes().get("border");
- style.append(getSizeForStyle(component, "width", null, true));
- style.append(getSizeForStyle(component, "height", null, true));
+ String frame = (String) component.getAttributes().get("frame");
+ if (null == frame) {
+ frame = "box";
+ }
+ StringBuffer stringBuffer = new StringBuffer();
- return style.toString();
- }
+ if (null != border && Pattern.matches("\\d*", border)) {
+ border += "px";
+ }
- /**
- * Gets shadow style.
- *
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- * @return shadow style
- */
- public final String shadowDepth(final FacesContext context,
- final UIComponent component) {
- String shadow = (String) component.getAttributes().get("shadowDepth");
- if (shadow == null) {
- shadow = Integer.toString(SHADOW_DEPTH);
- }
+ boolean top = false, right = false, bottom = false, left = false;
+ if (frame.equalsIgnoreCase("above")) {
+ top = true;
+ // else if (frame.equalsIgnoreCase("border") |
+ // frame.equalsIgnoreCase("box")) top=right=bottom=left=true;
+ } else if (frame.equalsIgnoreCase("below")) {
+ bottom = true;
+ } else if (frame.equalsIgnoreCase("hsides")) {
+ top = true;
+ bottom = true;
+ } else if (frame.equalsIgnoreCase("lhs")) {
+ left = true;
+ } else if (frame.equalsIgnoreCase("rhs")) {
+ right = true;
+ } else if (frame.equalsIgnoreCase("vsides")) {
+ right = true;
+ left = true;
+ } else {
+ top = true;
+ right = true;
+ bottom = true;
+ left = true;
+ }
+ stringBuffer.append("; border-width:");
+ if (top) {
+ stringBuffer.append(" ").append(border).append(" ");
+ } else {
+ stringBuffer.append(" 0px ");
+ }
+ if (right) {
+ stringBuffer.append(" ").append(border).append(" ");
+ } else {
+ stringBuffer.append(" 0px ");
+ }
+ if (bottom) {
+ stringBuffer.append(" ").append(border).append(" ");
+ } else {
+ stringBuffer.append(" 0px ");
+ }
+ if (left) {
+ stringBuffer.append(" ").append(border).append(" ");
+ } else {
+ stringBuffer.append(" 0px ");
+ }
+ stringBuffer.append(";");
+ return stringBuffer.toString();
+ }
- return "top: " + shadow + "px; left: " + shadow +"px; ";
- }
+ /**
+ * Gets background-color style.
+ *
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @return background-color style
+ */
+ public final String bgcolor(final FacesContext context,
+ final UIComponent component) {
+ String bgcolor = (String) component.getAttributes().get("bgcolor");
+ if (bgcolor != null) {
+ return "background-color: " + bgcolor + ";";
+ }
+ return ";";
+ }
- /**
- * Gets additional scripts.
- *
- * @return array of resources
- * {@link org.ajax4jsf.framework.resource.InternetResource}
- */
- protected final InternetResource[] getAdditionalScripts() {
- return additionalScripts;
- }
+ /**
+ * Gets cellpadding style.
+ *
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @return cellpadding style
+ */
+ public final String cellPadding(final FacesContext context,
+ final UIComponent component) {
+ UISuggestionBox box = (UISuggestionBox) component;
+ String cp = box.getCellpadding();
+ if (cp != null) {
+ return "padding: " + getUtils().encodePctOrPx(cp) + ";";
+ }
+ return ";";
+ }
- /**
- * Gets styles.
- *
- * @return array of styles
- * {@link org.ajax4jsf.framework.resource.InternetResource}
- */
- protected final InternetResource[] getStyles() {
- return styles;
- }
+ /**
+ * Gets border size
+ *
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @return border size if set, 0 if none
+ */
+ public final String getBorder(final FacesContext context,
+ final UIComponent component) {
- /**
- * Gets style for width & height.
- * @param component {@link javax.faces.component.UIComponent}
- * @param attr attribute
- * @param def default value
- * @param isShadow TRUE if shadow exists
- * @return style
- */
- private String getSizeForStyle(final UIComponent component,
- final String attr,
- final String def,
- final boolean isShadow) {
- Map attributes = component.getAttributes();
- StringBuffer style = new StringBuffer();
+ String border = (String) component.getAttributes().get("border");
+ if (border == null || border.length() == 0) {
+ return "0";
+ }
- String attribute = (String) attributes.get(attr);
- if (attribute == null && def != null) {
- attribute = def;
- }
+ return border;
+ }
- if (attribute != null && (!attribute.equals(""))) {
- if (isShadow) {
- attribute = String.valueOf(Integer.parseInt(attribute)
- - SHADOW_DEPTH);
- }
+ /**
+ * Gets context identifier.
+ *
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @return context identifier
+ */
+ public final String getContentId(final FacesContext context,
+ final UIComponent component) {
+ return component.getClientId(context) + NamingContainer.SEPARATOR_CHAR
+ + "suggest";
+ }
- style.append(attr).append(":").append(attribute);
- if (Pattern.matches("\\d*", attribute)) {
- style.append("px");
- }
- style.append(";");
- }
+ /**
+ * Gets overflow sizes.
+ *
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @return overflow style
+ */
+ public final String overflowSize(final FacesContext context,
+ final UIComponent component) {
+ StringBuffer style = new StringBuffer();
- return style.toString();
- }
-
- public void insertNothingLabel(final FacesContext context,
- final UIComponent component) throws IOException {
- ResponseWriter writer = context.getResponseWriter();
- UISuggestionBox suggestionBox = (UISuggestionBox)component;
- final String startHtml =
- "<tr id=\"" + suggestionBox.getClientId(context) + "NothingLabel\" class=\"dr-sb-int rich-sb-int " + suggestionBox.getRowClasses() +
- "\" style=\"display: none;\">" +
- "<td nowrap=\"nowrap\" class=\"dr-sb-cell-padding rich-sb-cell-padding\" style=\"" + this.cellPadding(context, component) + "\">";
- final String endHtml = "</td></tr>";
-
- UIComponent nothingLabelFacet = component.getFacet("nothingLabel");
- if(null != nothingLabelFacet && nothingLabelFacet.isRendered()) {
- writer.write(startHtml);
- renderChild(context, nothingLabelFacet);
- writer.write(endHtml);
- }
- else if (null != suggestionBox.getNothingLabel() &&
- !"".equals(suggestionBox.getNothingLabel())) {
- writer.write(startHtml);
- writer.write(suggestionBox.getNothingLabel());
- writer.write(endHtml);
- }
-
- }
-
- /**
- * Gets 'class' attribute for suggestion entry.
- *
- * @param context {@link javax.faces.context.FacesContext}
- * @param component {@link javax.faces.component.UIComponent}
- * @return 'class' attribute for 'tr' element of suggestion entry.
- */
- public final String getEntryClass(final FacesContext context,
- final UIComponent component) {
- String entryClass = (String) component.getAttributes().get("entryClass");
- if (null == entryClass)
- entryClass = "";
- String rowClass = (String) component.getAttributes().get("rowClasses");
- if (null == rowClass)
- rowClass = "";
-
- return "dr-sb-int rich-sb-int " + entryClass + " " + rowClass;
- }
+ style.append(getSizeForStyle(component, "width", null, true));
+ style.append(getSizeForStyle(component, "height", null, true));
+
+ return style.toString();
+ }
+
+ /**
+ * Gets shadow style.
+ *
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @return shadow style
+ */
+ public final String shadowDepth(final FacesContext context,
+ final UIComponent component) {
+ String shadow = (String) component.getAttributes().get("shadowDepth");
+ if (shadow == null) {
+ shadow = Integer.toString(SHADOW_DEPTH);
+ }
+
+ return "top: " + shadow + "px; left: " + shadow + "px; ";
+ }
+
+ /**
+ * Gets additional scripts.
+ *
+ * @return array of resources
+ * {@link org.ajax4jsf.framework.resource.InternetResource}
+ */
+ protected final InternetResource[] getAdditionalScripts() {
+ return additionalScripts;
+ }
+
+ /**
+ * Gets styles.
+ *
+ * @return array of styles
+ * {@link org.ajax4jsf.framework.resource.InternetResource}
+ */
+ protected final InternetResource[] getStyles() {
+ return styles;
+ }
+
+ /**
+ * Gets style for width & height.
+ *
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @param attr
+ * attribute
+ * @param def
+ * default value
+ * @param isShadow
+ * TRUE if shadow exists
+ * @return style
+ */
+ private String getSizeForStyle(final UIComponent component,
+ final String attr, final String def, final boolean isShadow) {
+ Map attributes = component.getAttributes();
+ StringBuffer style = new StringBuffer();
+
+ String attribute = (String) attributes.get(attr);
+ if (attribute == null && def != null) {
+ attribute = def;
+ }
+
+ if (attribute != null && (!attribute.equals(""))) {
+ if (isShadow) {
+ attribute = String.valueOf(Integer.parseInt(attribute)
+ - SHADOW_DEPTH);
+ }
+
+ style.append(attr).append(":").append(attribute);
+ if (Pattern.matches("\\d*", attribute)) {
+ style.append("px");
+ }
+ style.append(";");
+ }
+
+ return style.toString();
+ }
+
+ public void insertNothingLabel(final FacesContext context,
+ final UIComponent component) throws IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ UISuggestionBox suggestionBox = (UISuggestionBox) component;
+ final String startHtml = "<tr id=\""
+ + suggestionBox.getClientId(context)
+ + "NothingLabel\" class=\"dr-sb-int rich-sb-int "
+ + suggestionBox.getRowClasses()
+ + "\" style=\"display: none;\">"
+ + "<td nowrap=\"nowrap\" class=\"dr-sb-cell-padding rich-sb-cell-padding\" style=\""
+ + this.cellPadding(context, component) + "\">";
+ final String endHtml = "</td></tr>";
+
+ UIComponent nothingLabelFacet = component.getFacet("nothingLabel");
+ if (null != nothingLabelFacet && nothingLabelFacet.isRendered()) {
+ writer.write(startHtml);
+ renderChild(context, nothingLabelFacet);
+ writer.write(endHtml);
+ } else if (null != suggestionBox.getNothingLabel()
+ && !"".equals(suggestionBox.getNothingLabel())) {
+ writer.write(startHtml);
+ writer.write(suggestionBox.getNothingLabel());
+ writer.write(endHtml);
+ }
+
+ }
+
+ /**
+ * Gets 'class' attribute for suggestion entry.
+ *
+ * @param context
+ * {@link javax.faces.context.FacesContext}
+ * @param component
+ * {@link javax.faces.component.UIComponent}
+ * @return 'class' attribute for 'tr' element of suggestion entry.
+ */
+ public final String getEntryClass(final FacesContext context,
+ final UIComponent component) {
+ String entryClass = (String) component.getAttributes()
+ .get("entryClass");
+ if (null == entryClass)
+ entryClass = "";
+ String rowClass = (String) component.getAttributes().get("rowClasses");
+ if (null == rowClass)
+ rowClass = "";
+
+ return "dr-sb-int rich-sb-int " + entryClass + " " + rowClass;
+ }
}
16 years, 10 months