JBoss Rich Faces SVN: r18183 - root/ui-sandbox.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-07-21 12:47:21 -0400 (Wed, 21 Jul 2010)
New Revision: 18183
Modified:
root/ui-sandbox/pom.xml
Log:
add inputnumberslider project
Modified: root/ui-sandbox/pom.xml
===================================================================
--- root/ui-sandbox/pom.xml 2010-07-21 16:47:04 UTC (rev 18182)
+++ root/ui-sandbox/pom.xml 2010-07-21 16:47:21 UTC (rev 18183)
@@ -36,5 +36,6 @@
<name>Richfaces UI Components Sandbox Aggregator</name>
<modules>
+ <module>inputs/trunk</module>
</modules>
-</project>
\ No newline at end of file
+</project>
15 years, 2 months
JBoss Rich Faces SVN: r18182 - root/ui-sandbox/inputs/trunk.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-07-21 12:47:04 -0400 (Wed, 21 Jul 2010)
New Revision: 18182
Modified:
root/ui-sandbox/inputs/trunk/pom.xml
Log:
add inputnumberslider project
Modified: root/ui-sandbox/inputs/trunk/pom.xml
===================================================================
--- root/ui-sandbox/inputs/trunk/pom.xml 2010-07-21 16:45:44 UTC (rev 18181)
+++ root/ui-sandbox/inputs/trunk/pom.xml 2010-07-21 16:47:04 UTC (rev 18182)
@@ -37,6 +37,7 @@
<modules>
<module>parent</module>
<module>combobox</module>
+ <module>inputnumberslider</module>
</modules>
<scm>
@@ -44,4 +45,4 @@
<developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/ui-sandbox/inputs/trunk</developerConnection>
<url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
-</project>
\ No newline at end of file
+</project>
15 years, 2 months
JBoss Rich Faces SVN: r18181 - in root/ui-sandbox/inputs/trunk/inputnumberslider: src and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-07-21 12:45:44 -0400 (Wed, 21 Jul 2010)
New Revision: 18181
Added:
root/ui-sandbox/inputs/trunk/inputnumberslider/pom.xml
root/ui-sandbox/inputs/trunk/inputnumberslider/src/
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/config/
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/config/faces-config.xml
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/java/
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/bg.gif
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/bg_field.gif
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/handler.gif
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.ecss
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/templates/
root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/templates/inputnumberslider.template.xml
Modified:
root/ui-sandbox/inputs/trunk/inputnumberslider/
Log:
add inputnumberslider project
Property changes on: root/ui-sandbox/inputs/trunk/inputnumberslider
___________________________________________________________________
Name: svn:ignore
+ .settings
target
.classpath
.project
Added: root/ui-sandbox/inputs/trunk/inputnumberslider/pom.xml
===================================================================
--- root/ui-sandbox/inputs/trunk/inputnumberslider/pom.xml (rev 0)
+++ root/ui-sandbox/inputs/trunk/inputnumberslider/pom.xml 2010-07-21 16:45:44 UTC (rev 18181)
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.richfaces.ui.inputs-sandbox</groupId>
+ <artifactId>richfaces-ui-inputs-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.ui.inputs-sandbox</groupId>
+ <artifactId>inputnumberslider</artifactId>
+ <name>Richfaces UI Sandbox Components: InputNumberSlider Component</name>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
+ <!--TODO: remove this dependency it should inherited from perent poms-->
+ <scope>provided</scope>
+ </dependency>
+ <!--dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>provided</scope>
+ </dependency-->
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <!--dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-test-stage</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>htmlunit-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-mock</artifactId>
+ <scope>test</scope>
+ </dependency-->
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:https://svn.jboss.org/repos/richfaces/root/ui-sandbox/inputs/trun...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/ui-sandbox/inputs/trun...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+</project>
Added: root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/config/faces-config.xml
===================================================================
--- root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/config/faces-config.xml (rev 0)
+++ root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/config/faces-config.xml 2010-07-21 16:45:44 UTC (rev 18181)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<faces-config version="2.0"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://richfaces.org/cdk/extensions"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <component>
+ <component-type>org.richfaces.InputNumberSlider</component-type>
+ <component-class>org.richfaces.component.HTMLInputNumberSlider</component-class>
+ <component-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:base-class>javax.faces.component.UIInput</cdk:base-class>
+ <cdk:component-family>javax.faces.Input</cdk:component-family>
+ <cdk:renderer-id>org.richfaces.InputNumberSliderRenderer</cdk:renderer-id>
+ <cdk:tag>
+ <cdk:name>inputnumberslider</cdk:name>
+ <cdk:type>Facelets</cdk:type>
+ </cdk:tag>
+ </component-extension>
+ </component>
+ <faces-config-extension>
+ <cdk:taglib>
+ <cdk:shortName>ins</cdk:shortName>
+ <cdk:uri>http://richfaces.org/inputnumberslider</cdk:uri>
+ </cdk:taglib>
+ </faces-config-extension>
+</faces-config>
Added: root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/bg.gif
===================================================================
(Binary files differ)
Property changes on: root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/bg_field.gif
===================================================================
(Binary files differ)
Property changes on: root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/bg_field.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/handler.gif
===================================================================
(Binary files differ)
Property changes on: root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/handler.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.ecss
===================================================================
--- root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.ecss (rev 0)
+++ root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.ecss 2010-07-21 16:45:44 UTC (rev 18181)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+.sldr_size {
+ display: inline-block;
+ width: 200px;
+}
+
+.sldr_min {
+ display: block;
+ font-size: 11px;
+ border-left: 1px solid #c0c0c0;
+ padding-left: 3px;
+ font-family: arial;
+ font-size: 11px;
+ color: #000000;
+ float: left;
+ margin-bottom: 3px;
+}
+
+.sldr_max {
+ display: block;
+ font-size: 11px;
+ top: 0px;
+ right: -2px;
+ border-right: 1px solid #c0c0c0;
+ padding-right: 3px;
+ font-family: arial;
+ font-size: 11px;
+ color: #000000;
+ float: right;
+ margin-bottom: 3px;
+}
+
+.sldr_track {
+ background: url("#{resource['bg.gif']}") 1px 1px repeat-x #FFFFFF;
+ border: 1px solid #C0C0C0;
+ display: block;
+ font-size: 1px;
+ height: 6px;
+ clear: both;
+}
+
+.sldr_handler {
+ position: relative;
+ top: -1px;
+ left: 120px;
+}
+
+.sldr_field {
+ background: url("#{resource['bg_field.gif']}") top repeat-x #fff;
+ font-family: arial;
+ font-size: 11px;
+ color: #000000;
+ border: 1px inset #C0C0C0;
+ margin: 0px 10px 0px 10px;
+}
\ No newline at end of file
Property changes on: root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.ecss
___________________________________________________________________
Name: svn:executable
+ *
Added: root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/templates/inputnumberslider.template.xml
===================================================================
--- root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/templates/inputnumberslider.template.xml (rev 0)
+++ root/ui-sandbox/inputs/trunk/inputnumberslider/src/main/templates/inputnumberslider.template.xml 2010-07-21 16:45:44 UTC (rev 18181)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<cdk:root xmlns="http://richfaces.org/cdk/xhtml-el" xmlns:cdk="http://richfaces.org/cdk/core"
+ xmlns:cc="http://richfaces.org/cdk/jsf/composite">
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.InputNumberSliderRenderer</cdk:class>
+ <cdk:superclass>javax.faces.render.Renderer</cdk:superclass>
+ <cdk:component-family>javax.faces.Input</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.InputNumberSliderRenderer</cdk:renderer-type>
+ <cdk:resource-dependency name="inputNumberSlider.ecss" />
+ </cc:interface>
+ <cc:implementation>
+ <span id="#{clientId}" class="rf-ins">
+ <span class="sldr_size">
+ <span class="sldr_min">10</span>
+ <span class="sldr_max">100</span>
+ <span class="sldr_track">
+ <img src="#{facesContext.application.resourceHandler.createResource('handler.gif').requestPath}"
+ width="7" height="8" alt="" border="0" class="sldr_handler" />
+ </span>
+ </span>
+ <input class="sldr_field" size="3" value="10" type="text" />
+ </span>
+ </cc:implementation>
+</cdk:root>
15 years, 2 months
JBoss Rich Faces SVN: r18179 - in root/core/trunk/impl/src/main: resources/META-INF and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-21 10:43:04 -0400 (Wed, 21 Jul 2010)
New Revision: 18179
Added:
root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinPropertiesELResolver.java
Removed:
root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinPropertyResolver.java
root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinVariableResolver.java
Modified:
root/core/trunk/impl/src/main/resources/META-INF/faces-config.xml
Log:
Legacy skin EL-related classes updated
Added: root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinPropertiesELResolver.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinPropertiesELResolver.java (rev 0)
+++ root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinPropertiesELResolver.java 2010-07-21 14:43:04 UTC (rev 18179)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.skin;
+
+import java.beans.FeatureDescriptor;
+import java.util.Iterator;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.el.PropertyNotFoundException;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class SkinPropertiesELResolver extends ELResolver {
+
+ @Override
+ public Object getValue(ELContext context, Object base, Object property) {
+ if (base instanceof Skin) {
+ Skin skin = (Skin) base;
+
+ if (property == null) {
+ throw new PropertyNotFoundException("property name is null");
+ }
+
+ context.setPropertyResolved(true);
+ FacesContext facesContext = (FacesContext) context.getContext(FacesContext.class);
+ return skin.getParameter(facesContext, property.toString());
+ }
+
+ return null;
+ }
+
+ @Override
+ public Class<?> getType(ELContext context, Object base, Object property) {
+ return null;
+ }
+
+ @Override
+ public void setValue(ELContext context, Object base, Object property, Object value) {
+ if (base instanceof Skin) {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ @Override
+ public boolean isReadOnly(ELContext context, Object base, Object property) {
+ return true;
+ }
+
+ @Override
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
+ return null;
+ }
+
+ @Override
+ public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ return Object.class;
+ }
+
+}
Deleted: root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinPropertyResolver.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinPropertyResolver.java 2010-07-21 14:40:56 UTC (rev 18178)
+++ root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinPropertyResolver.java 2010-07-21 14:43:04 UTC (rev 18179)
@@ -1,180 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.skin;
-
-import org.ajax4jsf.Messages;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-
-import javax.faces.context.FacesContext;
-import javax.faces.el.EvaluationException;
-import javax.faces.el.PropertyResolver;
-
-/**
- * Resolve Skin propertyes.
- *
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:41 $
- */
-public class SkinPropertyResolver extends PropertyResolver {
- private static final Logger LOG = RichfacesLogger.APPLICATION.getLogger();
- private PropertyResolver parent = null;
-
- /**
- * @param parent
- */
- public SkinPropertyResolver(PropertyResolver parent) {
- this.parent = parent;
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#getType(java.lang.Object, int)
- */
- @Override
- public Class getType(Object base, int index) {
- if (base instanceof Skin) {
- if (LOG.isDebugEnabled()) {
- LOG.debug(Messages.getMessage(Messages.ACESSING_SKIN_PROPERTY_AS_ARRAY_ERROR));
- }
-
- return null;
- }
-
- return parent.getType(base, index);
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#getType(java.lang.Object, java.lang.Object)
- */
- @Override
- public Class getType(Object base, Object property) {
- if (base instanceof Skin) {
- Skin skin = (Skin) base;
-
- if (property instanceof String) {
- return skin.getParameter(FacesContext.getCurrentInstance(), (String) property).getClass();
- }
-
- if (LOG.isDebugEnabled()) {
- LOG.debug(Messages.getMessage(Messages.ACESSING_SKIN_PROPERTY_ERROR));
- }
-
- return null;
- }
-
- return parent.getType(base, property);
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#getValue(java.lang.Object, int)
- */
- @Override
- public Object getValue(Object base, int index) {
- if (base instanceof Skin) {
- if (LOG.isDebugEnabled()) {
- LOG.debug(Messages.getMessage(Messages.ACESSING_SKIN_PROPERTY_AS_ARRAY_ERROR));
- }
-
- return null;
- }
-
- return parent.getValue(base, index);
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#getValue(java.lang.Object, java.lang.Object)
- */
- @Override
- public Object getValue(Object base, Object property) {
- if (base instanceof Skin) {
- Skin skin = (Skin) base;
-
- if (property instanceof String) {
- return skin.getParameter(FacesContext.getCurrentInstance(), (String) property);
- }
-
- if (LOG.isDebugEnabled()) {
- LOG.debug(Messages.getMessage(Messages.ACESSING_SKIN_PROPERTY_ERROR));
- }
-
- return null;
- }
-
- return parent.getValue(base, property);
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#isReadOnly(java.lang.Object, int)
- */
- @Override
- public boolean isReadOnly(Object base, int arg1) {
- if (base instanceof Skin) {
- return true;
- }
-
- return parent.isReadOnly(base, arg1);
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#isReadOnly(java.lang.Object, java.lang.Object)
- */
- @Override
- public boolean isReadOnly(Object base, Object arg1) {
- if (base instanceof Skin) {
- return true;
- }
-
- return parent.isReadOnly(base, arg1);
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#setValue(java.lang.Object, int, java.lang.Object)
- */
- @Override
- public void setValue(Object base, int index, Object value) {
- if (base instanceof Skin) {
- throw new EvaluationException(Messages.getMessage(Messages.SKIN_PROPERTIES_READ_ONLY_ERROR));
- }
-
- parent.setValue(base, index, value);
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#setValue(java.lang.Object, java.lang.Object, java.lang.Object)
- */
- @Override
- public void setValue(Object base, Object property, Object value) {
- if (base instanceof Skin) {
- throw new EvaluationException(Messages.getMessage(Messages.SKIN_PROPERTIES_READ_ONLY_ERROR));
- }
-
- parent.setValue(base, property, value);
- }
-}
Deleted: root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinVariableResolver.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinVariableResolver.java 2010-07-21 14:40:56 UTC (rev 18178)
+++ root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinVariableResolver.java 2010-07-21 14:43:04 UTC (rev 18179)
@@ -1,65 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.skin;
-
-import org.richfaces.VersionBean;
-
-import javax.faces.context.FacesContext;
-import javax.faces.el.EvaluationException;
-import javax.faces.el.VariableResolver;
-
-/**
- * Resolve current skin as EL Variable. e.g. #{chameleonSkin['color'] } #{chameleonSkin.color}
- * must be evaluated as Skin.getProperty(context,"color");
- *
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:41 $
- */
-public class SkinVariableResolver extends VariableResolver {
- public static final String CHAMELEON_VARIABLE_NAME = "vcp";
- public static final String SKIN_VARIABLE_NAME = "vcpSkin";
- private VariableResolver parent = null;
-
- public SkinVariableResolver(VariableResolver parent) {
- this.parent = parent;
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.el.VariableResolver#resolveVariable(javax.faces.context.FacesContext, java.lang.String)
- */
- public Object resolveVariable(FacesContext context, String name) throws EvaluationException {
-
- // TODO: Why do we need this?
- if (SKIN_VARIABLE_NAME.equals(name)) {
- return SkinFactory.getInstance().getSkin(context);
- } else if (CHAMELEON_VARIABLE_NAME.equals(name)) {
- return new VersionBean();
- }
-
- if (parent != null) {
- return parent.resolveVariable(context, name);
- } else {
- return null;
- }
- }
-}
Modified: root/core/trunk/impl/src/main/resources/META-INF/faces-config.xml
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/faces-config.xml 2010-07-21 14:40:56 UTC (rev 18178)
+++ root/core/trunk/impl/src/main/resources/META-INF/faces-config.xml 2010-07-21 14:43:04 UTC (rev 18179)
@@ -15,11 +15,10 @@
<source-class>org.ajax4jsf.component.UIDataAdaptor</source-class>
</system-event-listener -->
<!--
- <variable-resolver>org.richfaces.skin.SkinVariableResolver</variable-resolver>
- <property-resolver>org.richfaces.skin.SkinPropertyResolver</property-resolver>
<view-handler>org.ajax4jsf.application.AjaxViewHandler</view-handler>
-->
<!-- state-manager>org.ajax4jsf.application.AjaxStateManager</state-manager -->
+ <el-resolver>org.richfaces.skin.SkinPropertiesELResolver</el-resolver>
</application>
<!-- lifecycle>
<phase-listener>org.ajax4jsf.event.AjaxPhaseListener</phase-listener>
15 years, 2 months
JBoss Rich Faces SVN: r18178 - root/core/trunk/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-07-21 10:40:56 -0400 (Wed, 21 Jul 2010)
New Revision: 18178
Modified:
root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
Log:
Modified: root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-07-21 14:10:47 UTC (rev 18177)
+++ root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-07-21 14:40:56 UTC (rev 18178)
@@ -222,7 +222,7 @@
source = source || this.id;
var element = richfaces.getDomElement(source);
element && element.richfaces && (element.richfaces.component=null);
- }
+ },
/**
* Destroy method. Will be called before remove component from the page
@@ -232,7 +232,7 @@
*
* */
destroy: function() {
- detach();
+ this.detach();
}
};
})(params));
15 years, 2 months
JBoss Rich Faces SVN: r18177 - in root/core/trunk: api/src/main/java/org/richfaces/skin and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-21 10:10:47 -0400 (Wed, 21 Jul 2010)
New Revision: 18177
Modified:
root/core/trunk/api/src/main/java/org/ajax4jsf/Messages.java
root/core/trunk/api/src/main/java/org/richfaces/skin/Skin.java
root/core/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java
root/core/trunk/impl/src/main/java/org/richfaces/skin/BasicSkinImpl.java
root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinBean.java
root/core/trunk/impl/src/main/resources/org/ajax4jsf/messages.properties
root/core/trunk/impl/src/test/java/org/richfaces/skin/SkinTestCase.java
root/core/trunk/impl/src/test/resources/bindedtest.skin.properties
Log:
Removed renderkit parameter handling from skins
Modified: root/core/trunk/api/src/main/java/org/ajax4jsf/Messages.java
===================================================================
--- root/core/trunk/api/src/main/java/org/ajax4jsf/Messages.java 2010-07-21 13:35:53 UTC (rev 18176)
+++ root/core/trunk/api/src/main/java/org/ajax4jsf/Messages.java 2010-07-21 14:10:47 UTC (rev 18177)
@@ -110,7 +110,6 @@
public static final String ENCODING_TEMPLATE_TERMINATED_INFO = "ENCODING_TEMPLATE_TERMINATED_INFO";
public static final String END_DOCUMENT_SAX_EXCEPTION = "END_DOCUMENT_SAX_EXCEPTION";
public static final String END_ELEMENT_SAX_EXCEPTION = "END_ELEMENT_SAX_EXCEPTION";
- public static final String ENTER_BEFORE_RENDER_VIEW_PHASE = "ENTER_BEFORE_RENDER_VIEW_PHASE";
public static final String ERROR_ON_PAGE = "ERROR_ON_PAGE";
public static final String EVENT_IS_READ_ONLY = "EVENT_IS_READ_ONLY";
public static final String EVENT_MUST_BE_LITERAL = "EVENT_MUST_BE_LITERAL";
@@ -253,7 +252,6 @@
public static final String SET_AJAX_LISTENER = "SET_AJAX_LISTENER";
public static final String SET_AJAX_REQUEST = "SET_AJAX_REQUEST";
public static final String SET_MYFACES_SEQUENCE_INFO = "SET_MYFACES_SEQUENCE_INFO";
- public static final String SET_RENDER_KIT_ID_INFO = "SET_RENDER_KIT_ID_INFO";
public static final String SET_RESPONSE_HEADERS_INFO = "SET_RESPONSE_HEADERS_INFO";
public static final String SET_SKIN_FACTORY_INFO = "SET_SKIN_FACTORY_INFO";
public static final String SET_VALUE_BINDING_FOR_EVENT = "SET_VALUE_BINDING_FOR_EVENT";
Modified: root/core/trunk/api/src/main/java/org/richfaces/skin/Skin.java
===================================================================
--- root/core/trunk/api/src/main/java/org/richfaces/skin/Skin.java 2010-07-21 13:35:53 UTC (rev 18176)
+++ root/core/trunk/api/src/main/java/org/richfaces/skin/Skin.java 2010-07-21 14:10:47 UTC (rev 18177)
@@ -253,16 +253,6 @@
public static final String TAB_WEIGHT_FONT = "tabWeightFont";
/**
- * Get Rener Kit name for this skin.
- *
- * @param context -
- * {@link FacesContext } for current request. need for
- * {@link javax.faces.el.ValueBinding} evaluation.
- * @return RenderKitId for this skin, or <code>null</code> for default.
- */
- public String getRenderKitId(FacesContext context);
-
- /**
* Get value for configuration parameter. If parameter set as EL-expression,
* calculate it value.
*
Modified: root/core/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java 2010-07-21 13:35:53 UTC (rev 18176)
+++ root/core/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java 2010-07-21 14:10:47 UTC (rev 18177)
@@ -21,19 +21,18 @@
package org.ajax4jsf.event;
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.context.AjaxContext;
-import org.richfaces.log.RichfacesLogger;
-import org.richfaces.skin.SkinFactory;
-import org.slf4j.Logger;
+import java.util.Map;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
-import java.util.Map;
+import org.ajax4jsf.context.AjaxContext;
+import org.richfaces.log.RichfacesLogger;
+import org.slf4j.Logger;
+
/**
* Listener for act before Render phase to set RenderKit Id for current skin.
*
@@ -99,27 +98,6 @@
// Clear ViewId replacement, to avoid incorrect rendering of forms
// URI.
AjaxContext.getCurrentInstance(context).setViewIdHolder(null);
-
- UIViewRoot root = context.getViewRoot();
-
- if (null != root) {
- LOG.debug(Messages.getMessage(Messages.ENTER_BEFORE_RENDER_VIEW_PHASE, root.getViewId(),
- root.getRenderKitId()));
-
- // TODO - create special skin-config.xml configuration.
- String renderKitId = null;
-
- try {
- renderKitId = SkinFactory.getInstance().getSkin(context).getRenderKitId(context);
- } catch (Exception e) {
- LOG.error("Exception on get current Skin ", e);
- }
-
- if (null != renderKitId) {
- LOG.debug(Messages.getMessage(Messages.SET_RENDER_KIT_ID_INFO, renderKitId));
- root.setRenderKitId(renderKitId);
- }
- }
} else if (phaseId == PhaseId.RESTORE_VIEW) {
// TODO Refactoring
Modified: root/core/trunk/impl/src/main/java/org/richfaces/skin/BasicSkinImpl.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/skin/BasicSkinImpl.java 2010-07-21 13:35:53 UTC (rev 18176)
+++ root/core/trunk/impl/src/main/java/org/richfaces/skin/BasicSkinImpl.java 2010-07-21 14:10:47 UTC (rev 18177)
@@ -39,8 +39,6 @@
*/
public abstract class BasicSkinImpl implements Skin {
- public static final String RENDER_KIT_PARAMETER = "render.kit";
-
private int hashCode = 0;
private final Map<Object, Object> skinParams;
@@ -60,14 +58,6 @@
/*
* (non-Javadoc)
- * @see org.richfaces.skin.Skin#getRenderKitId(javax.faces.context.FacesContext)
- */
- public String getRenderKitId(FacesContext context) {
- return (String) getValueReference(context, resolveSkinParameter(context, RENDER_KIT_PARAMETER));
- }
-
- /*
- * (non-Javadoc)
* @see org.richfaces.skin.Skin#getParameter(javax.faces.context.FacesContext, java.lang.String)
*/
public Object getParameter(FacesContext context, String name) {
Modified: root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinBean.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinBean.java 2010-07-21 13:35:53 UTC (rev 18176)
+++ root/core/trunk/impl/src/main/java/org/richfaces/skin/SkinBean.java 2010-07-21 14:10:47 UTC (rev 18177)
@@ -109,14 +109,6 @@
/*
* (non-Javadoc)
- * @see org.richfaces.skin.Skin#getRenderKitId(javax.faces.context.FacesContext)
- */
- public String getRenderKitId(FacesContext context) {
- return getSkin().getRenderKitId(context);
- }
-
- /*
- * (non-Javadoc)
* @see org.richfaces.skin.Skin#getParameter(javax.faces.context.FacesContext, java.lang.String)
*/
public Object getParameter(FacesContext context, String name) {
Modified: root/core/trunk/impl/src/main/resources/org/ajax4jsf/messages.properties
===================================================================
--- root/core/trunk/impl/src/main/resources/org/ajax4jsf/messages.properties 2010-07-21 13:35:53 UTC (rev 18176)
+++ root/core/trunk/impl/src/main/resources/org/ajax4jsf/messages.properties 2010-07-21 14:10:47 UTC (rev 18177)
@@ -118,8 +118,6 @@
GET_DEFAULT_RENDER_KIT_ERROR=Error for get default render kit
DEFAULT_RENDER_KIT_INFO=Default render kit id for chameleon will: {0}
AJAX_RESPONSE_NOT_RENDERED_INFO=AJAX response not rendered - possible MyFaces <f:view tag behavior.
-ENTER_BEFORE_RENDER_VIEW_PHASE=PhaseListener enter Before RenderView Phase with ViewId {0} and RenderKitId {1}
-SET_RENDER_KIT_ID_INFO=PhaseListener Set new RenderKitId to {0}
PROCESS_AJAX_EVENTS_INFO=Process AJAX events to calculate areas.
DELEGATE_AJAX_PROCESSING_INFO=Delegate AJAX processing to container.
BREAKPOINTS_UNSUPPORTED_INSIDE_ATTRIBUTE_ERROR=Breakpoints inside attribute element not allowed, attribute name: {0} of component: {1}
Modified: root/core/trunk/impl/src/test/java/org/richfaces/skin/SkinTestCase.java
===================================================================
--- root/core/trunk/impl/src/test/java/org/richfaces/skin/SkinTestCase.java 2010-07-21 13:35:53 UTC (rev 18176)
+++ root/core/trunk/impl/src/test/java/org/richfaces/skin/SkinTestCase.java 2010-07-21 14:10:47 UTC (rev 18177)
@@ -237,7 +237,6 @@
// assertEquals("base.string",skin.getParameter(mockContext,"base.property"));
assertEquals("binded.test.value", skin.getParameter(facesContext, "bind.property"));
- assertEquals("TEST", skin.getRenderKitId(facesContext));
}
@SkinParameters(skinName = "#{test.skin}")
Modified: root/core/trunk/impl/src/test/resources/bindedtest.skin.properties
===================================================================
--- root/core/trunk/impl/src/test/resources/bindedtest.skin.properties 2010-07-21 13:35:53 UTC (rev 18176)
+++ root/core/trunk/impl/src/test/resources/bindedtest.skin.properties 2010-07-21 14:10:47 UTC (rev 18177)
@@ -1,4 +1,3 @@
-render.kit=TEST
string.property=bindedstring
int.property=10
bind.property=\#{test.bean}
15 years, 2 months
JBoss Rich Faces SVN: r18176 - root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-21 09:35:53 -0400 (Wed, 21 Jul 2010)
New Revision: 18176
Modified:
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.ecss
Log:
Styles for autocomplete updated
Modified: root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.ecss
===================================================================
--- root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.ecss 2010-07-21 13:32:16 UTC (rev 18175)
+++ root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.ecss 2010-07-21 13:35:53 UTC (rev 18176)
@@ -1,5 +1,5 @@
.cb_field_width {
- width: 200px;
+ width: 100px;
}
.cb_list_width {
@@ -63,9 +63,9 @@
.cb_list_cord {
position: absolute;
- font-size: 0px;
+ /* TODO nick - review: font-size: 0px; */
display: none;
-} /*DDL is hidden!!!!!*/
+}
.cb_list_decoration {
border-width: 1px;
15 years, 2 months
JBoss Rich Faces SVN: r18175 - in root: ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-21 09:32:16 -0400 (Wed, 21 Jul 2010)
New Revision: 18175
Modified:
root/examples-sandbox/trunk/components/combobox-demo/src/main/webapp/index.xhtml
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/component/AbstractComboBox.java
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/ComboBoxRendererBase.java
Log:
Added fetchValue draft support
Modified: root/examples-sandbox/trunk/components/combobox-demo/src/main/webapp/index.xhtml
===================================================================
--- root/examples-sandbox/trunk/components/combobox-demo/src/main/webapp/index.xhtml 2010-07-21 13:01:03 UTC (rev 18174)
+++ root/examples-sandbox/trunk/components/combobox-demo/src/main/webapp/index.xhtml 2010-07-21 13:32:16 UTC (rev 18175)
@@ -17,7 +17,7 @@
block text block text block text block text block text block text
block text block
- <combo:comboBox autocompleteMethod="#{testBean.autocomplete}" var="country">
+ <combo:comboBox autocompleteMethod="#{testBean.autocomplete}" var="country" fetchValue="#{country.name}">
#{country.name} #{country.iso} #{country.domain}
</combo:comboBox>
Modified: root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/component/AbstractComboBox.java
===================================================================
--- root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/component/AbstractComboBox.java 2010-07-21 13:01:03 UTC (rev 18174)
+++ root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/component/AbstractComboBox.java 2010-07-21 13:32:16 UTC (rev 18175)
@@ -68,6 +68,10 @@
@Attribute(literal = true)
public abstract String getVar();
+ //TODO nick - el-only?
+ @Attribute(literal = false)
+ public abstract Object getFetchValue();
+
public String resolveClientId(FacesContext facesContext, UIComponent contextComponent, String metaComponentId) {
if (ITEMS_META_COMPONENT_ID.equals(metaComponentId)) {
return getClientId(facesContext) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR + metaComponentId;
Modified: root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/ComboBoxRendererBase.java
===================================================================
--- root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/ComboBoxRendererBase.java 2010-07-21 13:01:03 UTC (rev 18174)
+++ root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/ComboBoxRendererBase.java 2010-07-21 13:32:16 UTC (rev 18175)
@@ -22,7 +22,9 @@
package org.richfaces.renderkit;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import javax.el.ELException;
@@ -35,10 +37,12 @@
import javax.faces.context.PartialViewContext;
import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.AbstractComboBox;
import org.richfaces.component.MetaComponentResolver;
+import com.google.common.base.Predicates;
import com.google.common.collect.Iterators;
/**
@@ -147,7 +151,7 @@
responseWriter.endElement(HTML.LI_ELEMENT);
}
- protected void encodeItems(FacesContext facesContext, UIComponent component) throws IOException {
+ protected void encodeItems(FacesContext facesContext, UIComponent component, List<Object> fetchValues) throws IOException {
AbstractComboBox comboBox = (AbstractComboBox) component;
encodeItemsContainerBegin(facesContext, component);
@@ -163,6 +167,7 @@
setVar(facesContext, comboBox.getVar(), nextItem);
encodeItem(facesContext, comboBox, nextItem);
+ fetchValues.add(comboBox.getFetchValue());
}
setVar(facesContext, comboBox.getVar(), savedVar);
@@ -211,10 +216,17 @@
throws IOException {
if (AbstractComboBox.ITEMS_META_COMPONENT_ID.equals(metaComponentId)) {
+ List<Object> fetchValues = new ArrayList<Object>();
+
PartialResponseWriter partialWriter = context.getPartialViewContext().getPartialResponseWriter();
partialWriter.startUpdate(getContainerElementId(context, component));
- encodeItems(context, component);
+ encodeItems(context, component, fetchValues);
partialWriter.endUpdate();
+
+ if (!fetchValues.isEmpty() && Iterators.find(fetchValues.iterator(), Predicates.notNull()) != null) {
+ Map<String, Object> dataMap = AjaxContext.getCurrentInstance(context).getResponseComponentDataMap();
+ dataMap.put(component.getClientId(context), fetchValues);
+ }
} else {
throw new IllegalArgumentException(metaComponentId);
}
15 years, 2 months