JBoss Rich Faces SVN: r13814 - in trunk/ui/tree/src/main: java/org/richfaces/taglib and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-23 20:12:43 -0400 (Thu, 23 Apr 2009)
New Revision: 13814
Added:
trunk/ui/tree/src/main/java/org/richfaces/taglib/TreeTagHandlerBase.java
Modified:
trunk/ui/tree/src/main/config/component/tree.xml
Log:
https://jira.jboss.org/jira/browse/RF-6912
Modified: trunk/ui/tree/src/main/config/component/tree.xml
===================================================================
--- trunk/ui/tree/src/main/config/component/tree.xml 2009-04-24 00:07:07 UTC (rev 13813)
+++ trunk/ui/tree/src/main/config/component/tree.xml 2009-04-24 00:12:43 UTC (rev 13814)
@@ -50,9 +50,7 @@
</tag>
<taghandler generate="true">
<classname>org.richfaces.taglib.TreeTagHandler</classname>
- <superclass>
- org.richfaces.taglib.TreeListenersTagHandler
- </superclass>
+ <superclass>org.richfaces.taglib.TreeTagHandlerBase</superclass>
</taghandler>
&attributes;
<property>
Added: trunk/ui/tree/src/main/java/org/richfaces/taglib/TreeTagHandlerBase.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/taglib/TreeTagHandlerBase.java (rev 0)
+++ trunk/ui/tree/src/main/java/org/richfaces/taglib/TreeTagHandlerBase.java 2009-04-24 00:12:43 UTC (rev 13814)
@@ -0,0 +1,44 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.taglib;
+
+import org.ajax4jsf.webapp.taglib.RowKeyConverterRule;
+
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+
+public abstract class TreeTagHandlerBase extends TreeListenersTagHandler {
+
+ public TreeTagHandlerBase(ComponentConfig config) {
+ super(config);
+ }
+
+ @Override
+ protected MetaRuleset createMetaRuleset(Class clazz) {
+ return super.createMetaRuleset(clazz).addRule(RowKeyConverterRule.INSTANCE);
+ }
+}
15 years, 8 months
JBoss Rich Faces SVN: r13813 - in trunk/ui: dataTable/src/main/config/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-23 20:07:07 -0400 (Thu, 23 Apr 2009)
New Revision: 13813
Added:
trunk/ui/dataTable/src/main/java/org/richfaces/taglib/RowKeyConverterComponentHandler.java
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java
trunk/ui/dataTable/src/main/config/component/dataGrid.xml
trunk/ui/dataTable/src/main/config/component/dataList.xml
trunk/ui/dataTable/src/main/config/component/dataTable.xml
trunk/ui/dataTable/src/main/config/component/subTable.xml
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/taglib/ScrollableDataTableTagHandler.java
Log:
https://jira.jboss.org/jira/browse/RF-6912
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java 2009-04-24 00:05:03 UTC (rev 13812)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java 2009-04-24 00:07:07 UTC (rev 13813)
@@ -20,83 +20,12 @@
*/
package org.ajax4jsf.taglib.html.facelets;
-import javax.faces.convert.Converter;
-import org.ajax4jsf.component.UIDataAdaptor;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
-
/**
* Apply rowKeyConverter to component
* @author Maksim Kaszynski
- *
*/
-public class RowKeyConverterRule extends MetaRule {
+@Deprecated
+public class RowKeyConverterRule extends org.ajax4jsf.webapp.taglib.RowKeyConverterRule {
- static final class DynamicConverterMetaData extends Metadata {
-
- private final TagAttribute attribute;
-
- public DynamicConverterMetaData(TagAttribute attribute) {
- super();
- this.attribute = attribute;
- }
-
- @Override
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((UIDataAdaptor) instance).setValueExpression("rowKeyConverter",
- attribute.getValueExpression(ctx, Converter.class));
-
- }
- }
-
- static final class StaticConverterMetadata extends Metadata {
-
- private final String converterId;
-
- public StaticConverterMetadata(String converterId) {
- super();
- this.converterId = converterId;
- }
-
- @Override
- public void applyMetadata(FaceletContext ctx, Object instance) {
- Converter converter = ctx.getFacesContext().getApplication()
- .createConverter(converterId);
- ((UIDataAdaptor) instance).setRowKeyConverter(converter);
-
- }
- }
-
- public static final RowKeyConverterRule INSTANCE = new RowKeyConverterRule();
-
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.facelets.tag.MetaRule#applyRule(java.lang.String,
- * com.sun.facelets.tag.TagAttribute,
- * com.sun.facelets.tag.MetadataTarget)
- */
- @Override
- public Metadata applyRule(String name, TagAttribute attribute,
- MetadataTarget meta) {
-
- if (meta.isTargetInstanceOf(UIDataAdaptor.class)) {
- if ("rowKeyConverter".equals(name)) {
- if (attribute.isLiteral()) {
- return new StaticConverterMetadata(attribute.getValue());
- } else {
- return new DynamicConverterMetaData(attribute);
- }
- }
- }
-
- return null;
- }
-
}
Modified: trunk/ui/dataTable/src/main/config/component/dataGrid.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataGrid.xml 2009-04-24 00:05:03 UTC (rev 13812)
+++ trunk/ui/dataTable/src/main/config/component/dataGrid.xml 2009-04-24 00:07:07 UTC (rev 13813)
@@ -39,11 +39,10 @@
</superclass>
<test/>
</tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <taghandler generate="false">
+ <classname>org.richfaces.taglib.RowKeyConverterComponentHandler</classname>
</taghandler>
- -->
+
&ui_component_attributes;
&ui_data_attributes;
&html_universal_attributes;
Modified: trunk/ui/dataTable/src/main/config/component/dataList.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataList.xml 2009-04-24 00:05:03 UTC (rev 13812)
+++ trunk/ui/dataTable/src/main/config/component/dataList.xml 2009-04-24 00:07:07 UTC (rev 13813)
@@ -27,11 +27,10 @@
</superclass>
<test/>
</tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <taghandler generate="false">
+ <classname>org.richfaces.taglib.RowKeyConverterComponentHandler</classname>
</taghandler>
- -->
+
&ui_component_attributes;
&ui_data_attributes;
&html_universal_attributes;
@@ -132,11 +131,10 @@
</superclass>
<test/>
</tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <taghandler generate="false">
+ <classname>org.richfaces.taglib.RowKeyConverterComponentHandler</classname>
</taghandler>
- -->
+
&ui_component_attributes;
&ui_data_attributes;
&html_universal_attributes;
@@ -242,11 +240,10 @@
</superclass>
<test/>
</tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <taghandler generate="false">
+ <classname>org.richfaces.taglib.RowKeyConverterComponentHandler</classname>
</taghandler>
- -->
+
&ui_component_attributes;
&ui_data_attributes;
&html_universal_attributes;
Modified: trunk/ui/dataTable/src/main/config/component/dataTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataTable.xml 2009-04-24 00:05:03 UTC (rev 13812)
+++ trunk/ui/dataTable/src/main/config/component/dataTable.xml 2009-04-24 00:07:07 UTC (rev 13813)
@@ -39,11 +39,10 @@
</superclass>
<test/>
</tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <taghandler generate="false">
+ <classname>org.richfaces.taglib.RowKeyConverterComponentHandler</classname>
</taghandler>
- -->
+
&ui_component_attributes;
&ui_data_attributes;
&html_universal_attributes;
Modified: trunk/ui/dataTable/src/main/config/component/subTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/subTable.xml 2009-04-24 00:05:03 UTC (rev 13812)
+++ trunk/ui/dataTable/src/main/config/component/subTable.xml 2009-04-24 00:07:07 UTC (rev 13813)
@@ -36,11 +36,10 @@
</superclass>
<test/>
</tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <taghandler generate="false">
+ <classname>org.richfaces.taglib.RowKeyConverterComponentHandler</classname>
</taghandler>
- -->
+
&ui_component_attributes;
&ui_data_attributes;
&spec_table_attributes;
Added: trunk/ui/dataTable/src/main/java/org/richfaces/taglib/RowKeyConverterComponentHandler.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/taglib/RowKeyConverterComponentHandler.java (rev 0)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/taglib/RowKeyConverterComponentHandler.java 2009-04-24 00:07:07 UTC (rev 13813)
@@ -0,0 +1,45 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.taglib;
+
+import org.ajax4jsf.webapp.taglib.RowKeyConverterRule;
+
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+import com.sun.facelets.tag.jsf.ComponentHandler;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+
+public class RowKeyConverterComponentHandler extends ComponentHandler {
+
+ public RowKeyConverterComponentHandler(ComponentConfig config) {
+ super(config);
+ }
+
+ @Override
+ protected MetaRuleset createMetaRuleset(Class type) {
+ return super.createMetaRuleset(type).addRule(RowKeyConverterRule.INSTANCE);
+ }
+}
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/taglib/ScrollableDataTableTagHandler.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/taglib/ScrollableDataTableTagHandler.java 2009-04-24 00:05:03 UTC (rev 13812)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/taglib/ScrollableDataTableTagHandler.java 2009-04-24 00:07:07 UTC (rev 13813)
@@ -20,8 +20,9 @@
*/
package org.richfaces.taglib;
-import org.ajax4jsf.taglib.html.facelets.RowKeyConverterRule;
+import org.ajax4jsf.webapp.taglib.RowKeyConverterRule;
+
import com.sun.facelets.tag.MetaRuleset;
import com.sun.facelets.tag.jsf.ComponentConfig;
import com.sun.facelets.tag.jsf.ComponentHandler;
15 years, 8 months
JBoss Rich Faces SVN: r13812 - trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-23 20:05:03 -0400 (Thu, 23 Apr 2009)
New Revision: 13812
Added:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/RowKeyConverterRule.java
Log:
https://jira.jboss.org/jira/browse/RF-6912
Added: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/RowKeyConverterRule.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/RowKeyConverterRule.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/RowKeyConverterRule.java 2009-04-24 00:05:03 UTC (rev 13812)
@@ -0,0 +1,102 @@
+/**
+ * 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.webapp.taglib;
+
+import javax.faces.convert.Converter;
+
+import org.ajax4jsf.component.UIDataAdaptor;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.MetaRule;
+import com.sun.facelets.tag.Metadata;
+import com.sun.facelets.tag.MetadataTarget;
+import com.sun.facelets.tag.TagAttribute;
+
+/**
+ * Apply rowKeyConverter to component
+ * @author Maksim Kaszynski
+ * @since 3.3.1
+ */
+public class RowKeyConverterRule extends MetaRule {
+
+ static final class DynamicConverterMetaData extends Metadata {
+
+ private final TagAttribute attribute;
+
+ public DynamicConverterMetaData(TagAttribute attribute) {
+ super();
+ this.attribute = attribute;
+ }
+
+ @Override
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((UIDataAdaptor) instance).setValueExpression("rowKeyConverter",
+ attribute.getValueExpression(ctx, Converter.class));
+
+ }
+ }
+
+ static final class StaticConverterMetadata extends Metadata {
+
+ private final String converterId;
+
+ public StaticConverterMetadata(String converterId) {
+ super();
+ this.converterId = converterId;
+ }
+
+ @Override
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ Converter converter = ctx.getFacesContext().getApplication()
+ .createConverter(converterId);
+ ((UIDataAdaptor) instance).setRowKeyConverter(converter);
+
+ }
+ }
+
+ public static final RowKeyConverterRule INSTANCE = new RowKeyConverterRule();
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.facelets.tag.MetaRule#applyRule(java.lang.String,
+ * com.sun.facelets.tag.TagAttribute,
+ * com.sun.facelets.tag.MetadataTarget)
+ */
+ @Override
+ public Metadata applyRule(String name, TagAttribute attribute,
+ MetadataTarget meta) {
+
+ if (meta.isTargetInstanceOf(UIDataAdaptor.class)) {
+ if ("rowKeyConverter".equals(name)) {
+ if (attribute.isLiteral()) {
+ return new StaticConverterMetadata(attribute.getValue());
+ } else {
+ return new DynamicConverterMetaData(attribute);
+ }
+ }
+ }
+
+ return null;
+ }
+
+}
15 years, 8 months
JBoss Rich Faces SVN: r13811 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2009-04-23 19:42:05 -0400 (Thu, 23 Apr 2009)
New Revision: 13811
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml
Log:
All guide is checked, one correction is made
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml 2009-04-23 23:41:19 UTC (rev 13810)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml 2009-04-23 23:42:05 UTC (rev 13811)
@@ -51,7 +51,7 @@
<para><property>RichFaces</property> was developed with an open architecture to be compatible with
the widest possible variety of environments.</para>
- <para>This is what you need to start working with <property>RichFaces 3.3.0</property>:</para>
+ <para>This is what you need to start working with <property>RichFaces 3.3.1</property>:</para>
<itemizedlist>
<listitem><para>Java</para></listitem>
15 years, 8 months
JBoss Rich Faces SVN: r13810 - trunk/ui/treeModel/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2009-04-23 19:41:19 -0400 (Thu, 23 Apr 2009)
New Revision: 13810
Modified:
trunk/ui/treeModel/src/main/config/component/recursiveTreeNodesAdaptor.xml
Log:
https://jira.jboss.org/jira/browse/RF-6760
Recursive tree model adaptor: description is added for a new attribute
Modified: trunk/ui/treeModel/src/main/config/component/recursiveTreeNodesAdaptor.xml
===================================================================
--- trunk/ui/treeModel/src/main/config/component/recursiveTreeNodesAdaptor.xml 2009-04-23 23:13:10 UTC (rev 13809)
+++ trunk/ui/treeModel/src/main/config/component/recursiveTreeNodesAdaptor.xml 2009-04-23 23:41:19 UTC (rev 13810)
@@ -85,6 +85,7 @@
</property>
<property>
<name>recursionOrder</name>
+ <description>The attribute is used to control recursion order. Possible values are ("first", "last", "id of adaptor") "first" and "last" are reserved values. Id of the adaptor component definition means that recursion occurs after these adaptor component nodes are processed. The default value is "last" </description>
<classname>java.lang.String</classname>
</property>
</component>
15 years, 8 months
JBoss Rich Faces SVN: r13809 - trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-23 19:13:10 -0400 (Thu, 23 Apr 2009)
New Revision: 13809
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
Log:
https://jira.jboss.org/jira/browse/RF-6788
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2009-04-23 23:09:16 UTC (rev 13808)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2009-04-23 23:13:10 UTC (rev 13809)
@@ -245,16 +245,22 @@
protected String getItemLabel(FacesContext context, UIInplaceSelect component, Object value) {
String itemLabel = null;
+ boolean equivValues;
+
// TODO: SelectUtils.getSelectItems is called minimum twice during encode
- if(value != null) {
- List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
- if (!selectItems.isEmpty()) {
- for (SelectItem item : selectItems) {
- if (value.equals(item.getValue())) {
- itemLabel = component.isShowValueInView() ? getConvertedStringValue(context, component, item.getValue()) : item.getLabel();
- break;
- }
+ List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
+ if (!selectItems.isEmpty()) {
+ for (SelectItem item : selectItems) {
+ if (value != null) {
+ equivValues = value.equals(item.getValue());
+ } else {
+ equivValues = item.getValue() == null;
}
+
+ if (equivValues) {
+ itemLabel = component.isShowValueInView() ? getConvertedStringValue(context, component, item.getValue()) : item.getLabel();
+ break;
+ }
}
}
15 years, 8 months
JBoss Rich Faces SVN: r13808 - trunk/ui/tree/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2009-04-23 19:09:16 -0400 (Thu, 23 Apr 2009)
New Revision: 13808
Modified:
trunk/ui/tree/src/main/config/component/tree.xml
Log:
https://jira.jboss.org/jira/browse/RF-4541 description is added for Tree ajaxKeys attribute
Modified: trunk/ui/tree/src/main/config/component/tree.xml
===================================================================
--- trunk/ui/tree/src/main/config/component/tree.xml 2009-04-23 23:00:54 UTC (rev 13807)
+++ trunk/ui/tree/src/main/config/component/tree.xml 2009-04-23 23:09:16 UTC (rev 13808)
@@ -333,6 +333,7 @@
<property>
<name>ajaxKeys</name>
+ <description>This attribute defines row keys that are updated after an AJAX request.</description>
</property>
<property>
15 years, 8 months
JBoss Rich Faces SVN: r13807 - trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-23 19:00:54 -0400 (Thu, 23 Apr 2009)
New Revision: 13807
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
Log:
https://jira.jboss.org/jira/browse/RF-6788
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2009-04-23 18:19:47 UTC (rev 13806)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2009-04-23 23:00:54 UTC (rev 13807)
@@ -28,6 +28,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import javax.faces.convert.ConverterException;
import javax.faces.model.SelectItem;
import org.ajax4jsf.javascript.JSFunctionDefinition;
@@ -109,7 +110,7 @@
Map <String,String> request = context.getExternalContext().getRequestParameterMap();
String newValue = (String) request.get(clientId);
- if (newValue != null && newValue.length()!= 0) {
+ if (newValue != null) {
inplaceSelect.setSubmittedValue(newValue);
} else {
inplaceSelect.setSubmittedValue(null);
@@ -207,6 +208,15 @@
return false;
}
+ @Override
+ public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException {
+ if ("".equals(submittedValue)) {
+ return null;
+ } else {
+ return InputUtils.getConvertedValue(context, component, submittedValue);
+ }
+ }
+
protected Class<? extends UIComponent> getComponentClass() {
return UIInplaceSelect.class;
}
15 years, 8 months
JBoss Rich Faces SVN: r13806 - trunk/samples/treeModelDemo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-23 14:19:47 -0400 (Thu, 23 Apr 2009)
New Revision: 13806
Modified:
trunk/samples/treeModelDemo/src/main/webapp/pages/index.jsp
Log:
Tree model demo page updated
Modified: trunk/samples/treeModelDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/treeModelDemo/src/main/webapp/pages/index.jsp 2009-04-23 17:43:37 UTC (rev 13805)
+++ trunk/samples/treeModelDemo/src/main/webapp/pages/index.jsp 2009-04-23 18:19:47 UTC (rev 13806)
@@ -23,25 +23,25 @@
<tree:tree adviseNodeOpened="#{treeModelBean.adviseNodeOpened}" switchType="client">
<model:treeNodesAdaptor id="project" nodes="#{loaderBean.projects}" var="project">
<tree:treeNode>
- <a4j:commandLink action="#{project.click}" ajaxSingle="true" value="Immediate " /><br />
+ <a4j:commandLink action="#{project.click}" ajaxSingle="true" value="AJAX Single " /><br />
<h:commandLink action="#{project.click}" value="Project: #{project.name}" />
</tree:treeNode>
<model:treeNodesAdaptor id="srcDir" var="srcDir" nodes="#{project.srcDirs}">
<tree:treeNode>
- <a4j:commandLink action="#{srcDir.click}" ajaxSingle="true" value="Immediate " /><br />
+ <a4j:commandLink action="#{srcDir.click}" ajaxSingle="true" value="AJAX Single " /><br />
<h:commandLink action="#{srcDir.click}" value="Source directory: #{srcDir.name}" />
</tree:treeNode>
<model:treeNodesAdaptor id="pkg" var="pkg" nodes="#{srcDir.packages}">
<tree:treeNode>
- <a4j:commandLink action="#{pkg.click}" ajaxSingle="true" value="Immediate " /><br />
+ <a4j:commandLink action="#{pkg.click}" ajaxSingle="true" value="AJAX Single " /><br />
<h:commandLink action="#{pkg.click}" value="Package: #{pkg.name}" />
</tree:treeNode>
<model:treeNodesAdaptor id="class" var="class" nodes="#{pkg.classes}">
<tree:treeNode>
- <a4j:commandLink action="#{class.click}" ajaxSingle="true" value="Immediate " /><br />
+ <a4j:commandLink action="#{class.click}" ajaxSingle="true" value="AJAX Single " /><br />
<h:commandLink action="#{class.click}" value="Class: #{class.name}" />
</tree:treeNode>
</model:treeNodesAdaptor>
@@ -49,13 +49,13 @@
<model:treeNodesAdaptor id="pkg1" var="pkg" nodes="#{srcDir.packages}">
<tree:treeNode>
- <a4j:commandLink action="#{pkg.click}" ajaxSingle="true" value="Immediate " /><br />
+ <a4j:commandLink action="#{pkg.click}" ajaxSingle="true" value="AJAX Single " /><br />
<h:commandLink action="#{pkg.click}" value="Package1: #{pkg.name}" />
</tree:treeNode>
<model:treeNodesAdaptor id="class1" var="class" nodes="#{pkg.classes}">
<tree:treeNode>
- <a4j:commandLink action="#{class.click}" ajaxSingle="true" value="Immediate " /><br />
+ <a4j:commandLink action="#{class.click}" ajaxSingle="true" value="AJAX Single " /><br />
<h:commandLink action="#{class.click}" value="Class1: #{class.name}" />
</tree:treeNode>
</model:treeNodesAdaptor>
@@ -65,13 +65,13 @@
<model:recursiveTreeNodesAdaptor id="dir" var="dir"
roots="#{project.dirs}" nodes="#{dir.directories}" binding="#{treeModelBean.binding}">
<tree:treeNode>
- <a4j:commandLink action="#{dir.click}" ajaxSingle="true" value="Immediate " /><br />
+ <a4j:commandLink action="#{dir.click}" ajaxSingle="true" value="AJAX Single " /><br />
<h:commandLink action="#{dir.click}" value="Directory: #{dir.name}" />
</tree:treeNode>
<model:treeNodesAdaptor id="file" var="file" nodes="#{dir.files}">
<tree:treeNode>
- <a4j:commandLink action="#{file.click}" ajaxSingle="true" value="Immediate " />
+ <a4j:commandLink action="#{file.click}" ajaxSingle="true" value="AJAX Single " />
<br />
<h:commandLink action="#{file.click}" value="File: #{file.name}" />
</tree:treeNode>
@@ -79,7 +79,7 @@
<model:treeNodesAdaptor id="file1" var="file" nodes="#{dir.files}">
<tree:treeNode>
- <a4j:commandLink action="#{file.click}" ajaxSingle="true" value="Immediate " />
+ <a4j:commandLink action="#{file.click}" ajaxSingle="true" value="AJAX Single " />
<br />
<h:commandLink action="#{file.click}" value="File1: #{file.name}" />
</tree:treeNode>
@@ -91,7 +91,7 @@
includedNode="#{archiveEntry.class.simpleName == 'ArchiveEntry'}">
<tree:treeNode id="archiveEntryNode">
- <a4j:commandLink action="#{archiveEntry.click}" ajaxSingle="true" value="Immediate " />
+ <a4j:commandLink action="#{archiveEntry.click}" ajaxSingle="true" value="AJAX Single " />
<br />
<h:commandLink action="#{archiveEntry.click}" value="Archive entry: #{archiveEntry.name}" />
</tree:treeNode>
15 years, 8 months
JBoss Rich Faces SVN: r13805 - trunk/framework/api/src/main/java/org/richfaces/model.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-23 13:43:37 -0400 (Thu, 23 Apr 2009)
New Revision: 13805
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
Log:
https://jira.jboss.org/jira/browse/RF-5771
Modified: trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2009-04-23 17:06:33 UTC (rev 13804)
+++ trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2009-04-23 17:43:37 UTC (rev 13805)
@@ -37,6 +37,8 @@
import org.ajax4jsf.model.Range;
import org.apache.commons.collections.Predicate;
import org.apache.commons.collections.iterators.FilterIterator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.w3c.dom.NamedNodeMap;
/**
@@ -288,14 +290,16 @@
TreeRange treeRange = (TreeRange) range;
if (treeRange == null || treeRange.processNode(argumentKey)) {
- getRoot().setRowKey(context, argumentKey);
+ StackingTreeModel rootModel = getRoot();
+
+ rootModel.setRowKey(context, argumentKey);
if (argumentKey != null) {
processElement(context, dataVisitor, argument, argumentKey, last);
}
//setup key in order for nested components to initialize data models
- getRoot().setRowKey(context, argumentKey);
+ rootModel.setRowKey(context, argumentKey);
final ShiftingDataVisitor shiftingDataVisitor = new ShiftingDataVisitor(
new Visitor1(dataVisitor));
@@ -305,7 +309,7 @@
while (iterator.hasNext()) {
final StackingTreeModel model = iterator.next();
- getRoot().setRowKey(context, argumentKey);
+ rootModel.setRowKey(context, argumentKey);
final ExtendedDataModel scalarModel = model.getDataModel();
Argument argument2 = new Argument();
@@ -365,20 +369,70 @@
return models.values().iterator();
}
+ private static final Log keyBackupVisitorLog = LogFactory.getLog(KeyBackupVisitor.class);
+
+ private class KeyBackupVisitor implements DataVisitor, LastElementAware {
+
+ private ExtendedDataModel dataModel;
+
+ private Object rowKey;
+
+ private DataVisitor dataVisitor;
+
+ private boolean last;
+
+ public KeyBackupVisitor(ExtendedDataModel dataModel,
+ DataVisitor dataVisitor) {
+ super();
+
+ this.dataModel = dataModel;
+ this.rowKey = dataModel.getRowKey();
+ this.dataVisitor = dataVisitor;
+ }
+
+ public void process(FacesContext context, Object rowKey, Object argument)
+ throws IOException {
+
+ this.dataModel.setRowKey(this.rowKey);
+ try {
+ processElement(context, this.dataVisitor, argument, (TreeRowKey<?>) rowKey, this.last);
+ } finally {
+ try {
+ this.rowKey = this.dataModel.getRowKey();
+ } catch (Exception e) {
+ keyBackupVisitorLog.error(e.getMessage(), e);
+ }
+ }
+ }
+
+ public void resetLastElement() {
+ this.last = false;
+ }
+
+ public void setLastElement() {
+ this.last = true;
+ }
+
+ }
+
public void walk(FacesContext context, DataVisitor dataVisitor,
Range range, Object rowKey, Object argument,
boolean last) throws IOException {
+ StackingTreeModel rootModel = getRoot();
+ KeyBackupVisitor backupVisitor = new KeyBackupVisitor(rootModel, dataVisitor);
+
if (rowKey != null) {
ListRowKey listRowKey = (ListRowKey) rowKey;
- StackingTreeModel treeModel = getRoot().setupKey(listRowKey, context);
+ StackingTreeModel treeModel = rootModel.setupKey(listRowKey, context);
- treeModel.doWalk(context, dataVisitor, range, listRowKey, argument,
+ treeModel.doWalk(context, backupVisitor, range, listRowKey, argument,
last);
} else {
- doWalk(context, dataVisitor, range, (ListRowKey) rowKey, argument, last);
+ doWalk(context, backupVisitor, range,
+ (ListRowKey) rowKey, argument, last);
}
}
15 years, 8 months