JBoss Rich Faces SVN: r9783 - trunk/ui/core/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-07-25 08:12:43 -0400 (Fri, 25 Jul 2008)
New Revision: 9783
Modified:
trunk/ui/core/src/main/config/component/form.xml
trunk/ui/core/src/main/config/component/loadStyle.xml
trunk/ui/core/src/main/config/component/support.xml
Log:
RF-696 - updated descriptions of attributes for a4j:form, a4j:loadStyle and a4j:support components.
Modified: trunk/ui/core/src/main/config/component/form.xml
===================================================================
--- trunk/ui/core/src/main/config/component/form.xml 2008-07-25 11:51:48 UTC (rev 9782)
+++ trunk/ui/core/src/main/config/component/form.xml 2008-07-25 12:12:43 UTC (rev 9783)
@@ -45,7 +45,7 @@
<property>
<name>ajaxSubmit</name>
<classname>boolean</classname>
- <description>If true, it becomes possible to set AJAX submission way for any components inside .</description>
+ <description>If "true", it becomes possible to set AJAX submission way for any components inside .</description>
</property>
<property>
<name>ignoreDupResponses</name>
Modified: trunk/ui/core/src/main/config/component/loadStyle.xml
===================================================================
--- trunk/ui/core/src/main/config/component/loadStyle.xml 2008-07-25 11:51:48 UTC (rev 9782)
+++ trunk/ui/core/src/main/config/component/loadStyle.xml 2008-07-25 12:12:43 UTC (rev 9783)
@@ -41,6 +41,10 @@
<property>
<name>media</name>
<classname>java.lang.String</classname>
+ <description>
+ This attribute defines the device to which it is necessary to apply style registration.
+ The possible values are "all", "screen" (by default), "print", "projection", "projection", "braille" and "speech".
+ </description>
</property>
</component>
</components>
Modified: trunk/ui/core/src/main/config/component/support.xml
===================================================================
--- trunk/ui/core/src/main/config/component/support.xml 2008-07-25 11:51:48 UTC (rev 9782)
+++ trunk/ui/core/src/main/config/component/support.xml 2008-07-25 12:12:43 UTC (rev 9783)
@@ -130,7 +130,7 @@
<property>
<name>disabled</name>
<classname>boolean</classname>
- <description>If true, disable this component on page.</description>
+ <description>If "true", disable this component on page.</description>
</property>
</component>
16 years, 5 months
JBoss Rich Faces SVN: r9782 - trunk/test-applications/facelets/src/main/java/hotKey.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-07-25 07:51:48 -0400 (Fri, 25 Jul 2008)
New Revision: 9782
Modified:
trunk/test-applications/facelets/src/main/java/hotKey/HotKey.java
Log:
Add onclick attribute for commandButton in hotKey component
Modified: trunk/test-applications/facelets/src/main/java/hotKey/HotKey.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/hotKey/HotKey.java 2008-07-25 11:51:35 UTC (rev 9781)
+++ trunk/test-applications/facelets/src/main/java/hotKey/HotKey.java 2008-07-25 11:51:48 UTC (rev 9782)
@@ -20,7 +20,7 @@
private HtmlHotKey binding = null;
private String bindingInfo = "";
private String handler = "alert('work')";
- private String key = "alt+a";
+ private String key = "alt+q";
private String selector = "";
private String timing = "onload";
private String type = "onkeydown";
16 years, 5 months
JBoss Rich Faces SVN: r9781 - trunk/test-applications/jsp/src/main/java/hotKey.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-07-25 07:51:35 -0400 (Fri, 25 Jul 2008)
New Revision: 9781
Modified:
trunk/test-applications/jsp/src/main/java/hotKey/HotKey.java
Log:
Add onclick attribute for commandButton in hotKey component
Modified: trunk/test-applications/jsp/src/main/java/hotKey/HotKey.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/hotKey/HotKey.java 2008-07-25 11:01:45 UTC (rev 9780)
+++ trunk/test-applications/jsp/src/main/java/hotKey/HotKey.java 2008-07-25 11:51:35 UTC (rev 9781)
@@ -19,7 +19,7 @@
public class HotKey {
private String bindingInfo = "";
private String handler = "alert('work')";
- private String key = "alt+a";
+ private String key = "alt+q";
private String selector = "";
private String timing = "onload";
private String type = "onkeydown";
16 years, 5 months
JBoss Rich Faces SVN: r9780 - trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-07-25 07:01:45 -0400 (Fri, 25 Jul 2008)
New Revision: 9780
Modified:
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
Log:
RF-4016
Modified: trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2008-07-25 09:49:09 UTC (rev 9779)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2008-07-25 11:01:45 UTC (rev 9780)
@@ -465,8 +465,8 @@
public Object getAcceptedTypes(FacesContext context, UIComponent component) {
String acceptedTypes = (String) component.getAttributes().get(
"acceptedTypes");
+ Map<String, Boolean> accepted = new HashMap<String, Boolean>();
if (acceptedTypes != null && acceptedTypes.length() > 0) {
- Map<String, Boolean> accepted = new HashMap<String, Boolean>();
acceptedTypes = acceptedTypes.replaceAll("[\\s]", "");
String[] types = acceptedTypes.split("[,;|]");
if (types != null) {
@@ -475,8 +475,10 @@
}
return ScriptUtils.toScript(accepted);
}
+ }else {
+ accepted.put("*", true);
}
- return JSReference.NULL;
+ return ScriptUtils.toScript(accepted);
}
/**
16 years, 5 months
JBoss Rich Faces SVN: r9779 - in trunk/sandbox/ui/extendedDataTable: src/main/javascript/ClientUI/controls/datatable and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: piotr.buda
Date: 2008-07-25 05:49:09 -0400 (Fri, 25 Jul 2008)
New Revision: 9779
Modified:
trunk/sandbox/ui/extendedDataTable/
trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableSelection.js
Log:
Fixed selection
Property changes on: trunk/sandbox/ui/extendedDataTable
___________________________________________________________________
Name: svn:ignore
- bin
target
.project
+ bin
target
.project
.settings
Modified: trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableSelection.js
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableSelection.js 2008-07-25 08:36:53 UTC (rev 9778)
+++ trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableSelection.js 2008-07-25 09:49:09 UTC (rev 9779)
@@ -222,8 +222,10 @@
refreshEvents: function() {
this.setListeners();
- this.eventKeyPress = this.processKeyDown.bindAsEventListener(this);
- Event.observe(document, "keydown", this.eventKeyPress);
+ if(this.options.selectionMode != "none") {
+ this.eventKeyPress = this.processKeyDown.bindAsEventListener(this);
+ Event.observe(document, "keydown", this.eventKeyPress);
+ }
A4J.AJAX.AddListener({
onafterajax: function(req, event, data) {
if(!$(this.prefix + ":n")) {
@@ -275,9 +277,11 @@
var rowIndex;
var groupingExists = $(this.prefix + ":group-row:0") != null;
if(!groupingExists) { //simple listener binding
- for(var i = 0; i < this.rowCount; i++) {
- rowIndex = Number(nrows[i].id.split(this.prefix)[1].split(":")[2]);
- this.addListener(nrows[i], rowIndex);
+ if(this.options.selectionMode != "none") {
+ for(var i = 0; i < this.rowCount; i++) {
+ rowIndex = Number(nrows[i].id.split(this.prefix)[1].split(":")[2]);
+ this.addListener(nrows[i], rowIndex);
+ }
}
} else { //extended listener binding with grouping
var groupRow;
@@ -313,8 +317,10 @@
groupItems = [];
lastGroupId = groupId;
} else {
- rowIndex = Number(nrows[i].id.split(this.prefix)[1].split(":")[2]);
- this.addListener(nrows[i], rowIndex);
+ if(this.options.selectionMode != "none") {
+ rowIndex = Number(nrows[i].id.split(this.prefix)[1].split(":")[2]);
+ this.addListener(nrows[i], rowIndex);
+ }
groupItems[groupItem++] = nrows[i];
if (!bGroupExpanded) {
nrows[i].style.display = 'none';
@@ -539,16 +545,24 @@
},
setSelection: function(range) {
+ //TODO test for extreemes - first rows, last rows, all rows
+ for(var i = this.selection.ranges.length - 1;i >= 0;i--) {
+ var selection = this.selection.ranges[i].indexes;
+ if(selection == range) {
+ continue;
+ }
+ var j = selection[0];
+ for(j;j <= selection[1];j++) {
+ this.removeRowFromSelection(j);
+ //ClientUILib.log(ClientUILogger.INFO, "Removing: " + j);
+ }
+ }
var i = range[0];
- range[1] = (range[1] + 1) % this.rowCount;
+ range[1] = (range[1] + 1) % this.rowCount;
while (i != range[1]) {
this.addRowToSelection(i);
- i = (i + 1) % this.rowCount;
+ i = (i + 1) % this.rowCount;
}
- while (i != range[0]) {
- this.removeRowFromSelection(i);
- i = (i + 1) % this.rowCount;
- }
},
resetSelection: function(e) {
@@ -557,10 +571,6 @@
}
},
- /*
- Row selection modified because we don't support frozen columns
- */
-
addRowToSelection: function(rowIndex) {
this.selection.addId(rowIndex);
var nElement = $(this.prefix + ":n:" + rowIndex);
16 years, 5 months
JBoss Rich Faces SVN: r9778 - in trunk/docs/cdkguide/en/src/main/docbook: includes and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-07-25 04:36:53 -0400 (Fri, 25 Jul 2008)
New Revision: 9778
Modified:
trunk/docs/cdkguide/en/src/main/docbook/includes/template.xml
trunk/docs/cdkguide/en/src/main/docbook/master.xml
Log:
https://jira.jboss.org/jira/browse/RF-3692 - Templating creation
Modified: trunk/docs/cdkguide/en/src/main/docbook/includes/template.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/includes/template.xml 2008-07-24 18:32:32 UTC (rev 9777)
+++ trunk/docs/cdkguide/en/src/main/docbook/includes/template.xml 2008-07-25 08:36:53 UTC (rev 9778)
@@ -10,8 +10,7 @@
</keywordset>
</sectioninfo>
<title>Templating</title>
- <para> The <property>Component Development Kit (CDK)</property> allows to use the
- <property>templates</property> for generation <property>Renderer</property> class. </para>
+ <para> The <property>Component Development Kit (CDK)</property> allows to use <property>templates</property> for generation <property>Renderer</property> class. </para>
<para> Templates are JSP-like markup pages with special tags that are converted into
<property>Renderer</property> by a build script. </para>
<para> It's possible to use evaluated expressions in components templates with the help of <property>scriptlets</property>.
@@ -19,7 +18,7 @@
implement additional functions in it, so as the functions could be called from the template.
Hence, in the generated <property>Renderer</property> class there are corresponding function
calls on the place of these elements. </para>
- <para> Let's create the template. At first you should proceed to the
+ <para> Let's create the template for <property>HTML 4.0</property> markup. At first you should proceed to the
<property>inputDate/src/main/templates/org/mycompany</property> directory where
<property>htmlInputDate.jspx</property> template file is stored. This file contains a
<property>Template Skeleton</property> like this one: </para>
Modified: trunk/docs/cdkguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/master.xml 2008-07-24 18:32:32 UTC (rev 9777)
+++ trunk/docs/cdkguide/en/src/main/docbook/master.xml 2008-07-25 08:36:53 UTC (rev 9778)
@@ -84,6 +84,24 @@
responsible for the converting information coming from the client to the proper type
for the component (for example, a string value from the request is converted to a
strongly type <code>Date</code> object). </para>
+ <para>
+ It is necessary to create following renderer classes for the <emphasis role="bold">
+ <property><inputDate></property>
+ </emphasis> component:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <code>InputDateRenderer</code> class where you should override <code>encode()</code> method
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <code>InputDateRendererBase</code> class where you should override <code>decode()</code> method.
+ You could also define associated converter in this class.
+ </para>
+ </listitem>
+ </itemizedlist>
<para> You could actually implement the renderer-specific component subclass that
exposes client-side attributes such as <emphasis>
<property>"style"</property>
@@ -95,9 +113,12 @@
<property><inputDate></property>
</emphasis> is a simple <code>UIInput</code> component, therefore
<code>InputDateRenderer</code> class generates all the markup itself. </para>
- <para> It is a time to start creating the <property>Renderer</property>. </para>
- <para> One of the most convenient features of the <property>Component Development Kit
- (CDK)</property> is a <property>Templating</property> mechanism. </para>
+ <para> It is a time to start creating the <code>InputDateRenderer</code> class.
+ The smartest way to create the <code>InputDateRenderer</code> class is a <property>Templating</property> mechanism,
+ one of the most convenient features of the <property>Component Development Kit (CDK)</property>.
+ </para>
+
+
&template; &rendererbase; &skin; </section> ®ister; &ui;
&taghandler; </chapter> &test; &overview; <chapter id="button"
xreflabel="button">
16 years, 5 months
JBoss Rich Faces SVN: r9777 - trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-07-24 14:32:32 -0400 (Thu, 24 Jul 2008)
New Revision: 9777
Added:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxContainerBaseRule.java
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/MethodExpressionAjaxListener.java
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxComponentHandler.java
Log:
https://jira.jboss.org/jira/browse/RF-3927
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxComponentHandler.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxComponentHandler.java 2008-07-24 18:32:28 UTC (rev 9776)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxComponentHandler.java 2008-07-24 18:32:32 UTC (rev 9777)
@@ -23,6 +23,8 @@
import javax.faces.component.ActionSource;
+import org.ajax4jsf.component.AjaxContainerBase;
+
import com.sun.facelets.tag.MetaRuleset;
import com.sun.facelets.tag.jsf.ComponentConfig;
import com.sun.facelets.tag.jsf.ComponentHandler;
@@ -51,6 +53,9 @@
if (ActionSource.class.isAssignableFrom(type)) {
metaRules.addRule(AjaxActionsRule.instance);
}
+ if (AjaxContainerBase.class.isAssignableFrom(type)) {
+ metaRules.addRule(AjaxContainerBaseRule.instance);
+ }
metaRules.addRule(AjaxReRendrRule.instance);
return metaRules;
}
Added: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxContainerBaseRule.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxContainerBaseRule.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxContainerBaseRule.java 2008-07-24 18:32:32 UTC (rev 9777)
@@ -0,0 +1,78 @@
+/**
+ * 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 org.ajax4jsf.component.AjaxContainerBase;
+import org.ajax4jsf.event.AjaxEvent;
+
+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;
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:21 $
+ *
+ */
+public class AjaxContainerBaseRule extends MetaRule {
+
+ public final static Class[] AJAX_LISTENER_SIG = new Class[] { AjaxEvent.class };
+
+ public final static class AjaxListenerMapper extends Metadata {
+
+ private final TagAttribute attr;
+
+ public AjaxListenerMapper(TagAttribute attr) {
+ this.attr = attr;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AjaxContainerBase) instance)
+ .setAjaxListener(this.attr
+ .getMethodExpression(ctx, null,
+ AJAX_LISTENER_SIG));
+ }
+
+ }
+
+ public final static AjaxContainerBaseRule instance = new AjaxContainerBaseRule();
+
+ public AjaxContainerBaseRule() {
+ super();
+ }
+
+ public Metadata applyRule(String name, TagAttribute attribute,
+ MetadataTarget meta) {
+ if (meta.isTargetInstanceOf(AjaxContainerBase.class)) {
+
+
+ if ("ajaxListener".equals(name)) {
+ return new AjaxListenerMapper(attribute);
+ }
+
+ }
+ return null;
+ }
+
+}
Added: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/MethodExpressionAjaxListener.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/MethodExpressionAjaxListener.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/MethodExpressionAjaxListener.java 2008-07-24 18:32:32 UTC (rev 9777)
@@ -0,0 +1,80 @@
+/**
+ * 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.ajax4jsf.webapp.taglib;
+
+import javax.el.MethodExpression;
+import javax.faces.component.StateHolder;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.event.AjaxEvent;
+import org.ajax4jsf.event.AjaxListener;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.2.2
+ */
+
+public class MethodExpressionAjaxListener implements AjaxListener, StateHolder {
+
+ private MethodExpression expression;
+
+ public MethodExpressionAjaxListener() {
+ super();
+ }
+
+ public MethodExpressionAjaxListener(MethodExpression expression) {
+ super();
+ this.expression = expression;
+ }
+
+ public MethodExpression getExpression() {
+ return expression;
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.event.AjaxListener#processAjax(org.ajax4jsf.event.AjaxEvent)
+ */
+ public void processAjax(AjaxEvent event) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ expression.invoke(facesContext.getELContext(), new Object[] {event});
+ }
+
+ public void restoreState(FacesContext context, Object state) {
+ this.expression = (MethodExpression) UIComponentBase.restoreAttachedState(context, state);
+ }
+
+ public Object saveState(FacesContext context) {
+ return UIComponentBase.saveAttachedState(context, this.expression);
+ }
+
+ public boolean isTransient() {
+ return false;
+ }
+
+ public void setTransient(boolean newTransientValue) {
+ if (newTransientValue) {
+ throw new IllegalArgumentException();
+ }
+ }
+
+}
16 years, 5 months
JBoss Rich Faces SVN: r9776 - in trunk/samples/beanValidatorSample/src/main: webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-07-24 14:32:28 -0400 (Thu, 24 Jul 2008)
New Revision: 9776
Modified:
trunk/samples/beanValidatorSample/src/main/java/org/richfaces/DataBean.java
trunk/samples/beanValidatorSample/src/main/webapp/pages/index.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-3927
Modified: trunk/samples/beanValidatorSample/src/main/java/org/richfaces/DataBean.java
===================================================================
--- trunk/samples/beanValidatorSample/src/main/java/org/richfaces/DataBean.java 2008-07-24 18:32:24 UTC (rev 9775)
+++ trunk/samples/beanValidatorSample/src/main/java/org/richfaces/DataBean.java 2008-07-24 18:32:28 UTC (rev 9776)
@@ -4,11 +4,9 @@
package org.richfaces;
import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
-import java.util.ListIterator;
+import org.ajax4jsf.event.AjaxEvent;
import org.hibernate.validator.Max;
import org.hibernate.validator.Valid;
@@ -47,6 +45,8 @@
return total;
}
+ public void ajaxListener(AjaxEvent ajaxEvent) {
+ System.out.println("DataBean.ajaxListener()");
+ }
-
}
Modified: trunk/samples/beanValidatorSample/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/samples/beanValidatorSample/src/main/webapp/pages/index.xhtml 2008-07-24 18:32:24 UTC (rev 9775)
+++ trunk/samples/beanValidatorSample/src/main/webapp/pages/index.xhtml 2008-07-24 18:32:28 UTC (rev 9776)
@@ -38,7 +38,7 @@
</f:facet>
<h:outputLabel for="text" value="#{bean.textDescription}" />
<h:inputText id="text" value="#{bean.text}">
- <v:ajaxValidator event="onblur" />
+ <v:ajaxValidator event="onblur" ajaxListener="#{data.ajaxListener}" />
</h:inputText>
<rich:message for="text" showDetail="true" showSummary="true" />
</h:column>
16 years, 5 months
JBoss Rich Faces SVN: r9775 - in trunk/ui/beanValidator/src/main: java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-07-24 14:32:24 -0400 (Thu, 24 Jul 2008)
New Revision: 9775
Modified:
trunk/ui/beanValidator/src/main/config/component/beanValidator.xml
trunk/ui/beanValidator/src/main/java/org/richfaces/component/UIBeanValidator.java
Log:
https://jira.jboss.org/jira/browse/RF-3927
Modified: trunk/ui/beanValidator/src/main/config/component/beanValidator.xml
===================================================================
--- trunk/ui/beanValidator/src/main/config/component/beanValidator.xml 2008-07-24 17:23:13 UTC (rev 9774)
+++ trunk/ui/beanValidator/src/main/config/component/beanValidator.xml 2008-07-24 18:32:24 UTC (rev 9775)
@@ -50,7 +50,14 @@
</description>
<defaultvalue>true</defaultvalue>
</property>
- <property disabled="true">
+ <property elonly="true" el="true" attachedstate="true" >
+ <name>ajaxListener</name>
+ <classname>javax.el.MethodExpression</classname>
+ <description> MethodExpression representing an action listener method that will be notified when this component is activated by the ajax Request and handle it. The expression must evaluate to a public method that takes an AjaxEvent parameter, with a return type of void</description>
+ <defaultvalue>null</defaultvalue>
+ <methodargs>org.ajax4jsf.event.AjaxEvent</methodargs>
+ </property>
+ <property disabled="true">
<name>bypassUpdates</name>
<classname>boolean</classname>
<description>
@@ -96,5 +103,4 @@
<superclass>javax.faces.webapp.ValidatorELTag</superclass>
</tag>
</validator>
-
</components>
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/component/UIBeanValidator.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/component/UIBeanValidator.java 2008-07-24 17:23:13 UTC (rev 9774)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/component/UIBeanValidator.java 2008-07-24 18:32:24 UTC (rev 9775)
@@ -10,6 +10,7 @@
import java.util.List;
import java.util.Set;
+import javax.el.MethodExpression;
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.component.EditableValueHolder;
@@ -30,6 +31,7 @@
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.event.AjaxListener;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.webapp.taglib.MethodExpressionAjaxListener;
import org.richfaces.event.ValidationEvent;
import com.sun.facelets.FaceletException;
@@ -174,8 +176,7 @@
* @see org.ajax4jsf.event.AjaxSource#addAjaxListener(org.ajax4jsf.event.AjaxListener)
*/
public void addAjaxListener(AjaxListener listener) {
- // TODO Auto-generated method stub
-
+ addFacesListener(listener);
}
/*
@@ -184,16 +185,49 @@
* @see org.ajax4jsf.event.AjaxSource#getAjaxListeners()
*/
public AjaxListener[] getAjaxListeners() {
- // TODO Auto-generated method stub
- return null;
+ return (AjaxListener[]) getFacesListeners(AjaxListener.class);
}
/* (non-Javadoc)
* @see org.ajax4jsf.event.AjaxSource#removeAjaxListener(org.ajax4jsf.event.AjaxListener)
*/
public void removeAjaxListener(AjaxListener listener) {
- // TODO Auto-generated method stub
+ removeFacesListener(listener);
+ }
+ public void setAjaxListener(MethodExpression listener) {
+ AjaxListener[] ajaxListeners = getAjaxListeners();
+ for (int i = 0; i < ajaxListeners.length; i++) {
+ AjaxListener ajaxListener = ajaxListeners[i];
+ if (ajaxListener.getClass().equals(MethodExpressionAjaxListener.class)) {
+ MethodExpressionAjaxListener expressionListener = (MethodExpressionAjaxListener) ajaxListener;
+ if (expressionListener.getExpression() != listener) {
+ removeAjaxListener(ajaxListener);
+
+ if (listener == null) {
+
+ return;
+ } else {
+
+ break;
+ }
+ }
+ }
+ }
+
+ addAjaxListener(new MethodExpressionAjaxListener(listener));
}
-
+
+ public MethodExpression getAjaxListener() {
+ AjaxListener[] ajaxListeners = getAjaxListeners();
+ for (int i = 0; i < ajaxListeners.length; i++) {
+ AjaxListener ajaxListener = ajaxListeners[i];
+ if (ajaxListener.getClass().equals(MethodExpressionAjaxListener.class)) {
+ MethodExpressionAjaxListener expressionListener = (MethodExpressionAjaxListener) ajaxListener;
+ return expressionListener.getExpression();
+ }
+ }
+
+ return null;
+ }
}
16 years, 5 months
JBoss Rich Faces SVN: r9774 - in trunk/samples/treeModelDemo/src/main: webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-07-24 13:23:13 -0400 (Thu, 24 Jul 2008)
New Revision: 9774
Modified:
trunk/samples/treeModelDemo/src/main/java/org/richfaces/Loader.java
trunk/samples/treeModelDemo/src/main/webapp/pages/rf-1081.jsp
Log:
https://jira.jboss.org/jira/browse/RF-1081
Modified: trunk/samples/treeModelDemo/src/main/java/org/richfaces/Loader.java
===================================================================
--- trunk/samples/treeModelDemo/src/main/java/org/richfaces/Loader.java 2008-07-24 16:25:23 UTC (rev 9773)
+++ trunk/samples/treeModelDemo/src/main/java/org/richfaces/Loader.java 2008-07-24 17:23:13 UTC (rev 9774)
@@ -80,6 +80,9 @@
dragEntry.getParent().removeEntry(dragEntry);
dropEntry.addEntry(dragEntry);
+ tree.setRowKey(dragValue);
+ tree.clearTreeNodeState();
+
tree.addRequestKey(tree.getParentRowKey(dragValue));
tree.addRequestKey(dropValue);
}
Modified: trunk/samples/treeModelDemo/src/main/webapp/pages/rf-1081.jsp
===================================================================
--- trunk/samples/treeModelDemo/src/main/webapp/pages/rf-1081.jsp 2008-07-24 16:25:23 UTC (rev 9773)
+++ trunk/samples/treeModelDemo/src/main/webapp/pages/rf-1081.jsp 2008-07-24 17:23:13 UTC (rev 9774)
@@ -69,7 +69,6 @@
</dnd:dropSupport>
</h:panelGroup>
- <a4j:log popup="false" />
</h:form>
</f:view>
</body>
16 years, 5 months