JBoss Rich Faces SVN: r20974 - in trunk: examples/core-demo/src/main/webapp and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-12 15:30:22 -0500 (Wed, 12 Jan 2011)
New Revision: 20974
Modified:
trunk/examples/core-demo/src/main/java/org/richfaces/demo/LogBean.java
trunk/examples/core-demo/src/main/webapp/log.xhtml
trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js
Log:
https://issues.jboss.org/browse/RF-9138
https://issues.jboss.org/browse/RF-9025
Modified: trunk/examples/core-demo/src/main/java/org/richfaces/demo/LogBean.java
===================================================================
--- trunk/examples/core-demo/src/main/java/org/richfaces/demo/LogBean.java 2011-01-12 20:08:46 UTC (rev 20973)
+++ trunk/examples/core-demo/src/main/java/org/richfaces/demo/LogBean.java 2011-01-12 20:30:22 UTC (rev 20974)
@@ -34,6 +34,10 @@
@SessionScoped
public class LogBean {
+ private static final LogMode[] LOG_MODES = new LogMode[] {
+ LogMode.inline, LogMode.popup
+ };
+
private LogMode mode = LogMode.inline;
private Character hotkey = 'l';
@@ -54,4 +58,7 @@
this.hotkey = hotkey;
}
+ public LogMode[] getLogModes() {
+ return LOG_MODES;
+ }
}
Modified: trunk/examples/core-demo/src/main/webapp/log.xhtml
===================================================================
--- trunk/examples/core-demo/src/main/webapp/log.xhtml 2011-01-12 20:08:46 UTC (rev 20973)
+++ trunk/examples/core-demo/src/main/webapp/log.xhtml 2011-01-12 20:30:22 UTC (rev 20974)
@@ -18,8 +18,7 @@
<h:panelGrid columns="2">
<h:outputText value="Mode: "/>
<h:selectOneMenu value="#{logBean.mode}" onchange="submit()">
- <f:selectItem itemValue="popup" />
- <f:selectItem itemValue="inline" />
+ <f:selectItems value="#{logBean.logModes}" />
</h:selectOneMenu>
<h:outputText value="Hotkey: "/>
Modified: trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js
===================================================================
--- trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js 2011-01-12 20:08:46 UTC (rev 20973)
+++ trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js 2011-01-12 20:30:22 UTC (rev 20974)
@@ -233,108 +233,111 @@
richfaces.HtmlLog = richfaces.BaseComponent.extendClass(logClassMethods);
// define super class link
var $super = richfaces.HtmlLog.$super;
-}(jQuery, RichFaces));
+
+ jQuery(document).ready(function() {
+ if (typeof jsf != 'undefined') {
+ (function(jQuery, richfaces, jsf) {
-if (typeof jsf != 'undefined') {
- (function(jQuery, richfaces, jsf) {
+ //JSF log adapter
+ var identifyElement = function(elt) {
+ var identifier = '<' + elt.tagName.toLowerCase();
+ var e = jQuery(elt);
+ if (e.attr('id')) {
+ identifier += (' id=' + e.attr('id'));
+ }
+ if (e.attr('class')) {
+ identifier += (' class=' + e.attr('class'));
+ }
- //JSF log adapter
- var identifyElement = function(elt) {
- var identifier = '<' + elt.tagName.toLowerCase();
- var e = jQuery(elt);
- if (e.attr('id')) {
- identifier += (' id=' + e.attr('id'));
- }
- if (e.attr('class')) {
- identifier += (' class=' + e.attr('class'));
- }
+ identifier += ' ...>';
- identifier += ' ...>';
+ return identifier;
+ }
- return identifier;
- }
+ var formatPartialResponseElement = function(logElement, responseElement) {
+ var change = jQuery(responseElement);
- var formatPartialResponseElement = function(logElement, responseElement) {
- var change = jQuery(responseElement);
+ logElement.append("Element <b>" + responseElement.nodeName + "</b>");
+ if (change.attr("id")) {
+ logElement.append(document.createTextNode(" for id=" + change.attr("id")));
+ }
- logElement.append("Element <b>" + responseElement.nodeName + "</b>");
- if (change.attr("id")) {
- logElement.append(document.createTextNode(" for id=" + change.attr("id")));
- }
+ jQuery(document.createElement("br")).appendTo(logElement);
+ jQuery("<span class='rf-log-entry-msg-xml'></span>").appendTo(logElement).text(change.toXML());
+ jQuery(document.createElement("br")).appendTo(logElement);
+ }
- jQuery(document.createElement("br")).appendTo(logElement);
- jQuery("<span class='rf-log-entry-msg-xml'></span>").appendTo(logElement).text(change.toXML());
- jQuery(document.createElement("br")).appendTo(logElement);
- }
+ var formatPartialResponse = function(partialResponse) {
+ var logElement = jQuery(document.createElement("span"));
- var formatPartialResponse = function(partialResponse) {
- var logElement = jQuery(document.createElement("span"));
+ partialResponse.children().each(function() {
+ var responseElement = jQuery(this);
+ if (responseElement.is('changes')) {
+ logElement.append("Listing content of response <b>changes</b> element:<br />");
+ responseElement.children().each(function() {
+ formatPartialResponseElement(logElement, this);
+ });
+ } else {
+ formatPartialResponseElement(logElement, this);
+ }
+ });
- partialResponse.children().each(function() {
- var responseElement = jQuery(this);
- if (responseElement.is('changes')) {
- logElement.append("Listing content of response <b>changes</b> element:<br />");
- responseElement.children().each(function() {
- formatPartialResponseElement(logElement, this);
- });
- } else {
- formatPartialResponseElement(logElement, this);
+ return logElement;
}
- });
- return logElement;
- }
+ var jsfAjaxLogAdapter = function(data) {
+ try {
+ var log = richfaces.log;
- var jsfAjaxLogAdapter = function(data) {
- try {
- var log = richfaces.log;
+ var source = data.source;
+ var type = data.type;
- var source = data.source;
- var type = data.type;
+ var responseCode = data.responseCode;
+ var responseXML = data.responseXML;
+ var responseText = data.responseText;
- var responseCode = data.responseCode;
- var responseXML = data.responseXML;
- var responseText = data.responseText;
+ if (type != 'error') {
+ log.info("Received '" + type + "' event from " + identifyElement(source));
- if (type != 'error') {
- log.info("Received '" + type + "' event from " + identifyElement(source));
+ if (type == 'beforedomupdate') {
+ var partialResponse;
- if (type == 'beforedomupdate') {
- var partialResponse;
+ if (responseXML) {
+ partialResponse = jQuery(responseXML).children("partial-response");
+ }
- if (responseXML) {
- partialResponse = jQuery(responseXML).children("partial-response");
- }
+ var responseTextEntry = jQuery("<span>Server returned responseText: </span><span class='rf-log-entry-msg-xml'></span>").eq(1).text(responseText).end();
- var responseTextEntry = jQuery("<span>Server returned responseText: </span><span class='rf-log-entry-msg-xml'></span>").eq(1).text(responseText).end();
-
- if (partialResponse && partialResponse.length) {
- log.debug(responseTextEntry);
- log.info(formatPartialResponse(partialResponse));
+ if (partialResponse && partialResponse.length) {
+ log.debug(responseTextEntry);
+ log.info(formatPartialResponse(partialResponse));
+ } else {
+ log.info(responseTextEntry);
+ }
+ }
} else {
- log.info(responseTextEntry);
+ var status = data.status;
+ log.error("Received '" + type + '@' + status + "' event from " + identifyElement(source));
+ log.error("[" + data.responseCode + "] " + data.errorName + ": " + data.errorMessage);
}
+ } catch (e) {
+ //ignore logging errors
}
- } else {
- var status = data.status;
- log.error("Received '" + type + '@' + status + "' event from " + identifyElement(source));
- log.error("[" + data.responseCode + "] " + data.errorName + ": " + data.errorMessage);
- }
- } catch (e) {
- //ignore logging errors
- }
- };
+ };
- var eventsListener = richfaces.createJSFEventsAdapter({
- begin: jsfAjaxLogAdapter,
- beforedomupdate: jsfAjaxLogAdapter,
- success: jsfAjaxLogAdapter,
- complete: jsfAjaxLogAdapter,
- error: jsfAjaxLogAdapter
- });
+ var eventsListener = richfaces.createJSFEventsAdapter({
+ begin: jsfAjaxLogAdapter,
+ beforedomupdate: jsfAjaxLogAdapter,
+ success: jsfAjaxLogAdapter,
+ complete: jsfAjaxLogAdapter,
+ error: jsfAjaxLogAdapter
+ });
- jsf.ajax.addOnEvent(eventsListener);
- jsf.ajax.addOnError(eventsListener);
- //
- }(jQuery, RichFaces, jsf));
-};
\ No newline at end of file
+ jsf.ajax.addOnEvent(eventsListener);
+ jsf.ajax.addOnError(eventsListener);
+ //
+ }(jQuery, RichFaces, jsf));
+ };
+ });
+
+}(jQuery, RichFaces));
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r20973 - trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-12 15:08:46 -0500 (Wed, 12 Jan 2011)
New Revision: 20973
Modified:
trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java
trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsTagHandlerDelegateFactoryImpl.java
Log:
https://issues.jboss.org/browse/RF-9025
https://issues.jboss.org/browse/RF-9138
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java 2011-01-12 19:40:52 UTC (rev 20972)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java 2011-01-12 20:08:46 UTC (rev 20973)
@@ -27,6 +27,7 @@
import javax.el.ELException;
import javax.faces.FacesException;
+import javax.faces.FacesWrapper;
import javax.faces.component.UIComponent;
import javax.faces.component.behavior.ClientBehaviorHolder;
import javax.faces.context.FacesContext;
@@ -38,7 +39,7 @@
/**
* @author Nick Belaevski
*/
-public class BehaviorsAddingComponentHandlerWrapper extends ComponentHandler {
+public class BehaviorsAddingComponentHandlerWrapper extends ComponentHandler implements FacesWrapper<ComponentHandler> {
private ComponentHandler componentHandler;
public BehaviorsAddingComponentHandlerWrapper(ComponentHandler componentHandler) {
@@ -63,6 +64,11 @@
}
public TagAttribute getTagAttribute(String localName) {
+ //workaround for MyFaces
+ if (componentHandler == null) {
+ return getComponentConfig().getTag().getAttributes().get(localName);
+ }
+
return componentHandler.getTagAttribute(localName);
}
@@ -108,4 +114,8 @@
public void setAttributes(FaceletContext ctx, Object instance) {
componentHandler.setAttributes(ctx, instance);
}
+
+ public ComponentHandler getWrapped() {
+ return componentHandler;
+ }
}
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsTagHandlerDelegateFactoryImpl.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsTagHandlerDelegateFactoryImpl.java 2011-01-12 19:40:52 UTC (rev 20972)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsTagHandlerDelegateFactoryImpl.java 2011-01-12 20:08:46 UTC (rev 20973)
@@ -23,9 +23,7 @@
package org.richfaces.view.facelets.html;
-import java.util.Locale;
-
-import javax.faces.application.Application;
+import javax.faces.FacesWrapper;
import javax.faces.view.facelets.BehaviorHandler;
import javax.faces.view.facelets.ComponentHandler;
import javax.faces.view.facelets.ConverterHandler;
@@ -33,40 +31,17 @@
import javax.faces.view.facelets.TagHandlerDelegateFactory;
import javax.faces.view.facelets.ValidatorHandler;
-import org.richfaces.log.RichfacesLogger;
-import org.richfaces.log.Logger;
-
/**
* @author Nick Belaevski
*/
-public class BehaviorsTagHandlerDelegateFactoryImpl extends TagHandlerDelegateFactory {
+public class BehaviorsTagHandlerDelegateFactoryImpl extends TagHandlerDelegateFactory implements FacesWrapper<TagHandlerDelegateFactory> {
- private static final Logger LOGGER = RichfacesLogger.WEBAPP.getLogger();
-
private TagHandlerDelegateFactory factory;
- private boolean isMyFaces = false;
-
public BehaviorsTagHandlerDelegateFactoryImpl(TagHandlerDelegateFactory factory) {
this.factory = factory;
- detectMyFaces();
}
- private void detectMyFaces() {
- String implementationTitle = Application.class.getPackage().getImplementationTitle();
- if (implementationTitle != null) {
- isMyFaces = implementationTitle.toLowerCase(Locale.US).contains("myfaces");
-
- if (isMyFaces) {
- //TODO - RF M3 workaround for https://jira.jboss.org/browse/RF-9025 / https://issues.apache.org/jira/browse/MYFACES-2888
- LOGGER.warn("MyFaces implementation of JavaServer Faces detected. "
- + "Wrapping of components using RichFaces behaviors (a4j:ajax etc.) won't work!");
- }
- } else {
- LOGGER.warn("Cannot detect Mojarra vs MyFaces implementation of JavaServer Faces");
- }
- }
-
/*
* (non-Javadoc)
* @see javax.faces.view.facelets.TagHandlerDelegateFactory#createBehaviorHandlerDelegate(javax.faces.view.facelets.BehaviorHandler)
@@ -86,13 +61,14 @@
// TagHandlers structure is created when view is compiled
// so there's no need to check for BehaviorsStack
- ComponentHandler handler = owner;
-
- if (!isMyFaces) {
- handler = new BehaviorsAddingComponentHandlerWrapper(owner);
+ if (owner instanceof BehaviorsAddingComponentHandlerWrapper) {
+ //this is to avoid StackOverflowError because of ComponentHandler constructor call
+ return null;
}
- return factory.createComponentHandlerDelegate(handler);
+ ComponentHandler wrappedHandler = new BehaviorsAddingComponentHandlerWrapper(owner);
+
+ return factory.createComponentHandlerDelegate(wrappedHandler);
}
/*
@@ -112,4 +88,8 @@
public TagHandlerDelegate createValidatorHandlerDelegate(ValidatorHandler owner) {
return factory.createValidatorHandlerDelegate(owner);
}
+
+ public TagHandlerDelegateFactory getWrapped() {
+ return factory;
+ }
}
13 years, 11 months
JBoss Rich Faces SVN: r20972 - trunk/ui/validator/ui/src/test/java/org/richfaces/validator.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-12 14:40:52 -0500 (Wed, 12 Jan 2011)
New Revision: 20972
Modified:
trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesConverterServiceTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesValidatorServiceTest.java
Log:
https://issues.jboss.org/browse/RF-9390
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesConverterServiceTest.java
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesConverterServiceTest.java 2011-01-12 19:16:35 UTC (rev 20971)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesConverterServiceTest.java 2011-01-12 19:40:52 UTC (rev 20972)
@@ -1,7 +1,8 @@
package org.richfaces.validator;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import java.util.HashMap;
import java.util.Locale;
@@ -52,7 +53,7 @@
serviceImpl = new ConverterServiceImpl();
expect(environment.getFacesContext().getViewRoot()).andStubReturn(viewRoot);
expect(viewRoot.getLocale()).andStubReturn(Locale.ENGLISH);
- expect(environment.getApplication().getMessageBundle()).andStubReturn("com.sun.faces.resources.Messages");
+ expect(environment.getApplication().getMessageBundle()).andStubReturn("javax.faces.Messages");
HashMap<String, Object> attributes = new HashMap<String, Object>();
attributes.put("label", "foo");
expect(input.getAttributes()).andStubReturn(attributes);
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesValidatorServiceTest.java
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesValidatorServiceTest.java 2011-01-12 19:16:35 UTC (rev 20971)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/validator/FacesValidatorServiceTest.java 2011-01-12 19:40:52 UTC (rev 20972)
@@ -1,7 +1,8 @@
package org.richfaces.validator;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import java.util.HashMap;
import java.util.Locale;
@@ -46,7 +47,7 @@
serviceImpl = new FacesValidatorServiceImpl();
expect(environment.getFacesContext().getViewRoot()).andStubReturn(viewRoot);
expect(viewRoot.getLocale()).andStubReturn(Locale.ENGLISH);
- expect(environment.getApplication().getMessageBundle()).andStubReturn("com.sun.faces.resources.Messages");
+ expect(environment.getApplication().getMessageBundle()).andStubReturn("javax.faces.Messages");
HashMap<String, Object> attributes = new HashMap<String, Object>();
attributes.put("label", "foo");
expect(input.getAttributes()).andStubReturn(attributes);
13 years, 11 months
JBoss Rich Faces SVN: r20971 - in trunk/cdk: parent and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-01-12 14:16:35 -0500 (Wed, 12 Jan 2011)
New Revision: 20971
Modified:
trunk/cdk/generator/pom.xml
trunk/cdk/parent/pom.xml
Log:
Complete - task : Update google guice to 3.0.RC2
Modified: trunk/cdk/generator/pom.xml
===================================================================
--- trunk/cdk/generator/pom.xml 2011-01-12 18:17:40 UTC (rev 20970)
+++ trunk/cdk/generator/pom.xml 2011-01-12 19:16:35 UTC (rev 20971)
@@ -168,11 +168,20 @@
<artifactId>javaparser</artifactId>
<scope>test</scope>
</dependency>
- <!-- <dependency> <groupId>com.google.code.guice</groupId> <artifactId>guice</artifactId>
- <version>1.0</version> </dependency> -->
+ <dependency>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-assistedinject</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-multibindings</artifactId>
+ </dependency>
- <!-- <dependency> <groupId>javax.inject</groupId> <artifactId>javax.inject</artifactId>
- <version>1</version> </dependency> -->
+ <!--
<dependency>
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-guice</artifactId>
@@ -182,5 +191,6 @@
<groupId>org.sonatype.sisu.inject</groupId>
<artifactId>guice-multibindings</artifactId>
</dependency>
+ -->
</dependencies>
</project>
Modified: trunk/cdk/parent/pom.xml
===================================================================
--- trunk/cdk/parent/pom.xml 2011-01-12 18:17:40 UTC (rev 20970)
+++ trunk/cdk/parent/pom.xml 2011-01-12 19:16:35 UTC (rev 20971)
@@ -151,13 +151,11 @@
<artifactId>sisu-guice</artifactId>
<version>2.9.0</version>
</dependency>
- <!--
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
- <version>2.0</version>
+ <version>3.0-rc2</version>
</dependency>
- -->
<dependency>
<groupId>org.sonatype.sisu.inject</groupId>
<artifactId>guice-multibindings</artifactId>
@@ -172,13 +170,18 @@
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-grapher</artifactId>
- <version>2.0</version>
+ <version>3.0-rc2</version>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
- <artifactId>guice-assisted-inject</artifactId>
- <version>2.0</version>
+ <artifactId>guice-assistedinject</artifactId>
+ <version>3.0-rc2</version>
</dependency>
+ <dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-multibindings</artifactId>
+ <version>3.0-rc2</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-guice</artifactId>
13 years, 11 months
JBoss Rich Faces SVN: r20970 - trunk/ui/input/ui/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-01-12 13:17:40 -0500 (Wed, 12 Jan 2011)
New Revision: 20970
Modified:
trunk/ui/input/ui/src/main/templates/input.template.inc
trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml
Log:
RF-9860
Modified: trunk/ui/input/ui/src/main/templates/input.template.inc
===================================================================
--- trunk/ui/input/ui/src/main/templates/input.template.inc 2011-01-12 18:07:12 UTC (rev 20969)
+++ trunk/ui/input/ui/src/main/templates/input.template.inc 2011-01-12 18:17:40 UTC (rev 20970)
@@ -25,6 +25,6 @@
<span class="rf-insl-inp-cntr">
<input xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core" name="#{clientId}" type="text"
class="rf-insl-inp #{component.attributes['inputClass']}" value="#{getInputValue(facesContext, component)}"
- cdk:passThrough="accesskey disabled maxlength size:inputSize tabindex" readonly="#{!component.attributes['enableManualInput']}"
- style="#{component.attributes['showInput'] ? null : 'display: none;'}" />
+ cdk:passThrough="accesskey disabled size:inputSize tabindex" readonly="#{!component.attributes['enableManualInput']}"
+ style="#{component.attributes['showInput'] ? null : 'display: none;'}" maxlength="#{maxlength > 0 ? maxlength : null}"/>
</span>
\ No newline at end of file
Modified: trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml 2011-01-12 18:07:12 UTC (rev 20969)
+++ trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml 2011-01-12 18:17:40 UTC (rev 20970)
@@ -39,6 +39,7 @@
</cc:interface>
<cc:implementation>
<span id="#{clientId}" class="rf-insl #{component.attributes['styleClass']}" cdk:passThroughWithExclusions="id class">
+ <cdk:call expression='int maxlength = (Integer) component.getAttributes().get("maxlength");' />
<c:if test="#{isInputPosition(component, 'left') || isInputPosition(component, 'top')}">
<xi:include xpointer="xpointer(/*)" href="input.template.inc" />
<c:if test="#{isInputPosition(component, 'top') and component.attributes['showInput']}">
13 years, 11 months
JBoss Rich Faces SVN: r20969 - trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-12 13:07:12 -0500 (Wed, 12 Jan 2011)
New Revision: 20969
Modified:
trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java
Log:
https://issues.jboss.org/browse/RF-9390
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java 2011-01-12 16:59:48 UTC (rev 20968)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java 2011-01-12 18:07:12 UTC (rev 20969)
@@ -30,7 +30,6 @@
import javax.faces.component.UIComponent;
import javax.faces.component.behavior.ClientBehaviorHolder;
import javax.faces.context.FacesContext;
-import javax.faces.view.facelets.ComponentConfig;
import javax.faces.view.facelets.ComponentHandler;
import javax.faces.view.facelets.FaceletContext;
import javax.faces.view.facelets.Tag;
@@ -59,10 +58,6 @@
return componentHandler.getBinding();
}
- public ComponentConfig getComponentConfig() {
- return componentHandler.getComponentConfig();
- }
-
public Tag getTag() {
return componentHandler.getTag();
}
13 years, 11 months
JBoss Rich Faces SVN: r20967 - trunk/ui/iteration/ui/src/main/java/org/richfaces/event.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-01-12 11:57:11 -0500 (Wed, 12 Jan 2011)
New Revision: 20967
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java
Log:
RF-10120
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java 2011-01-12 16:32:59 UTC (rev 20966)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java 2011-01-12 16:57:11 UTC (rev 20967)
@@ -121,52 +121,49 @@
}
String scrollerStateKey = dataTable.getClientId(facesContext) + AbstractDataScroller.SCROLLER_STATE_ATTRIBUTE;
- boolean processed = dataTable.getAttributes().containsKey(scrollerStateKey);
- if(!processed) {
- if ((activeDataScroller != null) && (dataTable != null)) {
- int rowCount = DataScrollerUtils.getRowCount(dataTable);
- int rows = DataScrollerUtils.getRows(dataTable);
- int pageCount = DataScrollerUtils.getPageCount(dataTable, rowCount, rows);
-
- int page = activeDataScroller.getPage();
- int newPage = -1;
+ if ((activeDataScroller != null) && (dataTable != null)) {
+ int rowCount = DataScrollerUtils.getRowCount(dataTable);
+ int rows = DataScrollerUtils.getRows(dataTable);
+ int pageCount = DataScrollerUtils.getPageCount(dataTable, rowCount, rows);
+
+ int page = activeDataScroller.getPage();
+ int newPage = -1;
- if (page < 1) {
- newPage = 1;
- } else if (page > pageCount) {
- newPage = (pageCount != 0 ? pageCount : 1);
- }
+ if (page < 1) {
+ newPage = 1;
+ } else if (page > pageCount) {
+ newPage = (pageCount != 0 ? pageCount : 1);
+ }
- if (newPage != -1) {
- Object label = MessageUtil.getLabel(facesContext, activeDataScroller);
- String formattedMessage = Messages.getMessage(Messages.DATASCROLLER_PAGE_MISSING, new Object[] { label,
- page, pageCount, newPage });
+ if (newPage != -1) {
+ Object label = MessageUtil.getLabel(facesContext, activeDataScroller);
+ String formattedMessage = Messages.getMessage(Messages.DATASCROLLER_PAGE_MISSING, new Object[] { label,
+ page, pageCount, newPage });
- LOG.warn(formattedMessage);
- page = newPage;
- dataTable.getAttributes().put(scrollerStateKey, page);
- }
+ LOG.warn(formattedMessage);
+ page = newPage;
+ dataTable.getAttributes().put(scrollerStateKey, page);
+ }
- int first;
- String lastPageMode = activeDataScroller.getLastPageMode();
+ int first;
+ String lastPageMode = activeDataScroller.getLastPageMode();
- if (lastPageMode == null) {
- lastPageMode = AbstractDataScroller.PAGEMODE_SHORT;
- } else if (!AbstractDataScroller.PAGEMODE_SHORT.equals(lastPageMode)
- && !AbstractDataScroller.PAGEMODE_FULL.equals(lastPageMode)) {
- throw new IllegalArgumentException("Illegal value of 'lastPageMode' attribute: '" + lastPageMode + "'");
- }
+ if (lastPageMode == null) {
+ lastPageMode = AbstractDataScroller.PAGEMODE_SHORT;
+ } else if (!AbstractDataScroller.PAGEMODE_SHORT.equals(lastPageMode)
+ && !AbstractDataScroller.PAGEMODE_FULL.equals(lastPageMode)) {
+ throw new IllegalArgumentException("Illegal value of 'lastPageMode' attribute: '" + lastPageMode + "'");
+ }
- if (page != pageCount || AbstractDataScroller.PAGEMODE_SHORT.equals(lastPageMode)) {
- first = (page - 1) * rows;
- } else {
- first = rowCount - rows;
- if (first < 0) {
- first = 0;
- }
+ if (page != pageCount || AbstractDataScroller.PAGEMODE_SHORT.equals(lastPageMode)) {
+ first = (page - 1) * rows;
+ } else {
+ first = rowCount - rows;
+ if (first < 0) {
+ first = 0;
}
- dataTable.getAttributes().put("first", first);
}
+ dataTable.getAttributes().put("first", first);
}
}
13 years, 11 months
JBoss Rich Faces SVN: r20966 - trunk/core/impl/src/test/java/org/richfaces/context.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-12 11:32:59 -0500 (Wed, 12 Jan 2011)
New Revision: 20966
Modified:
trunk/core/impl/src/test/java/org/richfaces/context/ExtendedPartialVisitContextTest.java
Log:
https://issues.jboss.org/browse/RF-9390
Modified: trunk/core/impl/src/test/java/org/richfaces/context/ExtendedPartialVisitContextTest.java
===================================================================
--- trunk/core/impl/src/test/java/org/richfaces/context/ExtendedPartialVisitContextTest.java 2011-01-12 16:11:26 UTC (rev 20965)
+++ trunk/core/impl/src/test/java/org/richfaces/context/ExtendedPartialVisitContextTest.java 2011-01-12 16:32:59 UTC (rev 20966)
@@ -46,7 +46,6 @@
import javax.faces.application.Application;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIData;
import javax.faces.component.UIForm;
import javax.faces.component.UIOutput;
import javax.faces.component.UIViewRoot;
@@ -515,19 +514,6 @@
assertSame(VisitContext.ALL_IDS, renderingContext.getSubtreeIdsToVisit(table));
assertSame(VisitContext.ALL_IDS, renderingContext.getDirectSubtreeIdsToVisit(table));
-
- for (int i = 0; i < tableData.size(); i++) {
- table.setRowIndex(i);
-
- assertSame(VisitContext.ALL_IDS, renderingContext.getSubtreeIdsToVisit(table));
- assertEqualSets(asSet("nestedText", "nestedTable", "nestedOutput"),
- renderingContext.getDirectSubtreeIdsToVisit(table));
-
- assertSame(VisitContext.ALL_IDS, renderingContext.getSubtreeIdsToVisit(nestedTable));
- assertEqualSets(asSet("0"), renderingContext.getDirectSubtreeIdsToVisit(nestedTable));
- }
-
- table.setRowIndex(-1);
}
@Test
@@ -541,18 +527,6 @@
assertSame(VisitContext.ALL_IDS, renderingContext.getSubtreeIdsToVisit(table));
assertSame(VisitContext.ALL_IDS, renderingContext.getDirectSubtreeIdsToVisit(table));
-
- for (int i = 0; i < tableData.size(); i++) {
- table.setRowIndex(i);
-
- assertSame(VisitContext.ALL_IDS, renderingContext.getSubtreeIdsToVisit(table));
- assertEqualSets(asSet("nestedText", "nestedTable"), renderingContext.getDirectSubtreeIdsToVisit(table));
-
- assertSame(VisitContext.ALL_IDS, renderingContext.getSubtreeIdsToVisit(nestedTable));
- assertEqualSets(asSet("0"), renderingContext.getDirectSubtreeIdsToVisit(nestedTable));
- }
-
- table.setRowIndex(-1);
}
@Test
@@ -566,16 +540,6 @@
assertSame(VisitContext.ALL_IDS, renderingContext.getSubtreeIdsToVisit(table));
assertSame(VisitContext.ALL_IDS, renderingContext.getDirectSubtreeIdsToVisit(table));
- for (int i = 0; i < tableData.size(); i++) {
- table.setRowIndex(i);
-
- assertSame(VisitContext.ALL_IDS, renderingContext.getSubtreeIdsToVisit(table));
- assertEqualSets(asSet("nestedTable"), renderingContext.getDirectSubtreeIdsToVisit(table));
-
- assertTrue(renderingContext.getSubtreeIdsToVisit(nestedTable).isEmpty());
- assertTrue(renderingContext.getDirectSubtreeIdsToVisit(nestedTable).isEmpty());
- }
-
table.setRowIndex(-1);
}
@@ -613,15 +577,14 @@
public void testVisitCallback() throws Exception {
createVisitContext(false);
- renderingContext.getIdsToVisit().add("myForm:table:1:nestedTable:0");
renderingContext.getIdsToVisit().add("myForm:table:1:nestedTable:1:nestedTableText");
renderingContext.getIdsToVisit().add("myForm:table:1:nestedTable:nestedTableFooter");
viewRoot.visitTree(renderingContext, trackingVisitCallback);
assertEquals(Arrays.asList("myForm:outerOutput", "myForm:table:0:nestedOutput", "myForm:table:1:nestedOutput",
- "myForm:table:1:nestedTable:nestedTableFooter", "myForm:table:1:nestedTable:0",
- "myForm:table:1:nestedTable:1:nestedTableText"), trackingVisitCallback.getVisitedIds());
+ "myForm:table:1:nestedTable:nestedTableFooter", "myForm:table:1:nestedTable:1:nestedTableText"),
+ trackingVisitCallback.getVisitedIds());
}
@Test
13 years, 11 months
JBoss Rich Faces SVN: r20965 - trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-01-12 11:11:26 -0500 (Wed, 12 Jan 2011)
New Revision: 20965
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
Log:
RF-7841
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2011-01-12 12:56:03 UTC (rev 20964)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2011-01-12 16:11:26 UTC (rev 20965)
@@ -25,6 +25,8 @@
var UID_ALT = "rf_fu_uid_alt";
+ var FAKE_PATH = "C:\\fakepath\\";
+
var ITEM_HTML = '<div class="rf-fu-itm">'
+ '<span class="rf-fu-itm-lft"><span class="rf-fu-itm-lbl"/><span class="rf-fu-itm-st"/></span>'
+ '<span class="rf-fu-itm-rgh"><a href="javascript:void(0)" class="rf-fu-itm-lnk"/></span></div>';
@@ -101,10 +103,19 @@
__addItem: function() {
var fileName = this.input.val();
+ if (!navigator.platform.indexOf("Win")) {
+ fileName = fileName.match(/[^\\]*$/)[0];
+ } else {
+ if (!fileName.indexOf(FAKE_PATH)) {
+ fileName = fileName.substr(FAKE_PATH.length);
+ } else {
+ fileName = fileName.match(/[^\/]*$/)[0];
+ }
+ }
if (this.__accept(fileName) && (!this.noDuplicate || !this.__isFileAlreadyAdded(fileName))) {
this.input.hide();
this.input.unbind("change", this.addProxy);
- var item = new Item(this);
+ var item = new Item(this, fileName);
this.list.append(item.getJQuery());
this.items.push(item);
this.input = this.cleanInput.clone();
@@ -222,10 +233,10 @@
}
});
- var Item = function(fileUpload) {
+ var Item = function(fileUpload, fileName) {
this.fileUpload = fileUpload;
this.input = fileUpload.input;
- this.model = {name: this.input.val(), state: ITEM_STATE.NEW};
+ this.model = {name: fileName, state: ITEM_STATE.NEW};
};
jQuery.extend(Item.prototype, {
13 years, 11 months
JBoss Rich Faces SVN: r20964 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richColumn and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-12 07:56:03 -0500 (Wed, 12 Jan 2011)
New Revision: 20964
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/comparator.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/filtering.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/sorting.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/simple.xhtml
Log:
rich:column - initial samples ready for automation (RFPL-729)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java 2011-01-12 12:53:23 UTC (rev 20963)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java 2011-01-12 12:56:03 UTC (rev 20964)
@@ -22,30 +22,52 @@
package org.richfaces.tests.metamer.bean;
import java.io.Serializable;
+import java.util.Comparator;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.SessionScoped;
+import javax.faces.bean.ViewScoped;
+import org.richfaces.component.SortOrder;
import org.richfaces.component.UIColumn;
+import org.richfaces.model.Filter;
import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.Capital;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Managed bean for rich:column
- *
+ *
* @author <a href="mailto:pjha@redhat.com">Prabhat Jha</a>, <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
@ManagedBean(name = "richColumnBean")
-@SessionScoped
+@ViewScoped
public class RichColumnBean implements Serializable {
+ public static final Comparator<Capital> STATE_NAME_LENGTH_COMPARATOR = new Comparator<Capital>() {
+ @Override
+ public int compare(Capital o1, Capital o2) {
+ return o1.getState().length() - o2.getState().length();
+ }
+ };
+
private static final long serialVersionUID = -1L;
private static Logger logger;
- private Attributes attributes;
-
+
+ private Attributes attributes;
+ private String stateNameToFilter;
+ private SortOrder sortOrder = SortOrder.ascending;
+
+ private final Filter<Capital> stateFilter = new Filter<Capital>() {
+
+ @Override
+ public boolean accept(Capital c) {
+ return c.getState().toLowerCase().contains(stateNameToFilter == null ? "" : stateNameToFilter.toLowerCase());
+ }
+ };
+
/**
* Initializes the managed bean.
*/
@@ -55,9 +77,18 @@
logger.debug("initializing bean " + getClass().getName());
attributes = Attributes.getComponentAttributesFromFacesConfig(UIColumn.class, getClass());
- attributes.setAttribute("colspan", 1);
attributes.setAttribute("rendered", true);
- attributes.setAttribute("rowspan", 1);
+ attributes.setAttribute("colspan", 2);
+ attributes.setAttribute("rowspan", 2);
+ attributes.setAttribute("breakRowBefore", true);
+
+ // attributes which needs to be tested another way
+ attributes.remove("filter");
+ attributes.remove("filterValue");
+ attributes.remove("filterExpression");
+ attributes.remove("comparator");
+ attributes.remove("sortBy");
+ attributes.remove("sortOrder");
}
public Attributes getAttributes() {
@@ -68,5 +99,31 @@
this.attributes = attributes;
}
+ public Comparator<Capital> getStateNameLengthComparator() {
+ return STATE_NAME_LENGTH_COMPARATOR;
+ }
+
+ public Filter<Capital> getStateNameFilter() {
+ return stateFilter;
+ }
+ public String getStateNameToFilter() {
+ return stateNameToFilter;
+ }
+
+ public void setStateNameToFilter(String stateNameToFilter) {
+ this.stateNameToFilter = stateNameToFilter;
+ }
+
+ public SortOrder[] getSortOrders() {
+ return SortOrder.values();
+ }
+
+ public void setSortOrder(SortOrder sortOrder) {
+ this.sortOrder = sortOrder;
+ }
+
+ public SortOrder getSortOrder() {
+ return sortOrder;
+ }
}
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/comparator.xhtml (from rev 20961, modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/simple.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/comparator.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/comparator.xhtml 2011-01-12 12:56:03 UTC (rev 20964)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+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.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richDataTable" />
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <h:form id="attributes">
+ <fieldset>
+ <h:panelGrid columns="2">
+ <h:outputLabel for="sortOrderInput" value="Sort Order:" />
+ <h:selectOneRadio id="sortOrderInput" value="#{richColumnBean.sortOrder}">
+ <f:selectItems value="#{richColumnBean.sortOrders}" />
+ <a4j:ajax render="#{nestedComponentId}" />
+ </h:selectOneRadio>
+ </h:panelGrid>
+ </fieldset>
+ </h:form>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable"
+ rendered="true"
+ value="#{model.capitals}"
+ var="record">
+
+ <f:facet name="header">
+ <rich:column>
+ Sorted by custom <tt>comparator</tt>
+ </rich:column>
+ </f:facet>
+
+ <rich:column id="columnState" comparator="#{richColumnBean.stateNameLengthComparator}" sortOrder="#{richColumnBean.sortOrder}">
+ <f:facet name="header">State</f:facet>
+ <h:outputText id="state" value="#{record.state}" />
+ </rich:column>
+
+ <rich:column id="columnCapital">
+ <f:facet name="header">Capital</f:facet>
+ <h:outputText id="capital" value="#{record.name}" />
+ </rich:column>
+ </rich:dataTable>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/filtering.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/filtering.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/filtering.xhtml 2011-01-12 12:56:03 UTC (rev 20964)
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:fn="http://java.sun.com/jsp/jstl/functions">
+
+ <!--
+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.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <fieldset>
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Filter State:" for="stateNameToFilter" />
+ <h:inputText id="stateNameToFilter" value="#{richColumnBean.stateNameToFilter}">
+ <a4j:ajax event="keyup" render="#{nestedPrefix}richDataTable1 #{nestedPrefix}richDataTable2" />
+ </h:inputText>
+ </h:panelGrid>
+ </fieldset>
+
+ </ui:define>
+
+ <ui:define name="component">
+
+ <h:panelGrid columns="3">
+ <rich:dataTable id="richDataTable1"
+ rendered="true"
+ value="#{model.capitals}"
+ var="record">
+
+ <f:facet name="header">
+ <rich:column>Filter by <tt>filter</tt></rich:column>
+ </f:facet>
+
+ <rich:column id="columnState1" filter="#{richColumnBean.stateNameFilter}">
+ <f:facet name="header">State</f:facet>
+ <h:outputText id="state" value="#{record.state}" />
+ </rich:column>
+
+ <rich:column id="columnCapital1">
+ <f:facet name="header">Capital</f:facet>
+ <h:outputText id="capital" value="#{record.name}" />
+ </rich:column>
+ </rich:dataTable>
+
+ <rich:dataTable id="richDataTable2"
+ rendered="true"
+ value="#{model.capitals}"
+ var="record">
+
+ <f:facet name="header">
+ <rich:column>Filter by <tt>filterExpression</tt></rich:column>
+ </f:facet>
+
+ <rich:column id="columnState2" filterExpression="#{fn:contains(fn:toLowerCase(record.state), fn:toLowerCase(richColumnBean.stateNameToFilter))}">
+ <f:facet name="header">State</f:facet>
+ <h:outputText id="state" value="#{record.state}" />
+ </rich:column>
+
+ <rich:column id="columnCapital2">
+ <f:facet name="header">Capital</f:facet>
+ <h:outputText id="capital" value="#{record.name}" />
+ </rich:column>
+ </rich:dataTable>
+ </h:panelGrid>
+
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/list.xhtml 2011-01-12 12:53:23 UTC (rev 20963)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/list.xhtml 2011-01-12 12:56:03 UTC (rev 20964)
@@ -34,7 +34,19 @@
<metamer:testPageLink id="simple" outcome="simple" value="Simple">
Simple page that contains a table with two columns
</metamer:testPageLink>
-
+
+ <metamer:testPageLink id="comparator" outcome="comparator" value="Custom Comparator">
+ Data table with first column with customized sorting (sorted by length of the state name) using <tt>Comparator<?></tt>
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="sorting" outcome="sorting" value="Sorting">
+ Data table with first column with customized sorting (sorted by length of the state name) using expression
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="filtering" outcome="filtering" value="Filtering">
+ Two data tables with first column filtered by custom <tt>Filter<?></tt> and by expression
+ </metamer:testPageLink>
+
</ui:define>
</ui:composition>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/simple.xhtml 2011-01-12 12:53:23 UTC (rev 20963)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/simple.xhtml 2011-01-12 12:56:03 UTC (rev 20964)
@@ -41,44 +41,34 @@
</ui:define>
<ui:define name="component">
-
<rich:dataTable id="richDataTable"
rendered="true"
value="#{model.capitals}"
rows="5"
var="record">
+ <f:facet name="header">
+ <rich:columnGroup>
+ <rich:column colspan="#{richColumnBean.attributes['colspan'].value}"><tt>colspan=#{richColumnBean.attributes['colspan'].value}</tt></rich:column>
+ <rich:column breakRowBefore="#{richColumnBean.attributes['breakRowBefore'].value}"><tt>breakBefore=#{richColumnBean.attributes['breakRowBefore'].value}</tt></rich:column>
+ <rich:column rowspan="#{richColumnBean.attributes['rowspan'].value}"><tt>rowspan=#{richColumnBean.attributes['rowspan'].value}</tt></rich:column>
+ <rich:column breakRowBefore="true">Dummy</rich:column>
+ <rich:column breakRowBefore="#{richColumnBean.attributes['rowspan'].value > 1}">Breaked by <tt>rowspan</tt> > 1</rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
<rich:column id="columnState"
- breakRowBefore="#{richColumnBean.attributes['breakRowBefore'].value}"
- colspan="#{richColumnBean.attributes['colspan'].value}"
comparator="#{richColumnBean.attributes['comparator'].value}"
filter="#{richColumnBean.attributes['filter'].value}"
filterValue="#{richColumnBean.attributes['filterValue'].value}"
rendered="#{richColumnBean.attributes['rendered'].value}"
- rowspan="#{richColumnBean.attributes['rowspan'].value}"
sortOrder="#{richColumnBean.attributes['sortOrder'].value}"
- >
- <f:facet name="header">
- <h:outputText id="columnHeaderState" value="State" />
- </f:facet>
-
+ >
<h:outputText id="state" value="#{record.state}" />
-
- <f:facet name="footer">
- <h:outputText id="columnFooterState" value="State" />
- </f:facet>
</rich:column>
<rich:column id="columnCapital">
- <f:facet name="header">
- <h:outputText id="columnHeaderCapital" value="Capital" />
- </f:facet>
-
<h:outputText id="capital" value="#{record.name}" />
-
- <f:facet name="footer">
- <h:outputText id="columnFooterCapital" value="Capital" />
- </f:facet>
</rich:column>
</rich:dataTable>
</ui:define>
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/sorting.xhtml (from rev 20961, modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/simple.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/sorting.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/sorting.xhtml 2011-01-12 12:56:03 UTC (rev 20964)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:fn="http://java.sun.com/jsp/jstl/functions">
+
+ <!--
+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.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richDataTable" />
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <h:form id="attributes">
+ <fieldset>
+ <h:panelGrid columns="2">
+ <h:outputLabel for="sortOrderInput" value="Sort Order:" />
+ <h:selectOneRadio id="sortOrderInput" value="#{richColumnBean.sortOrder}">
+ <f:selectItems value="#{richColumnBean.sortOrders}" />
+ <a4j:ajax render="#{nestedComponentId}" />
+ </h:selectOneRadio>
+ </h:panelGrid>
+ </fieldset>
+ </h:form>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable"
+ rendered="true"
+ value="#{model.capitals}"
+ var="record">
+
+ <f:facet name="header">
+ <rich:column>
+ <tt>sortBy="\#{fn:length(record.state)}"</tt>
+ </rich:column>
+ </f:facet>
+
+ <rich:column id="columnState" sortBy="#{fn:length(record.state)}" sortOrder="#{richColumnBean.sortOrder}">
+ <f:facet name="header">State</f:facet>
+ <h:outputText id="state" value="#{record.state}" />
+ </rich:column>
+
+ <rich:column id="columnCapital">
+ <f:facet name="header">Capital</f:facet>
+ <h:outputText id="capital" value="#{record.name}" />
+ </rich:column>
+ </rich:dataTable>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
13 years, 11 months