JBoss Rich Faces SVN: r22417 - trunk/ui/iteration/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-04-12 12:26:12 -0400 (Tue, 12 Apr 2011)
New Revision: 22417
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java
Log:
RF-10851 Reviewer: Nick Belaevski
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java 2011-04-12 14:28:57 UTC (rev 22416)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java 2011-04-12 16:26:12 UTC (rev 22417)
@@ -75,7 +75,7 @@
public abstract Comparator<?> getComparator();
@Attribute
- public abstract Boolean isFilterExpression();
+ public abstract Object getFilterExpression();
@Attribute
public abstract Object getSortBy();
13 years
JBoss Rich Faces SVN: r22416 - branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-04-12 10:28:57 -0400 (Tue, 12 Apr 2011)
New Revision: 22416
Modified:
branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java
Log:
RF-10851 Reviewer: Nick Belaevski
Modified: branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java
===================================================================
--- branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java 2011-04-12 12:19:34 UTC (rev 22415)
+++ branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractColumn.java 2011-04-12 14:28:57 UTC (rev 22416)
@@ -75,7 +75,7 @@
public abstract Comparator<?> getComparator();
@Attribute
- public abstract Boolean isFilterExpression();
+ public abstract Object getFilterExpression();
@Attribute
public abstract Object getSortBy();
13 years
JBoss Rich Faces SVN: r22415 - in trunk/ui/output/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-12 08:19:34 -0400 (Tue, 12 Apr 2011)
New Revision: 22415
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
Log:
https://issues.jboss.org/browse/RF-10626
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2011-04-12 10:31:45 UTC (rev 22414)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2011-04-12 12:19:34 UTC (rev 22415)
@@ -23,11 +23,6 @@
package org.richfaces.component;
-import org.richfaces.PanelMenuMode;
-import org.richfaces.cdk.annotations.*;
-import org.richfaces.event.ItemChangeEvent;
-import org.richfaces.event.PanelToggleEvent;
-
import javax.el.MethodExpression;
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
@@ -35,6 +30,15 @@
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
+import org.richfaces.PanelMenuMode;
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.event.ItemChangeEvent;
+import org.richfaces.event.PanelToggleEvent;
+
/**
* @author akolonitsky
* @since 2010-10-25
@@ -82,11 +86,44 @@
Boolean previous = (Boolean) getValue();
setExpanded(expanded);
setSubmittedExpanded(null);
+
if (previous != null && !previous.equals(expanded)) {
+ if (expanded && getMode() == PanelMenuMode.server && getPanelMenu().isExpandSingle()) {
+ collapseOtherTopGroups();
+ }
+
queueEvent(new PanelToggleEvent(this, previous));
}
}
+ private AbstractPanelMenuGroup getTopGroup() {
+ AbstractPanelMenuGroup c = this;
+
+ while (c.getParent() instanceof AbstractPanelMenuGroup) {
+ c = (AbstractPanelMenuGroup) c.getParent();
+ }
+
+ return c;
+ }
+
+ private void collapseOtherTopGroups() {
+ UIComponent topGroup = getTopGroup();
+ for (UIComponent child: getPanelMenu().getChildren()) {
+ if (!(child instanceof AbstractPanelMenuGroup)) {
+ continue;
+ }
+
+ AbstractPanelMenuGroup group = (AbstractPanelMenuGroup) child;
+
+ if (group == topGroup) {
+ continue;
+ }
+
+ group.setSubmittedExpanded(null);
+ group.setExpanded(false);
+ }
+ }
+
private void executeValidate(FacesContext context) {
try {
validate(context);
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js 2011-04-12 10:31:45 UTC (rev 22414)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js 2011-04-12 12:19:34 UTC (rev 22415)
@@ -195,11 +195,11 @@
return item.itemName == this.activeItem;
},
- __collapseGroups : function (event) {
- var topGroup = rf.$(event.target.id).__rfTopGroup();
+ __collapseGroups : function (source) {
+ var topGroup = source.__rfTopGroup();
this.__childGroups().each (function (index, group) {
- if (group.id != event.target.id && (!topGroup || group.id != topGroup.id)) {
- rf.$(group.id).__collapse();
+ if (group.id != source.getEventElement() && (!topGroup || group.id != topGroup.id)) {
+ rf.$(group).__collapse();
}
});
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2011-04-12 10:31:45 UTC (rev 22414)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2011-04-12 12:19:34 UTC (rev 22415)
@@ -203,14 +203,6 @@
});
}
- if (menuGroup.options.expandSingle) {
- var component = this;
- menuGroup.__group().bind("expand", function (event) {
- component.__rfPanelMenu().__collapseGroups(event);
- event.stopPropagation();
- });
- }
-
/*this.__addUserEventHandler("beforecollapse");
this.__addUserEventHandler("collapse");
this.__addUserEventHandler("beforeexpand");
@@ -238,7 +230,9 @@
__expand : function () {
this.__updateStyles(true);
- return this.__fireEvent("expand");
+ this.__collapseForExpandSingle();
+
+ return this.__fireEvent("expand");
},
collapsed : function () {
@@ -350,6 +344,12 @@
return this.__expandValueInput().value == "true";
},
+ __collapseForExpandSingle: function() {
+ if (this.options.expandSingle) {
+ this.__rfPanelMenu().__collapseGroups(this);
+ }
+ },
+
/**
* @methodOf
* @name PanelMenuGroup#__setExpandValue
@@ -367,6 +367,10 @@
},
__changeState : function () {
+ if (!this.__getExpandValue()) {
+ this.__collapseForExpandSingle();
+ }
+
var state = {};
state["expanded"] = this.__setExpandValue(!this.__getExpandValue());
if (this.options.selectable) {
13 years
JBoss Rich Faces SVN: r22414 - in trunk/examples/richfaces-showcase/src/main: webapp/richfaces/extendedDataTable and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-04-12 06:31:45 -0400 (Tue, 12 Apr 2011)
New Revision: 22414
Modified:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/ExtTableSelectionBean.java
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/exTableSelection.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/samples/exTableSelection-sample.xhtml
Log:
merge with 4.1.0
http://jira.jboss.org/browse/RF-10843
+ fixed non-working EDT selection sample. (injection errors after switching to @viewScope)
Modified: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/ExtTableSelectionBean.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/ExtTableSelectionBean.java 2011-04-12 09:49:44 UTC (rev 22413)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/ExtTableSelectionBean.java 2011-04-12 10:31:45 UTC (rev 22414)
@@ -7,28 +7,29 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
-import javax.faces.bean.SessionScoped;
+import javax.faces.bean.ViewScoped;
import javax.faces.event.AjaxBehaviorEvent;
import org.richfaces.component.UIExtendedDataTable;
import org.richfaces.demo.tables.model.cars.InventoryItem;
@ManagedBean
-@SessionScoped
-public class ExtTableSelectionBean implements Serializable{
+@ViewScoped
+public class ExtTableSelectionBean implements Serializable {
+ private String selectionMode="multiple";
private Collection<Object> selection;
@ManagedProperty(value = "#{carsBean.allInventoryItems}")
private List<InventoryItem> inventoryItems;
private List<InventoryItem> selectionItems = new ArrayList<InventoryItem>();
-
- public void selectionListener(AjaxBehaviorEvent event){
- UIExtendedDataTable dataTable = (UIExtendedDataTable)event.getComponent();
+
+ public void selectionListener(AjaxBehaviorEvent event) {
+ UIExtendedDataTable dataTable = (UIExtendedDataTable) event.getComponent();
Object originalKey = dataTable.getRowKey();
selectionItems.clear();
- for (Object selectionKey: selection) {
+ for (Object selectionKey : selection) {
dataTable.setRowKey(selectionKey);
- if (dataTable.isRowAvailable()){
- selectionItems.add((InventoryItem)dataTable.getRowData());
+ if (dataTable.isRowAvailable()) {
+ selectionItems.add((InventoryItem) dataTable.getRowData());
}
}
dataTable.setRowKey(originalKey);
@@ -57,4 +58,12 @@
public void setSelectionItems(List<InventoryItem> selectionItems) {
this.selectionItems = selectionItems;
}
+
+ public String getSelectionMode() {
+ return selectionMode;
+ }
+
+ public void setSelectionMode(String selectionMode) {
+ this.selectionMode = selectionMode;
+ }
}
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/exTableSelection.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/exTableSelection.xhtml 2011-04-12 09:49:44 UTC (rev 22413)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/exTableSelection.xhtml 2011-04-12 10:31:45 UTC (rev 22414)
@@ -8,11 +8,12 @@
<p>This example demonstrates selection management using the built-in selection functionality.</p>
<p>The <b>selectionMode</b> attribute, which controls the selection mode, has three possible values:</p>
<ul>
+<li>none</li>
+<li>single</li>
<li>multiple</li>
-<li>single</li>
-<li>none</li>
+<li>multipleKeyboardFree - <b>new!</b></li>
</ul>
-<p>To manage your selection, use the <b>selection</b> attribute, which points to
+<p>To manage your selection at server-side, use the <b>selection</b> attribute, which points to
a collection of objects. The collection holds <b>rowKey</b> identifiers of the currently selected rows.</p>
<ui:include src="#{demoNavigator.sampleIncludeURI}" />
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/samples/exTableSelection-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/samples/exTableSelection-sample.xhtml 2011-04-12 09:49:44 UTC (rev 22413)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/samples/exTableSelection-sample.xhtml 2011-04-12 10:31:45 UTC (rev 22414)
@@ -7,10 +7,18 @@
xmlns:rich="http://richfaces.org/rich">
<h:panelGrid columns="2">
<h:form>
+ <fieldset style="margin-bottom: 10px;"><legend><h:outputText value="Selection Mode " /></legend>
+ <h:selectOneRadio value="#{extTableSelectionBean.selectionMode}">
+ <f:selectItem itemLabel="Single" itemValue="single"/>
+ <f:selectItem itemLabel="Multiple" itemValue="multiple"/>
+ <f:selectItem itemLabel="Multiple Keyboard-free" itemValue="multipleKeyboardFree"/>
+ <a4j:ajax render="table, res"/>
+ </h:selectOneRadio>
+ </fieldset>
<rich:extendedDataTable
value="#{extTableSelectionBean.inventoryItems}" var="car"
selection="#{extTableSelectionBean.selection}" id="table"
- frozenColumns="2" style="height:300px; width:500px;">
+ frozenColumns="2" style="height:300px; width:500px;" selectionMode="#{extTableSelectionBean.selectionMode}">
<a4j:ajax execute="@form"
event="selectionchange"
listener="#{extTableSelectionBean.selectionListener}" render=":res" />
13 years
JBoss Rich Faces SVN: r22413 - branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-04-12 05:49:44 -0400 (Tue, 12 Apr 2011)
New Revision: 22413
Modified:
branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/faces-config.xml
Log:
added GAE-related part of the fix.
http://jira.jboss.org/browse/RF-10843
+ fixed non-working EDT selection sample. (injection errors after switching to @viewScope)
Modified: branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/faces-config.xml
===================================================================
--- branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/faces-config.xml 2011-04-12 09:07:24 UTC (rev 22412)
+++ branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/faces-config.xml 2011-04-12 09:49:44 UTC (rev 22413)
@@ -130,7 +130,7 @@
<managed-bean>
<managed-bean-name>extTableSelectionBean</managed-bean-name>
<managed-bean-class>org.richfaces.demo.tables.ExtTableSelectionBean</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
+ <managed-bean-scope>view</managed-bean-scope>
<managed-property>
<property-name>inventoryItems</property-name>
<value>#{carsBean.allInventoryItems}</value>
13 years
JBoss Rich Faces SVN: r22412 - in branches/4.0.X/examples/richfaces-showcase/src/main: webapp/richfaces/extendedDataTable and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-04-12 05:07:24 -0400 (Tue, 12 Apr 2011)
New Revision: 22412
Modified:
branches/4.0.X/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/ExtTableSelectionBean.java
branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/exTableSelection.xhtml
branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/samples/exTableSelection-sample.xhtml
Log:
http://jira.jboss.org/browse/RF-10843
+ fixed non-working EDT selection sample. (injection errors after switching to @viewScope)
Modified: branches/4.0.X/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/ExtTableSelectionBean.java
===================================================================
--- branches/4.0.X/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/ExtTableSelectionBean.java 2011-04-11 15:16:32 UTC (rev 22411)
+++ branches/4.0.X/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/ExtTableSelectionBean.java 2011-04-12 09:07:24 UTC (rev 22412)
@@ -7,28 +7,29 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
-import javax.faces.bean.SessionScoped;
+import javax.faces.bean.ViewScoped;
import javax.faces.event.AjaxBehaviorEvent;
import org.richfaces.component.UIExtendedDataTable;
import org.richfaces.demo.tables.model.cars.InventoryItem;
@ManagedBean
-@SessionScoped
-public class ExtTableSelectionBean implements Serializable{
+@ViewScoped
+public class ExtTableSelectionBean implements Serializable {
+ private String selectionMode="multiple";
private Collection<Object> selection;
@ManagedProperty(value = "#{carsBean.allInventoryItems}")
private List<InventoryItem> inventoryItems;
private List<InventoryItem> selectionItems = new ArrayList<InventoryItem>();
-
- public void selectionListener(AjaxBehaviorEvent event){
- UIExtendedDataTable dataTable = (UIExtendedDataTable)event.getComponent();
+
+ public void selectionListener(AjaxBehaviorEvent event) {
+ UIExtendedDataTable dataTable = (UIExtendedDataTable) event.getComponent();
Object originalKey = dataTable.getRowKey();
selectionItems.clear();
- for (Object selectionKey: selection) {
+ for (Object selectionKey : selection) {
dataTable.setRowKey(selectionKey);
- if (dataTable.isRowAvailable()){
- selectionItems.add((InventoryItem)dataTable.getRowData());
+ if (dataTable.isRowAvailable()) {
+ selectionItems.add((InventoryItem) dataTable.getRowData());
}
}
dataTable.setRowKey(originalKey);
@@ -57,4 +58,12 @@
public void setSelectionItems(List<InventoryItem> selectionItems) {
this.selectionItems = selectionItems;
}
+
+ public String getSelectionMode() {
+ return selectionMode;
+ }
+
+ public void setSelectionMode(String selectionMode) {
+ this.selectionMode = selectionMode;
+ }
}
Modified: branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/exTableSelection.xhtml
===================================================================
--- branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/exTableSelection.xhtml 2011-04-11 15:16:32 UTC (rev 22411)
+++ branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/exTableSelection.xhtml 2011-04-12 09:07:24 UTC (rev 22412)
@@ -8,11 +8,12 @@
<p>This example demonstrates selection management using the built-in selection functionality.</p>
<p>The <b>selectionMode</b> attribute, which controls the selection mode, has three possible values:</p>
<ul>
+<li>none</li>
+<li>single</li>
<li>multiple</li>
-<li>single</li>
-<li>none</li>
+<li>multipleKeyboardFree - <b>new!</b></li>
</ul>
-<p>To manage your selection, use the <b>selection</b> attribute, which points to
+<p>To manage your selection at server-side, use the <b>selection</b> attribute, which points to
a collection of objects. The collection holds <b>rowKey</b> identifiers of the currently selected rows.</p>
<ui:include src="#{demoNavigator.sampleIncludeURI}" />
Modified: branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/samples/exTableSelection-sample.xhtml
===================================================================
--- branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/samples/exTableSelection-sample.xhtml 2011-04-11 15:16:32 UTC (rev 22411)
+++ branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/extendedDataTable/samples/exTableSelection-sample.xhtml 2011-04-12 09:07:24 UTC (rev 22412)
@@ -7,10 +7,18 @@
xmlns:rich="http://richfaces.org/rich">
<h:panelGrid columns="2">
<h:form>
+ <fieldset style="margin-bottom: 10px;"><legend><h:outputText value="Selection Mode " /></legend>
+ <h:selectOneRadio value="#{extTableSelectionBean.selectionMode}">
+ <f:selectItem itemLabel="Single" itemValue="single"/>
+ <f:selectItem itemLabel="Multiple" itemValue="multiple"/>
+ <f:selectItem itemLabel="Multiple Keyboard-free" itemValue="multipleKeyboardFree"/>
+ <a4j:ajax render="table, res"/>
+ </h:selectOneRadio>
+ </fieldset>
<rich:extendedDataTable
value="#{extTableSelectionBean.inventoryItems}" var="car"
selection="#{extTableSelectionBean.selection}" id="table"
- frozenColumns="2" style="height:300px; width:500px;">
+ frozenColumns="2" style="height:300px; width:500px;" selectionMode="#{extTableSelectionBean.selectionMode}">
<a4j:ajax execute="@form"
event="selectionchange"
listener="#{extTableSelectionBean.selectionListener}" render=":res" />
13 years
JBoss Rich Faces SVN: r22411 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richCalendar and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-04-11 11:16:32 -0400 (Mon, 11 Apr 2011)
New Revision: 22411
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCalendarBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml
Log:
https://issues.jboss.org/browse/RF-9178
sample for calendar updated so that it's possible to test attribute validator
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCalendarBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCalendarBean.java 2011-04-11 15:02:00 UTC (rev 22410)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCalendarBean.java 2011-04-11 15:16:32 UTC (rev 22411)
@@ -23,13 +23,18 @@
import java.io.Serializable;
import java.text.SimpleDateFormat;
+import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
import javax.annotation.PostConstruct;
+import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
import javax.faces.event.ValueChangeEvent;
+import javax.faces.validator.ValidatorException;
import javax.validation.constraints.Future;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
@@ -163,4 +168,21 @@
RichBean.logToPage("* value changed: " + oldDate + " -> " + newDate);
}
+
+ public void validateDate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
+ if (value == null) {
+ return;
+ }
+
+ Calendar cal = Calendar.getInstance();
+ cal.setTime((Date) value);
+ int componentYear = cal.get(Calendar.YEAR);
+
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Date too far in the past.",
+ "Select a date from year 1991 or newer.");
+
+ if (componentYear < 1991) {
+ FacesContext.getCurrentInstance().addMessage("form:calendar", message);
+ }
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml 2011-04-11 15:02:00 UTC (rev 22410)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml 2011-04-11 15:16:32 UTC (rev 22411)
@@ -158,6 +158,7 @@
tabindex="#{richCalendarBean.attributes['tabindex'].value}"
timeZone="#{richCalendarBean.timeZone}"
todayControlMode="#{richCalendarBean.attributes['todayControlMode'].value}"
+ validator="#{richCalendarBean.validateDate}"
validatorMessage="#{richCalendarBean.attributes['validatorMessage'].value}"
value="#{richCalendarBean.attributes['value'].value}"
valueChangeListener="#{richCalendarBean.valueChangeListener}"
@@ -168,7 +169,7 @@
>
<a4j:ajax event="change" render="output, phasesPanel" />
</rich:calendar>
- <rich:message id="msg" for="calendar"/>
+ <rich:message id="msg" for="calendar" showDetail="true" showSummary="true"/>
</div>
<br/><br/>
13 years
JBoss Rich Faces SVN: r22410 - trunk/ui/iteration/ui/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-11 11:02:00 -0400 (Mon, 11 Apr 2011)
New Revision: 22410
Modified:
trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml
Log:
https://issues.jboss.org/browse/RF-10811
Modified: trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml
===================================================================
--- trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml 2011-04-11 14:47:47 UTC (rev 22409)
+++ trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml 2011-04-11 15:02:00 UTC (rev 22410)
@@ -26,7 +26,7 @@
<cdk:call expression="addClientEventHandlers(facesContext, component)" />
<div class="#{concatClasses('rf-trn', component.attributes['styleClass'], tree.attributes['nodeClass'])}"
- cdk:passThroughWithExclusions="">
+ cdk:passThroughWithExclusions="id">
<cdk:object name="loadingFacet" type="UIComponent" value="#{getHandleLoadingFacetIfApplicable(component)}" />
<c:if test="#{not empty loadingFacet and loadingFacet.isRendered()}">
13 years
JBoss Rich Faces SVN: r22409 - branches/4.0.X/ui/dist/richfaces-components-ui.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-04-11 10:47:47 -0400 (Mon, 11 Apr 2011)
New Revision: 22409
Modified:
branches/4.0.X/ui/dist/richfaces-components-ui/pom.xml
Log:
fixing pom for vdl doc resource artifact is not in repository.
Modified: branches/4.0.X/ui/dist/richfaces-components-ui/pom.xml
===================================================================
--- branches/4.0.X/ui/dist/richfaces-components-ui/pom.xml 2011-04-11 14:38:16 UTC (rev 22408)
+++ branches/4.0.X/ui/dist/richfaces-components-ui/pom.xml 2011-04-11 14:47:47 UTC (rev 22409)
@@ -36,6 +36,7 @@
<properties>
<faces-shade-transformers.version>4-SNAPSHOT</faces-shade-transformers.version>
+ <faces-vdl-documentation.version>1-SNAPSHOT</faces-vdl-documentation.version>
<assembly.projects.group>org.richfaces.ui</assembly.projects.group>
</properties>
@@ -104,11 +105,6 @@
</dependency>
- <dependency>
- <groupId>org.richfaces.build.resources</groupId>
- <artifactId>faces-vdl-documentation</artifactId>
- <version>1-SNAPSHOT</version>
- </dependency>
</dependencies>
@@ -199,6 +195,7 @@
<artifactItem>
<groupId>org.richfaces.build.resources</groupId>
<artifactId>faces-vdl-documentation</artifactId>
+ <version>${faces-vdl-documentation.version}</version>
<outputDirectory>${project.build.directory}/resources/</outputDirectory>
<includes>**/*.xsl</includes>
</artifactItem>
@@ -236,7 +233,7 @@
<configuration>
<transformationSets>
<transformationSet>
- <dir>src/main/properties</dir>
+ <dir>src/main/properties</dir>
<stylesheet>target/resources/xsl/common.xsl</stylesheet>
<parameters>
<parameter>
@@ -267,15 +264,13 @@
<version>2.2.1</version>
<configuration>
<descriptors>
- <descriptor>src/main/assembly/vdldoc-assembly.xml</descriptor>
+ <descriptor>src/main/assembly/vdldoc-assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
- <!-- this is used for inheritance merges -->
<phase>package</phase>
- <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
@@ -283,8 +278,16 @@
</executions>
</plugin>
</plugins>
-
+
</build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.build.resources</groupId>
+ <artifactId>faces-vdl-documentation</artifactId>
+ <version>${faces-vdl-documentation.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
</profile>
</profiles>
13 years
JBoss Rich Faces SVN: r22408 - branches/4.0.X/ui/iteration/ui/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-11 10:38:16 -0400 (Mon, 11 Apr 2011)
New Revision: 22408
Modified:
branches/4.0.X/ui/iteration/ui/src/main/templates/treeNode.template.xml
Log:
https://issues.jboss.org/browse/RF-10811
Modified: branches/4.0.X/ui/iteration/ui/src/main/templates/treeNode.template.xml
===================================================================
--- branches/4.0.X/ui/iteration/ui/src/main/templates/treeNode.template.xml 2011-04-11 13:45:16 UTC (rev 22407)
+++ branches/4.0.X/ui/iteration/ui/src/main/templates/treeNode.template.xml 2011-04-11 14:38:16 UTC (rev 22408)
@@ -26,7 +26,7 @@
<cdk:call expression="addClientEventHandlers(facesContext, component)" />
<div class="#{concatClasses('rf-trn', component.attributes['styleClass'], tree.attributes['nodeClass'])}"
- cdk:passThroughWithExclusions="">
+ cdk:passThroughWithExclusions="id">
<cdk:object name="loadingFacet" type="UIComponent" value="#{getHandleLoadingFacetIfApplicable(component)}" />
<c:if test="#{not empty loadingFacet and loadingFacet.isRendered()}">
13 years