Author: alexsmirnov
Date: 2008-03-19 14:16:27 -0400 (Wed, 19 Mar 2008)
New Revision: 6975
Added:
trunk/developmentBuild.sh
trunk/samples/seamEAR/ear/src/main/application/META-INF/seamEAR-ds.xml
Removed:
trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneOneInvoker.java
trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneTwoInvoker.java
trunk/samples/seamEAR/ejbs/src/main/resources/META-INF/seamEAR-ds.xml
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java
trunk/framework/impl/pom.xml
trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java
trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
trunk/framework/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
trunk/framework/pom.xml
trunk/framework/test/pom.xml
trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java
trunk/samples/pom.xml
trunk/samples/seamEAR/ejbs/pom.xml
trunk/samples/seamEAR/pom.xml
trunk/samples/seamEAR/wars/seamWebapp/pom.xml
trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/components.xml
trunk/samples/skins/pom.xml
trunk/sandbox/api/pom.xml
trunk/ui/core/src/main/java/org/ajax4jsf/ajax/ForceRender.java
trunk/ui/pickList/pom.xml
trunk/ui/pom.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:
Continue to refactor JSF 1.2 compatibility.
Fix common logging dependency
Added: trunk/developmentBuild.sh
===================================================================
--- trunk/developmentBuild.sh (rev 0)
+++ trunk/developmentBuild.sh 2008-03-19 18:16:27 UTC (rev 6975)
@@ -0,0 +1,19 @@
+PROJECT_DIR=`pwd`
+
+mvn clean install -N -Dmaven.test.skip=true
+cd $PROJECT_DIR/cdk
+mvn clean install -Dmaven.test.skip=true
+cd $PROJECT_DIR/framework
+mvn clean install -Dmaven.test.skip=true
+cd $PROJECT_DIR/ui
+mvn clean install -N -Dmaven.test.skip=true
+#cd $PROJECT_DIR/docs
+#mvn clean install
+cd $PROJECT_DIR/ui/assembly
+mvn clean install -Dmaven.test.skip=true
+#cd $PROJECT_DIR/extensions
+#mvn clean install
+#cd $PROJECT_DIR/samples
+#mvn clean install -N
+#cd $PROJECT_DIR/samples/richfaces-demo
+#mvn clean install
Property changes on: trunk/developmentBuild.sh
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2008-03-19
18:10:39 UTC (rev 6974)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -16,6 +16,14 @@
public abstract class AjaxContext {
+ public static final String SCRIPTS_PARAMETER =
"org.ajax4jsf.framework.HEADER_SCRIPTS";
+ public static final String STYLES_PARAMETER =
"org.ajax4jsf.framework.HEADER_STYLES";
+ public static final String USER_STYLES_PARAMETER =
"org.ajax4jsf.framework.HEADER_USER_STYLES";
+ public static final String RESPONSE_DATA_KEY = "_ajax:data";
+ static final String SERVICE_RESOURCE = "META-INF/services/"
+ + AjaxContext.class.getName();
+ private static final String DEFAULT_CONTEXT_CLASS =
"org.ajax4jsf.context.AjaxContextImpl";
+
/**
* Key for keep request state information in request-scope attributes.
*/
@@ -56,29 +64,34 @@
public abstract void processHeadResources(FacesContext context)
throws FacesException;
- public abstract void encodeAjaxEnd(FacesContext context,
- UIComponent component) throws IOException;
+ public abstract void encodeAjaxEnd(FacesContext context) throws IOException;
- public abstract void encodeAjaxBegin(FacesContext context,
- UIComponent component) throws IOException;
+ public abstract void encodeAjaxBegin(FacesContext context) throws IOException;
- public abstract void renderAjaxRegion(FacesContext context,
- UIComponent component, boolean useFilterWriter)
- throws FacesException;
- public abstract void renderSubmittedAjaxRegion(FacesContext context,
- final boolean useFilterWriter);
- public abstract void renderSubmittedAjaxRegion(FacesContext context);
+ public abstract void renderAjax(FacesContext context);
- public static final String SCRIPTS_PARAMETER =
"org.ajax4jsf.framework.HEADER_SCRIPTS";
- public static final String STYLES_PARAMETER =
"org.ajax4jsf.framework.HEADER_STYLES";
- public static final String USER_STYLES_PARAMETER =
"org.ajax4jsf.framework.HEADER_USER_STYLES";
- public static final String RESPONSE_DATA_KEY = "_ajax:data";
- static final String SERVICE_RESOURCE = "META-INF/services/"
- + AjaxContext.class.getName();
- private static final String DEFAULT_CONTEXT_CLASS =
"org.ajax4jsf.context.AjaxContextImpl";
+ public abstract void decode(FacesContext context);
+ public abstract void release();
+
+ public abstract Map<String, Object> getResponseDataMap();
+
+ public abstract void setAjaxRequest(boolean b);
+
+ public abstract boolean isSelfRender();
+
+ public abstract void setSelfRender(boolean b);
+
+ public abstract String getSubmittedRegionClientId();
+
+ public abstract void saveViewState(FacesContext context) throws IOException;
+
+ public abstract void setAjaxSingleClientId(String ajaxSingleClientId);
+
+ public abstract String getAjaxSingleClientId();
+
/**
* Get instance of current AJAX Context. Instance get by
* variable {@link AjaxContext#AJAX_CONTEXT_KEY}
@@ -169,23 +182,4 @@
public AjaxContext() {
}
- public abstract void decode(FacesContext context);
-
- public abstract void release();
-
- public abstract Map<String, Object> getResponseDataMap();
-
- public abstract void setAjaxRequest(boolean b);
-
- public abstract boolean isSelfRender();
-
- public abstract void setSelfRender(boolean b);
-
- public abstract String getSubmittedRegionClientId();
-
- public abstract void saveViewState(FacesContext context) throws IOException;
-
- public abstract void setAjaxSingleClientId(String ajaxSingleClientId);
-
- public abstract String getAjaxSingleClientId();
}
\ No newline at end of file
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java 2008-03-19
18:10:39 UTC (rev 6974)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -45,7 +45,6 @@
}
public boolean isAppropriateListener(FacesListener listener) {
- // TODO Auto-generated method stub
return listener instanceof AjaxRenderListener;
}
@@ -57,14 +56,4 @@
}
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#getPhaseId()
- */
-// public PhaseId getPhaseId() {
-// // TODO Auto-generated method stub
-// return PhaseId.INVOKE_APPLICATION;
-// }
-
-
-
}
Modified: trunk/framework/impl/pom.xml
===================================================================
--- trunk/framework/impl/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/impl/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -1,179 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
<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>
- <artifactId>impl-parent</artifactId>
- <groupId>org.richfaces.framework</groupId>
- <version>3.2.0-SNAPSHOT</version>
- <relativePath>../impl-parent/pom.xml</relativePath>
- </parent>
- -->
- <parent>
- <artifactId>framework</artifactId>
- <groupId>org.richfaces</groupId>
- <version>3.2.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>richfaces-impl</artifactId>
- <version>3.2.0-SNAPSHOT</version>
- <name>Java Server Faces AJAX framework implementation</name>
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <directory>target/javascript</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javacc-maven-plugin</artifactId>
- <version>2.4</version>
- <executions>
- <execution>
- <goals>
- <goal>javacc</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>javascript</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <ant antfile="${basedir}/generatescript.xml"
inheritRefs="true">
- <target name="assembly" />
- <property name="target-dir"
value="${project.build.directory}/javascript">
- </property>
- </ant>
- </tasks>
- <resourceRoot>
- ${project.build.directory}/javascript
- </resourceRoot>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
+ <parent>
+ <artifactId>framework</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <name>Java Server Faces AJAX framework implementation</name>
+ <version>3.2.0-SNAPSHOT</version>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>target/javascript</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javacc-maven-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>javacc</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>javascript</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <ant antfile="${basedir}/generatescript.xml"
inheritRefs="true">
+ <target name="assembly" />
+ <property name="target-dir"
value="${project.build.directory}/javascript"></property>
+ </ant>
+ </tasks>
+
<resourceRoot>${project.build.directory}/javascript</resourceRoot>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-javascript-plugin</artifactId>
<version>${project.version}</version>
- <executions>
+ <executions>
<execution>
<goals>
<goal>compress</goal>
</goals>
- <configuration>
- <nosuffix>false</nosuffix>
-
<outputDirectory>${project.build.directory}/compressed/</outputDirectory>
- <aggregations>
- <aggregation>
- <!-- remove files after aggregation (default: false)
- <removeIncluded>true</removeIncluded>
- -->
- <!-- insert new line after each concatenation (default: false) -->
- <insertNewLine>true</insertNewLine>
-
<output>${project.build.outputDirectory}/org/ajax4jsf/framework.pack.js</output>
- <!-- files to include, path relative to output's directory or
absolute path-->
- <includes>
-
<include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/prototype-min.js</include>
-
<include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/AJAX-min.js</include>
-
<include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/scriptaculous/scriptaculous-min.js</include>
-
<include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/jquery/jquery-min.js</include>
-
<include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/dnd-min.js</include>
- <include>**/*-min.js</include>
- </includes>
- <!-- files to exclude, path relative to output's directory -->
- <excludes>
- <exclude>**/*.pack.js</exclude>
- <!-- exclude parts of the scriptaculous, so big file already included
-->
- <exclude>**/scriptaculous/*.js</exclude>
- <exclude>**/extend-min.js</exclude>
- <exclude>**/jquery.jcarousel-min.js</exclude>
- <exclude>**/compressed.css</exclude>
- </excludes>
- </aggregation>
- </aggregations>
- <resources>
- <resource>
- <directory>target/javascript</directory>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- </configuration>
-
+ <configuration>
+ <nosuffix>false</nosuffix>
+
<outputDirectory>${project.build.directory}/compressed/</outputDirectory>
+ <aggregations>
+ <aggregation>
+ <insertNewLine>true</insertNewLine>
+
<output>${project.build.outputDirectory}/org/ajax4jsf/framework.pack.js</output>
+ <includes>
+
<include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/prototype-min.js</include>
+
<include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/AJAX-min.js</include>
+
<include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/scriptaculous/scriptaculous-min.js</include>
+
<include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/jquery/jquery-min.js</include>
+
<include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/dnd-min.js</include>
+ <include>**/*-min.js</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.pack.js</exclude>
+ <exclude>**/scriptaculous/*.js</exclude>
+ <exclude>**/extend-min.js</exclude>
+ <exclude>**/jquery.jcarousel-min.js</exclude>
+ <exclude>**/compressed.css</exclude>
+ </excludes>
+ </aggregation>
+ </aggregations>
+ <resources>
+ <resource>
+ <directory>target/javascript</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ </configuration>
</execution>
<execution>
<id>jslint</id>
+ <phase>test</phase>
<goals>
<goal>jslint</goal>
</goals>
- <phase>test</phase>
- <configuration>
- <includes><include>**/framework.pack.js</include></includes>
- <resources>
- <resource>
- <directory>${project.build.outputDirectory}</directory>
- </resource>
- </resources>
- </configuration>
-
+ <configuration>
+ <includes>
+ <include>**/framework.pack.js</include>
+ </includes>
+ <resources>
+ <resource>
+ <directory>${project.build.outputDirectory}</directory>
+ </resource>
+ </resources>
+ </configuration>
</execution>
- </executions>
+ </executions>
</plugin>
- </plugins>
- </build>
- <profiles>
- <profile>
- <id>clover</id>
- <build>
- <plugins>
- <plugin>
- <groupId>com.atlassian.maven.plugins</groupId>
- <artifactId>maven-clover-plugin</artifactId>
- <configuration>
- <includesAllSourceRoots>
- false
- </includesAllSourceRoots>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
- <dependencies>
- <dependency>
- <groupId>opensymphony</groupId>
- <artifactId>oscache</artifactId>
- <version>2.3</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>nekohtml</groupId>
- <artifactId>nekohtml</artifactId>
- <version>0.9.5</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>commons-digester</groupId>
- <artifactId>commons-digester</artifactId>
- <version>1.8</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>richfaces-api</artifactId>
- <version>3.2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-</project>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>clover</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.atlassian.maven.plugins</groupId>
+ <artifactId>maven-clover-plugin</artifactId>
+ <configuration>
+ <includesAllSourceRoots>false</includesAllSourceRoots>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+ <dependencies>
+ <dependency>
+ <groupId>opensymphony</groupId>
+ <artifactId>oscache</artifactId>
+ <version>2.3</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <version>0.9.5</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>1.8</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-api</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2008-03-19
18:10:39 UTC (rev 6974)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -180,6 +180,10 @@
// broadcast ajax events before render response.
if (ajaxContext.isAjaxRequest()) {
processAjaxEvents(context, ajaxRoot);
+ if(ajaxContext.isSelfRender()){
+ // Render view directly.
+ ajaxContext.renderAjax(context);
+ }
}
if (!context.getResponseComplete()) {
super.renderView(context, root);
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java 2008-03-19
18:10:39 UTC (rev 6974)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -33,10 +33,8 @@
import javax.faces.event.FacesEvent;
import org.ajax4jsf.Messages;
-import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.event.AjaxListener;
-import org.ajax4jsf.event.AjaxRenderEvent;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -177,7 +175,6 @@
*/
public boolean isSubmitted()
{
- // TODO - more correct check for submitted state
return this.submitted;
}
@@ -194,63 +191,47 @@
}
/**
- * <p>
- * In addition to to the default {@link UIComponent#broadcast}processing,
- * pass the {@link AjaxEvent}being broadcast to the method referenced by
- * <code>AjaxListener</code> (if any), and to the default
- * {@link AjaxListener}registered on the {@link Application}.
- * </p>
- *
- * @param event
- * {@link FacesEvent}to be broadcast
- *
- * @exception AbortProcessingException
- * Signal the JavaServer Faces implementation that no further
- * processing on the current event should be performed
- * @exception IllegalArgumentException
- * if the implementation class of this {@link FacesEvent}is
- * not supported by this component
- * @exception NullPointerException
- * if <code>event</code> is
<code>null</code>
- */
- public void broadcast(FacesEvent event) throws AbortProcessingException {
-
- // Perform standard superclass processing
-// component.broadcast(event);
-
- if (event instanceof AjaxEvent) {
- if (log.isDebugEnabled())
- {
- log.debug(Messages.getMessage(Messages.SEND_EVENT_TO_AJAX_LISTENER,
component.getId()));
- }
-
- // Notify the specified action listener method (if any)
- MethodExpression mb = getAjaxListener();
- if (mb != null) {
- FacesContext context = FacesContext.getCurrentInstance();
- ELContext elContext = context.getELContext();
- mb.invoke(elContext, new Object[] { event });
- }
- // TODO - perform special rendering, withowt RENDER_VIEW phase.
- if(isSelfRendered()) {
- // queue new event to end of queue to perform child elements
- // events.
- if (log.isDebugEnabled())
- {
- log.debug("Queue AjaxRenderEvent for self-render of AjaxContainer
with Id "
- + component.getId());
- }
- FacesEvent renderEvent = new AjaxRenderEvent(component);
- renderEvent.setPhaseId(event.getPhaseId());
- component.queueEvent(renderEvent);
- }
- }
- if (event instanceof AjaxRenderEvent) {
- FacesContext context = FacesContext.getCurrentInstance();
- AjaxContext.getCurrentInstance(context).renderAjaxRegion(context,
component, false);
- }
- }
+ * <p>
+ * In addition to to the default {@link UIComponent#broadcast}processing,
+ * pass the {@link AjaxEvent}being broadcast to the method referenced by
+ * <code>AjaxListener</code> (if any), and to the default
+ * {@link AjaxListener}registered on the {@link Application}.
+ * </p>
+ *
+ * @param event
+ * {@link FacesEvent}to be broadcast
+ *
+ * @exception AbortProcessingException
+ * Signal the JavaServer Faces implementation that no further
+ * processing on the current event should be performed
+ * @exception IllegalArgumentException
+ * if the implementation class of this {@link FacesEvent}is
+ * not supported by this component
+ * @exception NullPointerException
+ * if <code>event</code> is <code>null</code>
+ */
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+ // Perform standard superclass processing
+ // component.broadcast(event);
+
+ if (event instanceof AjaxEvent) {
+ if (log.isDebugEnabled()) {
+ log.debug(Messages
+ .getMessage(Messages.SEND_EVENT_TO_AJAX_LISTENER,
+ component.getId()));
+ }
+
+ // Notify the specified action listener method (if any)
+ MethodExpression mb = getAjaxListener();
+ if (mb != null) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ ELContext elContext = context.getELContext();
+ mb.invoke(elContext, new Object[] { event });
+ }
+ }
+ }
+
/*
* (non-Javadoc)
*
@@ -290,65 +271,8 @@
return values;
}
-/* public void processDecodes(javax.faces.context.FacesContext context)
- {
- if (context == null) throw new NullPointerException("context");
- // due SUN ri design, clear current sattus.
- if(! component.isRendered()) return;
- if(log.isDebugEnabled()){
- log.debug("Process decodes of AjaxContainer with Id
"+component.getId());
- }
- component.decode(context);
- // If it is AJAX request for different area - skip decoding childs.
- if (isAjaxRequest()&& !isSubmitted()){
- if(log.isDebugEnabled()){
- log.debug("Skip Decoders for childrens of AjaxContainer with Id
"+component.getId());
- }
- return;
- }
- for (Iterator it = component.getFacetsAndChildren(); it.hasNext(); )
- {
- UIComponent childOrFacet = (UIComponent)it.next();
- childOrFacet.processDecodes(context);
- }
- }
- public void processValidators(javax.faces.context.FacesContext context)
- {
- if (context == null) throw new NullPointerException("context");
- if(! component.isRendered()) return;
- if (isAjaxRequest()&& !isSubmitted()){
- if(log.isDebugEnabled()){
- log.debug("Skip Validators for childrens of AjaxContainer with Id
"+component.getId());
- }
- return;
- }
-
- for (Iterator it = component.getFacetsAndChildren(); it.hasNext(); )
- {
- UIComponent childOrFacet = (UIComponent)it.next();
- childOrFacet.processValidators(context);
- }
- }
-
- public void processUpdates(javax.faces.context.FacesContext context)
- {
- if (context == null) throw new NullPointerException("context");
- if(! component.isRendered()) return;
- if (isAjaxRequest()&& !isSubmitted()){
- if(log.isDebugEnabled()){
- log.debug("Skip updates for childrens of AjaxContainer with Id
"+component.getId());
- }
- return;
- }
- for (Iterator it = component.getFacetsAndChildren(); it.hasNext(); )
- {
- UIComponent childOrFacet = (UIComponent)it.next();
- childOrFacet.processUpdates(context);
- }
- }
-*/
- public boolean isTransient() {
+ public boolean isTransient() {
return transientFlag;
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2008-03-19
18:10:39 UTC (rev 6974)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -509,6 +509,7 @@
}
}
+ @SuppressWarnings("unchecked")
public void restoreState(FacesContext context, Object state) {
Object[] mystate = (Object[]) state;
super.restoreState(context, mystate[0]);
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-03-19
18:10:39 UTC (rev 6974)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -35,6 +35,7 @@
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
+import javax.faces.component.ContextCallback;
import javax.faces.component.EditableValueHolder;
import javax.faces.component.NamingContainer;
import javax.faces.component.StateHolder;
@@ -42,6 +43,8 @@
import javax.faces.component.UIComponent;
import javax.faces.component.UIData;
import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
@@ -202,6 +205,9 @@
* Key for current value in model.
*/
private Object _rowKey = null;
+
+
+ private Converter _rowKeyConverter = null;
/**
* Values of row keys, encoded on ajax response rendering.
@@ -338,7 +344,7 @@
}
/**
- * Setup current roy by key. Perform same functionality as
+ * Setup current row by key. Perform same functionality as
* {@link UIData#setRowIndex(int)}, but for key object - it may be not only
* row number in sequence data, but, for example - path to current node in
* tree.
@@ -375,6 +381,27 @@
}
}
+ /**
+ * @return the rowKeyConverter
+ */
+ public Converter getRowKeyConverter() {
+ Converter converter = _rowKeyConverter;
+ if (null == converter) {
+ ValueExpression ve = getValueExpression("rowKeyConverter");
+ if (null != ve) {
+ converter = (Converter) ve.getValue(getFacesContext().getELContext());
+ }
+ }
+ return converter;
+ }
+
+ /**
+ * @param rowKeyConverter the rowKeyConverter to set
+ */
+ public void setRowKeyConverter(Converter rowKeyConverter) {
+ _rowKeyConverter = rowKeyConverter;
+ }
+
/*
* (non-Javadoc)
*
@@ -494,8 +521,14 @@
/**
* Instance of default renderer in ajax responses.
*/
- private AjaxChildrenRenderer _childrenRenderer = null;
+ private static final AjaxChildrenRenderer _childrenRenderer = new AjaxChildrenRenderer()
{
+ protected Class<? extends UIComponent> getComponentClass() {
+ return UIDataAdaptor.class;
+ }
+
+ };
+
/**
* getter for simple {@link AjaxChildrenRenderer} instance in case of ajax
* responses. If default renderer not support search of children for encode
@@ -504,17 +537,6 @@
* @return
*/
protected AjaxChildrenRenderer getChildrenRenderer() {
- if (_childrenRenderer == null) {
- _childrenRenderer = new AjaxChildrenRenderer() {
-
- protected Class<? extends UIComponent> getComponentClass() {
- return UIDataAdaptor.class;
- }
-
- };
-
- }
-
return _childrenRenderer;
}
@@ -692,11 +714,22 @@
public String getClientId(FacesContext faces) {
if (null == _clientId) {
- StringBuffer id = new StringBuffer(getBaseClientId(faces));
+ StringBuilder id = new StringBuilder(getBaseClientId(faces));
Object rowKey = getRowKey();
if (rowKey != null) {
+ // Use converter to get String representation ot the row key.
+ Converter rowKeyConverter = getRowKeyConverter();
+ if(null == rowKeyConverter){
+ // Create default converter for a row key.
+ rowKeyConverter = faces.getApplication().createConverter(rowKey.getClass());
+ // Store converter for a invokeOnComponents call.
+ if(null != rowKeyConverter){
+ setRowKeyConverter(rowKeyConverter);
+ }
+ }
+ String rowKeyString = null !=rowKeyConverter?rowKeyConverter.getAsString(faces, this,
rowKey):rowKey.toString();
id.append(NamingContainer.SEPARATOR_CHAR).append(
- rowKey.toString());
+ rowKeyString);
}
Renderer renderer;
if (null != (renderer = getRenderer(faces))) {
@@ -723,10 +756,10 @@
// Search for an ancestor that is a naming container
UIComponent ancestorContainer = this;
- StringBuffer parentIds = new StringBuffer();
+ StringBuilder parentIds = new StringBuilder();
while (null != (ancestorContainer = ancestorContainer.getParent())) {
if (ancestorContainer instanceof NamingContainer) {
- parentIds.append(ancestorContainer.getClientId(faces))
+ parentIds.append(ancestorContainer.getContainerClientId(faces))
.append(NamingContainer.SEPARATOR_CHAR);
break;
}
@@ -735,8 +768,10 @@
if (null != id) {
_baseClientId = parentIds.append(id).toString();
} else {
+ id = faces.getViewRoot().createUniqueId();
+ super.setId(id);
_baseClientId = parentIds.append(
- faces.getViewRoot().createUniqueId()).toString();
+ getId()).toString();
}
}
return (_baseClientId);
@@ -1012,6 +1047,72 @@
this.restoreOrigValue(faces);
}
}
+
+ @Override
+ public boolean invokeOnComponent(FacesContext context, String clientId,
+ ContextCallback callback) throws FacesException {
+ if( null == context || null == clientId || null == callback){
+ throw new NullPointerException();
+ }
+ boolean found = false;
+ Object oldRowKey = getRowKey();
+ String baseClientId = getBaseClientId(context);
+ if (clientId.equals(baseClientId)) {
+ // This is call for a same data component.
+ try {
+ if (null != oldRowKey) {
+ captureOrigValue(context);
+ setRowKey(context,null);
+ }
+ callback.invokeContextCallback(context, this);
+ found = true;
+ } catch (Exception e) {
+ throw new FacesException(e);
+ } finally {
+ if (null != oldRowKey) {
+ setRowKey(context,oldRowKey);
+ restoreOrigValue(context);
+ }
+ }
+ } else {
+ String baseId = baseClientId+NamingContainer.SEPARATOR_CHAR;
+ if (clientId.startsWith(baseId)) {
+ Object newRowKey = null;
+ // Call for a child component - try to detect row key
+ int indexOfSecondColon = clientId.indexOf(
+ NamingContainer.SEPARATOR_CHAR, baseId.length());
+ String rowKeyString = null;
+ if (indexOfSecondColon > 0) {
+ rowKeyString = clientId.substring(baseId.length(),
+ indexOfSecondColon);
+ Converter keyConverter = getRowKeyConverter();
+ if (null != keyConverter) {
+ try {
+ newRowKey = keyConverter.getAsObject(context, this,
+ rowKeyString);
+ } catch (ConverterException e) {
+ // TODO: log error
+ }
+ }
+ }
+ if( null != oldRowKey || null != newRowKey){
+ captureOrigValue(context);
+ setRowKey(newRowKey);
+ }
+ Iterator<UIComponent> itr = this.getFacetsAndChildren();
+ while (itr.hasNext() && !found) {
+ found = itr.next().invokeOnComponent(context, clientId,
+ callback);
+ }
+ if( null != oldRowKey || null != newRowKey){
+ setRowKey(oldRowKey);
+ restoreOrigValue(context);
+ }
+ }
+ }
+ //
+ return found;
+ }
/**
* Walk ( visit ) this component on all data-avare children for each row.
@@ -1329,6 +1430,8 @@
private Map<String, Map<String, SavedState>> childStates;
+ public Object rowKeyConverter;
+
}
/**
@@ -1364,6 +1467,10 @@
this._rowKeyVar = state.rowKeyVar;
this._stateVar = state.stateVar;
this.childState = state.childStates;
+ if (null != state.rowKeyConverter) {
+ this._rowKeyConverter = (Converter) restoreAttachedState(faces,
+ state.rowKeyConverter);
+ }
// Restore serializable models and component states for all rows of
// parent UIData ( single if this
// component not child of iterable )
@@ -1394,6 +1501,9 @@
state.rowKeyVar = this._rowKeyVar;
state.stateVar = this._stateVar;
state.childStates = this.childState;
+ if (null != this._rowKeyConverter) {
+ state.rowKeyConverter = saveAttachedState(faces,this._rowKeyConverter);
+ }
Set<String> encodedIds = getEncodedIds();
// Save all states of component and data model for all valies of
// clientId, encoded in this request.
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-03-19
18:10:39 UTC (rev 6974)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -34,6 +34,8 @@
import java.util.Set;
import java.util.regex.Pattern;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
import javax.faces.FacesException;
@@ -51,11 +53,8 @@
import javax.faces.event.AbortProcessingException;
import javax.faces.render.RenderKit;
import javax.faces.render.RenderKitFactory;
-import javax.servlet.Servlet;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
import org.ajax4jsf.Messages;
import org.ajax4jsf.application.AjaxViewHandler;
@@ -83,7 +82,6 @@
* @version $Revision: 1.1.2.7 $ $Date: 2007/02/08 19:07:16 $
*
*/
-@SuppressWarnings("deprecation")
public class AjaxContextImpl extends AjaxContext {
public static final String SERVLET_ERROR_EXCEPTION_ATTRIBUTE =
"javax.servlet.error.exception";
@@ -101,9 +99,7 @@
private static final Log log = LogFactory.getLog(AjaxContext.class);
- private static ComponentInvoker invoker;
-
Set<String> ajaxAreasToRender = new HashSet<String>();
Set<String> ajaxRenderedAreas = new LinkedHashSet<String>();
@@ -127,15 +123,9 @@
Object oncomplete = null;
- static {
- try {
- // Attempt to create JSF1.2 specific invoker.
- invoker = new JsfOneTwoInvoker();
- } catch (Exception e) {
- invoker = new JsfOneOneInvoker();
- }
- }
+
+ @PreDestroy
public void release() {
ajaxAreasToRender = new HashSet<String>();
@@ -162,6 +152,7 @@
* @see org.ajax4jsf.context.AjaxContext#decode(javax.faces.context.FacesContext)
*/
@Override
+ @PostConstruct
public void decode(FacesContext context) {
ExternalContext externalContext = context.getExternalContext();
if (null == externalContext.getRequestMap().get(
@@ -181,79 +172,20 @@
}
}
- /**
- * @param root
- * @param context
- * @param callback
- * @param regionId
- * @return
- * @see
org.ajax4jsf.context.JsfOneOneInvoker#invokeOnComponent(javax.faces.component.UIComponent,
- * javax.faces.context.FacesContext,
- * org.ajax4jsf.context.InvokerCallback, java.lang.String)
- */
- public static boolean invokeOnComponent(UIComponent root,
- FacesContext context, InvokerCallback callback, String regionId) {
- return invoker.invokeOnComponent(root, context, callback, regionId);
- }
/**
- * @param viewRoot
* @param context
- * @param callback
- * @see
org.ajax4jsf.context.JsfOneOneInvoker#invokeOnRegionOrRoot(org.ajax4jsf.component.AjaxViewRoot,
- * javax.faces.context.FacesContext,
- * org.ajax4jsf.context.InvokerCallback)
- */
- public static void invokeOnRegionOrRoot(AjaxViewRoot viewRoot,
- FacesContext context, InvokerCallback callback) {
- invoker.invokeOnRegionOrRoot(viewRoot, context, callback);
- }
-
- public void renderSubmittedAjaxRegion(FacesContext context) {
- renderSubmittedAjaxRegion(context, true);
- }
-
- public void renderSubmittedAjaxRegion(FacesContext context,
- final boolean useFilterWriter) {
- InvokerCallback ajaxInvoker = new InvokerCallback() {
-
- public void invokeContextCallback(FacesContext context, UIComponent component) {
- if (component instanceof AjaxContainer) {
- renderAjaxRegion(context, component, useFilterWriter);
- } else {
- // Container not found, use Root for encode.
- renderAjaxRegion(context, context.getViewRoot(),
- useFilterWriter);
- }
- }
-
- public void invokeRoot(FacesContext context) {
- renderAjaxRegion(context, context.getViewRoot(),
- useFilterWriter);
- }
-
- };
- if (!invokeOnComponent(context.getViewRoot(), context, ajaxInvoker,
- getSubmittedRegionClientId())) {
- renderAjaxRegion(context, context.getViewRoot(), useFilterWriter);
- }
-
- }
-
- /**
- * @param context
- * @param useFilterWriter
- * TODO
* @throws AbortProcessingException
*/
- public void renderAjaxRegion(FacesContext context, UIComponent component,
- boolean useFilterWriter) throws FacesException {
+ public void renderAjax(FacesContext context) throws FacesException {
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage(Messages.RENDER_AJAX_REQUEST,
- component.getId()));
+ getSubmittedRegionClientId()));
}
try {
+ // Just in case...
setSelfRender(true);
+ setAjaxRequest(true);
// create response writer.
ExternalContext extContext = context.getExternalContext();
RenderKit renderKit = context.getRenderKit();
@@ -264,8 +196,6 @@
.getRequest();
ServletResponse response = (ServletResponse) extContext
.getResponse();
- // HACK - bypass MyFaces ( and other ) extensions filter.
-
// Setup encoding and content type
String contentType = "text/xml";
// get the encoding - must be setup by faces context or filter.
@@ -278,36 +208,16 @@
encoding = "UTF-8";
PrintWriter servletWriter;
- if (useFilterWriter
- && extContext.getRequestMap().containsKey(
- BaseFilter.RESPONSE_WRAPPER_ATTRIBUTE)) {
- // HACK - Special case for MyFaces, since <f:view don't call
- // encode methods,
- // encode response as for self-rendered region directly to
- // filter response wrpper.
- // to avoid exceptions, inform wrapper to ignore illegal states
- // for getWriter/Stream.
- ServletResponse servletResponse = (ServletResponse) extContext
- .getRequestMap().get(
- BaseFilter.RESPONSE_WRAPPER_ATTRIBUTE);
- servletResponse.resetBuffer();
- servletWriter = servletResponse.getWriter();
- ((FilterServletResponseWrapper) servletResponse)
- .setUseNullStream(true);
- } else {
servletWriter = getWriter(extContext);
- }
ResponseWriter writer = renderKit.createResponseWriter(
servletWriter, null, encoding);
context.setResponseWriter(writer);
// make response
writer.startDocument();
- encodeAjaxBegin(context, component);
- component.encodeBegin(context);
- ((AjaxContainer) component).encodeAjax(context);
- component.encodeEnd(context);
+ encodeAjaxBegin(context);
+ context.getViewRoot().encodeAll(context);
saveViewState(context);
- encodeAjaxEnd(context, component);
+ encodeAjaxEnd(context);
writer.endDocument();
writer.flush();
writer.close();
@@ -315,8 +225,7 @@
// Save tree state.
} catch (IOException e) {
throw new FacesException(Messages.getMessage(
- Messages.RENDERING_AJAX_REGION_ERROR, component
- .getClientId(context)), e);
+ Messages.RENDERING_AJAX_REGION_ERROR, getSubmittedRegionClientId()), e);
} finally {
context.responseComplete();
// component.setRendererType(defaultRenderer);
@@ -327,19 +236,19 @@
* Encode declaration for AJAX response. Render
<html><body>
*
* @param context
- * @param component
* @throws IOException
*/
- public void encodeAjaxBegin(FacesContext context, UIComponent component)
+ public void encodeAjaxBegin(FacesContext context)
throws IOException {
+ UIViewRoot viewRoot = context.getViewRoot();
// AjaxContainer ajax = (AjaxContainer) component;
ResponseWriter out = context.getResponseWriter();
// DebugUtils.traceView("ViewRoot in AJAX Page encode begin");
- out.startElement(HTML.HTML_ELEMENT, component);
+ out.startElement(HTML.HTML_ELEMENT, viewRoot);
// TODO - html attributes. lang - from current locale ?
- Locale locale = context.getViewRoot().getLocale();
+ Locale locale = viewRoot.getLocale();
out.writeAttribute(HTML.lang_ATTRIBUTE, locale.toString(), "lang");
- out.startElement(HTML.BODY_ELEMENT, component);
+ out.startElement(HTML.BODY_ELEMENT, viewRoot);
}
/**
@@ -347,10 +256,9 @@
* </body></html>
*
* @param context
- * @param component
* @throws IOException
*/
- public void encodeAjaxEnd(FacesContext context, UIComponent component)
+ public void encodeAjaxEnd(FacesContext context)
throws IOException {
// AjaxContainer ajax = (AjaxContainer) component;
ResponseWriter out = context.getResponseWriter();
@@ -570,13 +478,6 @@
@SuppressWarnings("deprecation")
public void saveViewState(FacesContext context) throws IOException {
- // TODO - for facelets environment, we need to remove transient
- // components.
- try {
- Application.class.getMethod("getExpressionFactory", (Class<?>) null);
- } catch (NoSuchMethodException e) {
- // JSF 1.1 !
- }
ResponseWriter writer = context.getResponseWriter();
StateManager stateManager = context.getApplication().getStateManager();
SerializedView serializedView = stateManager
@@ -584,11 +485,7 @@
if (null != serializedView && null != writer) {
StringWriter bufWriter = new StringWriter();
ResponseWriter tempWriter;
-// if(null != writer) {
- tempWriter = writer.cloneWithWriter(bufWriter);
-// } else {
-// tempWriter = getRenderKit(context).createResponseWriter(bufWriter, null, null);
-// }
+ tempWriter = writer.cloneWithWriter(bufWriter);
context.setResponseWriter(tempWriter);
stateManager.writeState(context, serializedView);
tempWriter.flush();
@@ -597,10 +494,7 @@
AjaxViewHandler.SERIALIZED_STATE_KEY,
bufWriter.toString());
}
- // Restore original writer.
-// if (null != writer) {
- context.setResponseWriter(writer);
-// }
+ context.setResponseWriter(writer);
}
}
Deleted: trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneOneInvoker.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneOneInvoker.java 2008-03-19
18:10:39 UTC (rev 6974)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneOneInvoker.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -1,90 +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.ajax4jsf.context;
-
-import java.util.Iterator;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.component.AjaxViewRoot;
-import org.ajax4jsf.context.AjaxContext;
-
-/**
- * @author shura
- *
- */
-public class JsfOneOneInvoker implements ComponentInvoker {
-
-
- /**
- *
- */
- public JsfOneOneInvoker() {
- // TODO Auto-generated constructor stub
- }
-
-
- /* (non-Javadoc)
- * @see
org.ajax4jsf.framework.ajax.AjaxInvoker#invokeOnRegionOrRoot(org.ajax4jsf.framework.ajax.AjaxViewRoot,
javax.faces.context.FacesContext, org.ajax4jsf.framework.ajax.InvokerCallback,
javax.faces.event.PhaseId)
- */
- public void invokeOnRegionOrRoot(AjaxViewRoot viewRoot, FacesContext context,
InvokerCallback callback) {
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- String submittedRegionClientId = ajaxContext.getSubmittedRegionClientId();
- if(null == submittedRegionClientId ||
viewRoot.getId().equals(submittedRegionClientId)){
- // This is a not AJAX request, or active region is root.
- callback.invokeRoot(context);
- } else {
- if(!invokeOnComponent(viewRoot, context, callback, submittedRegionClientId)){
- // Region not found - perform default actions.
- // TODO - log errors.
- callback.invokeRoot(context);
- }
- }
-
- }
-
- public void invokeOnRegion(FacesContext context, InvokerCallback callback, String
regionId) {
- UIViewRoot viewRoot = context.getViewRoot();
- invokeOnComponent(viewRoot,context,callback,regionId);
- }
-
-
- /* (non-Javadoc)
- * @see
org.ajax4jsf.framework.ajax.AjaxInvoker#invokeOnComponent(javax.faces.component.UIComponent,
javax.faces.context.FacesContext, org.ajax4jsf.framework.ajax.InvokerCallback,
java.lang.String)
- */
- public boolean invokeOnComponent(UIComponent root, FacesContext context, InvokerCallback
callback, String regionId) {
- if(regionId.equals(root.getClientId(context))){
- callback.invokeContextCallback(context, root);
- return true;
- }
- for (Iterator iter = root.getFacetsAndChildren(); iter.hasNext();) {
- UIComponent child = (UIComponent) iter.next();
- if(invokeOnComponent(child, context, callback, regionId)){
- return true;
- }
- }
- return false;
- }
-
-}
Deleted: trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneTwoInvoker.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneTwoInvoker.java 2008-03-19
18:10:39 UTC (rev 6974)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/context/JsfOneTwoInvoker.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -1,74 +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.ajax4jsf.context;
-
-import java.util.Iterator;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.component.AjaxViewRoot;
-import org.ajax4jsf.context.AjaxContext;
-
-/**
- * @author shura
- *
- */
-public class JsfOneTwoInvoker implements ComponentInvoker {
-
-
-
-
- /* (non-Javadoc)
- * @see
org.ajax4jsf.framework.ajax.AjaxInvoker#invokeOnRegionOrRoot(org.ajax4jsf.framework.ajax.AjaxViewRoot,
javax.faces.context.FacesContext, org.ajax4jsf.framework.ajax.InvokerCallback,
javax.faces.event.PhaseId)
- */
- public void invokeOnRegionOrRoot(AjaxViewRoot viewRoot, FacesContext context,
InvokerCallback callback) {
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- String submittedRegionClientId = ajaxContext.getSubmittedRegionClientId();
- if(null == submittedRegionClientId ||
viewRoot.getClientId(context).equals(submittedRegionClientId)){
- // This is a not AJAX request, or active region is root.
- callback.invokeRoot(context);
- } else {
- if(!invokeOnComponent(viewRoot, context, callback, submittedRegionClientId)){
- // Region not found - perform default actions.
- // TODO - log errors.
- callback.invokeRoot(context);
- }
- }
-
- }
-
- public void invokeOnRegion(FacesContext context, InvokerCallback callback, String
regionId) {
- UIViewRoot viewRoot = context.getViewRoot();
- invokeOnComponent(viewRoot,context,callback,regionId);
- }
-
-
- /* (non-Javadoc)
- * @see
org.ajax4jsf.framework.ajax.AjaxInvoker#invokeOnComponent(javax.faces.component.UIComponent,
javax.faces.context.FacesContext, org.ajax4jsf.framework.ajax.InvokerCallback,
java.lang.String)
- */
- public boolean invokeOnComponent(UIComponent root, FacesContext context, InvokerCallback
callback, String regionId) {
- return root.invokeOnComponent(context, regionId, callback);
- }
-
-}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java 2008-03-19
18:10:39 UTC (rev 6974)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -71,48 +71,26 @@
log.debug("Process after phase " + phaseId.toString());
}
FacesContext context = event.getFacesContext();
- Map requestMap = context.getExternalContext().getRequestMap();
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- if (phaseId == PhaseId.RENDER_RESPONSE) {
- try {
- if (ajaxContext.isAjaxRequest()) {
- // JSF RI 1.1 hack - view state not saved in <f:view> tag.
- if (null == requestMap.get(VIEW_STATE_SAVED_PARAM)) {
- ajaxContext.saveViewState(context);
- }
- }
- } catch (IOException e) {
- throw new FacesException(e);
- } finally {
- ajaxContext.release();
- }
- // ajaxContext.processHeadResources(context);
- } else if (phaseId == PhaseId.RESTORE_VIEW) {
-
+ if (phaseId == PhaseId.RESTORE_VIEW) {
UIViewRoot viewRoot = context.getViewRoot();
if (null != viewRoot) {
boolean isAjax = ajaxContext.isAjaxRequest();
- Map attributes = viewRoot.getAttributes();
- for (Iterator it = attributes.keySet().iterator(); it.hasNext();) {
- Object key = it.next();
- if (key instanceof String) {
- String stringKey = (String) key;
+ Map<String, Object> attributes = viewRoot.getAttributes();
+ for(String stringKey:attributes.keySet()) {
if (stringKey.startsWith(VIEW_BEAN_PREFIX)) {
requestMap.put(stringKey.substring(VIEW_BEAN_PREFIX
- .length()), attributes.get(key));
+ .length()), attributes.get(stringKey));
} else if (isAjax
&& stringKey.startsWith(AJAX_BEAN_PREFIX)) {
requestMap.put(stringKey.substring(AJAX_BEAN_PREFIX
- .length()), attributes.get(key));
+ .length()), attributes.get(stringKey));
}
- }
}
}
}
- if (context.getResponseComplete()) {
- ajaxContext.release();
- }
}
/*
@@ -166,16 +144,5 @@
return PhaseId.ANY_PHASE;
}
- protected boolean isValueReference(String value) {
- if (value == null)
- throw new NullPointerException("value");
- int start = value.indexOf("#{");
- if (start < 0)
- return false;
-
- int end = value.lastIndexOf('}');
- return (end >= 0 && start < end);
- }
-
}
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2008-03-19
18:10:39 UTC (rev 6974)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -134,7 +134,7 @@
* @see javax.faces.component.UIComponent#getRendersChildren()
*/
public boolean getRendersChildren() {
- return true;
+ return false;
}
/*
@@ -156,6 +156,9 @@
AjaxContainer ajaxContainer = (AjaxContainer) component;
if (null != ajaxParameter && ajaxParameter.equals(clientId)) {
ajaxContainer.setSubmitted(true);
+ if(ajaxContainer.isSelfRendered()){
+ AjaxContext.getCurrentInstance(context).setSelfRender(true);
+ }
AjaxEvent event = new AjaxEvent(component);
component.queueEvent(event);
} else {
Modified: trunk/framework/pom.xml
===================================================================
--- trunk/framework/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -79,7 +79,6 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
@@ -102,9 +101,16 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
</dependencies>
<modules>
<!--
Modified: trunk/framework/test/pom.xml
===================================================================
--- trunk/framework/test/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/framework/test/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -49,7 +49,7 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
</dependency>
<dependency>
<groupId>htmlunit</groupId>
Modified: trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java
===================================================================
---
trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java 2008-03-19
18:10:39 UTC (rev 6974)
+++
trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -73,7 +73,7 @@
* @see
org.ajax4jsf.context.AjaxContext#encodeAjaxBegin(javax.faces.context.FacesContext,
javax.faces.component.UIComponent)
*/
@Override
- public void encodeAjaxBegin(FacesContext context, UIComponent component)
+ public void encodeAjaxBegin(FacesContext context)
throws IOException {
// TODO Auto-generated method stub
@@ -83,7 +83,7 @@
* @see org.ajax4jsf.context.AjaxContext#encodeAjaxEnd(javax.faces.context.FacesContext,
javax.faces.component.UIComponent)
*/
@Override
- public void encodeAjaxEnd(FacesContext context, UIComponent component)
+ public void encodeAjaxEnd(FacesContext context)
throws IOException {
// TODO Auto-generated method stub
@@ -233,31 +233,12 @@
return false;
}
- /* (non-Javadoc)
- * @see
org.ajax4jsf.context.AjaxContext#renderAjaxRegion(javax.faces.context.FacesContext,
javax.faces.component.UIComponent, boolean)
- */
- @Override
- public void renderAjaxRegion(FacesContext context, UIComponent component,
- boolean useFilterWriter) throws FacesException {
- // TODO Auto-generated method stub
- }
-
/* (non-Javadoc)
- * @see
org.ajax4jsf.context.AjaxContext#renderSubmittedAjaxRegion(javax.faces.context.FacesContext,
boolean)
- */
- @Override
- public void renderSubmittedAjaxRegion(FacesContext context,
- boolean useFilterWriter) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
* @see
org.ajax4jsf.context.AjaxContext#renderSubmittedAjaxRegion(javax.faces.context.FacesContext)
*/
@Override
- public void renderSubmittedAjaxRegion(FacesContext context) {
+ public void renderAjax(FacesContext context) {
// TODO Auto-generated method stub
}
Modified: trunk/samples/pom.xml
===================================================================
--- trunk/samples/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/samples/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -189,12 +189,12 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>runtime</scope>
</dependency>
</dependencies>
@@ -244,12 +244,12 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>runtime</scope>
</dependency>
</dependencies>
@@ -289,12 +289,12 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>runtime</scope>
</dependency>
<dependency>
@@ -343,13 +343,13 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
</dependencies>
Copied: trunk/samples/seamEAR/ear/src/main/application/META-INF/seamEAR-ds.xml (from rev
6920, trunk/samples/seamEAR/ejbs/src/main/resources/META-INF/seamEAR-ds.xml)
===================================================================
--- trunk/samples/seamEAR/ear/src/main/application/META-INF/seamEAR-ds.xml
(rev 0)
+++ trunk/samples/seamEAR/ear/src/main/application/META-INF/seamEAR-ds.xml 2008-03-19
18:16:27 UTC (rev 6975)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE datasources
+ PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
+
+<datasources>
+
+ <local-tx-datasource>
+ <jndi-name>seamEARDatasource</jndi-name>
+ <connection-url>jdbc:hsqldb:.</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+ <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional)
-->
+ <metadata>
+ <type-mapping>Hypersonic SQL</type-mapping>
+ </metadata>
+<!--
+ <exception-sorter-class-name>
+ org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
+ </exception-sorter-class-name>
+ <metadata>
+ <type-mapping>mySQL</type-mapping>
+ </metadata>
+-->
+ </local-tx-datasource>
+
+</datasources>
+
Modified: trunk/samples/seamEAR/ejbs/pom.xml
===================================================================
--- trunk/samples/seamEAR/ejbs/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/samples/seamEAR/ejbs/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -23,9 +23,9 @@
<artifactId>logging</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <scope>provided</scope>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.richfaces.framework</groupId>
@@ -68,19 +68,21 @@
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate-commons-annotations</artifactId>
- <version>3.3.0.ga</version>
+ <artifactId>hibernate-annotations</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate-annotations</artifactId>
- <version>3.2.0.ga</version>
+ <artifactId>hibernate-validator</artifactId>
<scope>provided</scope>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ </dependency>
</dependencies>
<build>
- <finalName>ejbs</finalName>
+ <finalName>ejbs</finalName>
<plugins>
<plugin>
<artifactId>maven-ejb-plugin</artifactId>
Deleted: trunk/samples/seamEAR/ejbs/src/main/resources/META-INF/seamEAR-ds.xml
===================================================================
--- trunk/samples/seamEAR/ejbs/src/main/resources/META-INF/seamEAR-ds.xml 2008-03-19
18:10:39 UTC (rev 6974)
+++ trunk/samples/seamEAR/ejbs/src/main/resources/META-INF/seamEAR-ds.xml 2008-03-19
18:16:27 UTC (rev 6975)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE datasources
- PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
- "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
-
-<datasources>
-
- <local-tx-datasource>
- <jndi-name>seamEARDatasource</jndi-name>
- <connection-url>jdbc:hsqldb:.</connection-url>
- <driver-class>org.hsqldb.jdbcDriver</driver-class>
- <user-name>sa</user-name>
- <password></password>
- <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional)
-->
- <metadata>
- <type-mapping>Hypersonic SQL</type-mapping>
- </metadata>
-<!--
- <exception-sorter-class-name>
- org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
- </exception-sorter-class-name>
- <metadata>
- <type-mapping>mySQL</type-mapping>
- </metadata>
--->
- </local-tx-datasource>
-
-</datasources>
-
Modified: trunk/samples/seamEAR/pom.xml
===================================================================
--- trunk/samples/seamEAR/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/samples/seamEAR/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -16,7 +16,7 @@
<packaging>pom</packaging>
<name>seam EAR project</name>
<properties>
- <seam>2.0.0.GA</seam>
+ <seam>2.0.1.GA</seam>
</properties>
<modules>
<module>projects</module>
@@ -89,16 +89,21 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
- <version>3.3.0.ga</version>
+ <version>3.3.1.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
- <version>3.3.1.ga</version>
+ <version>3.3.2.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.jbpm</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <version>3.2.2</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<version>${seam}</version>
Modified: trunk/samples/seamEAR/wars/seamWebapp/pom.xml
===================================================================
--- trunk/samples/seamEAR/wars/seamWebapp/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/samples/seamEAR/wars/seamWebapp/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -13,7 +13,7 @@
<version>3.2.0-SNAPSHOT</version>
</parent>
<build>
- <finalName>seamWebapp</finalName>
+ <finalName>seamWebapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -58,13 +58,13 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -74,33 +74,18 @@
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate-commons-annotations</artifactId>
- <version>3.3.0.ga</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
- <version>3.2.0.ga</version>
<scope>provided</scope>
- </dependency>
- <!--
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
- <version>3.2.4.ga</version>
- </dependency>
- -->
+ </dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
- <version>3.0.0.ga</version>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <scope>provided</scope>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
Modified: trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/components.xml
===================================================================
---
trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/components.xml 2008-03-19
18:10:39 UTC (rev 6974)
+++
trunk/samples/seamEAR/wars/seamWebapp/src/main/webapp/WEB-INF/components.xml 2008-03-19
18:16:27 UTC (rev 6975)
@@ -32,10 +32,10 @@
authenticate-method="#{authenticator.authenticate}" />
<event type="org.jboss.seam.notLoggedIn">
- <action expression="#{redirect.captureCurrentView}" />
+ <action execute="#{redirect.captureCurrentView}" />
</event>
<event type="org.jboss.seam.postAuthenticate">
- <action expression="#{redirect.returnToCapturedView}" />
+ <action execute="#{redirect.returnToCapturedView}" />
</event>
<mail:mail-session host="localhost" port="2525"
username="test"
@@ -43,15 +43,11 @@
<!-- For use with jBPM pageflow or process management -->
<!--
- <bpm:jbpm>
- <bpm:process-definitions></bpm:process-definitions>
- <bpm:pageflow-definitions></bpm:pageflow-definitions>
- </bpm:jbpm>
- -->
<bpm:jbpm>
<bpm:pageflow-definitions>
<value>/pageflows/pageflow.jpdl.xml</value>
</bpm:pageflow-definitions>
</bpm:jbpm>
+ -->
</components>
Modified: trunk/samples/skins/pom.xml
===================================================================
--- trunk/samples/skins/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/samples/skins/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -8,5 +8,5 @@
<groupId>org.richfaces.samples</groupId>
<artifactId>skins</artifactId>
<name>skins</name>
- <dependencies />
+ <dependencies/>
</project>
\ No newline at end of file
Modified: trunk/sandbox/api/pom.xml
===================================================================
--- trunk/sandbox/api/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/sandbox/api/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -35,7 +35,7 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
</dependencies>
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/ajax/ForceRender.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/ajax/ForceRender.java 2008-03-19 18:10:39 UTC
(rev 6974)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/ajax/ForceRender.java 2008-03-19 18:16:27 UTC
(rev 6975)
@@ -51,7 +51,7 @@
*/
public void processAjaxRender(AjaxRenderEvent event) {
FacesContext facesContext = FacesContext.getCurrentInstance();
- AjaxContext.getCurrentInstance(facesContext).renderSubmittedAjaxRegion(facesContext,false);
+ AjaxContext.getCurrentInstance(facesContext).renderAjax(facesContext);
}
}
Modified: trunk/ui/pickList/pom.xml
===================================================================
--- trunk/ui/pickList/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/ui/pickList/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -66,7 +66,7 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
</dependency>
<dependency>
Modified: trunk/ui/pom.xml
===================================================================
--- trunk/ui/pom.xml 2008-03-19 18:10:39 UTC (rev 6974)
+++ trunk/ui/pom.xml 2008-03-19 18:16:27 UTC (rev 6975)
@@ -179,7 +179,7 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_07</version>
+ <version>1.2_08</version>
<scope>provided</scope>
</dependency>
</dependencies>
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-19
18:10:39 UTC (rev 6974)
+++
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -431,9 +431,9 @@
}
AjaxRendererUtils.addRegionsFromComponent(this, context);
AjaxRendererUtils.addRegionByName(context, this, this.getId());
- setSubmitted(true);
+// setSubmitted(true);
if (isSelfRendered()) {
- ajaxContext.renderSubmittedAjaxRegion(context, true);
+ ajaxContext.setSelfRender(true);
}
} else if (event instanceof SelectSuggestionEvent) {
setValue(null);
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-19
18:10:39 UTC (rev 6974)
+++
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-19
18:16:27 UTC (rev 6975)
@@ -164,22 +164,22 @@
protected final void doDecode(final FacesContext context,
final UIComponent component) {
String clientId = component.getClientId(context);
- Map requestParameterMap = context.getExternalContext()
+ Map<String, String> requestParameterMap = context.getExternalContext()
.getRequestParameterMap();
- String reqValue = (String) requestParameterMap.get(clientId);
+ String reqValue = requestParameterMap.get(clientId);
if (reqValue != null && reqValue.equals(clientId)) {
+ UISuggestionBox suggestionBox = ((UISuggestionBox) component);
String paramName = (String)
component.getAttributes().get("param");
if (null == paramName) {
paramName = "inputvalue";
}
- Object elementValue = requestParameterMap.get(paramName);
+ String elementValue = requestParameterMap.get(paramName);
+ suggestionBox.setSubmitted(true);
component.queueEvent(
new AjaxSuggestionEvent(component, elementValue));
-
-
String requestedParamName = paramName + "request";
String[] requestedValues = null;
- Object requestedValuesParam = requestParameterMap.get(requestedParamName);
+ String requestedValuesParam = requestParameterMap.get(requestedParamName);
if (requestedValuesParam != null) {
String requestedString = requestedValuesParam.toString();
@@ -193,8 +193,7 @@
} else {
//TODO nick - review together with pasha
}
-
- ((UISuggestionBox) component).setSubmitedValue(elementValue,
+ suggestionBox.setSubmitedValue(elementValue,
requestedValues);
}
@@ -342,7 +341,7 @@
return parent;
} else {
throw new FacesException("SuggestonBox cannot be attached to the
component with id = " + parent.getId() +
- ", because a client identifier of the component won�t be rendered onto
the page. Please, set the identifier.");
+ ", because a client identifier of the component won�t be rendered onto
the page. Please, set the identifier.");
}
} else {
throw new FacesException("Parent component is null for SuggestionBox "
+