JBoss Rich Faces SVN: r14693 - branches/community/3.3.X/ui/contextMenu/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: ochikvina
Date: 2009-06-23 11:37:04 -0400 (Tue, 23 Jun 2009)
New Revision: 14693
Modified:
branches/community/3.3.X/ui/contextMenu/src/main/config/component/contextMenu.xml
Log:
https://jira.jboss.org/jira/browse/RF-6233 - definitions of the style attributes are corrected;
Modified: branches/community/3.3.X/ui/contextMenu/src/main/config/component/contextMenu.xml
===================================================================
--- branches/community/3.3.X/ui/contextMenu/src/main/config/component/contextMenu.xml 2009-06-23 15:36:37 UTC (rev 14692)
+++ branches/community/3.3.X/ui/contextMenu/src/main/config/component/contextMenu.xml 2009-06-23 15:37:04 UTC (rev 14693)
@@ -161,7 +161,7 @@
<name>selectItemStyle</name>
<classname>java.lang.String</classname>
<description>
- Holds a fragment of a style sheet that applies to the component selected item
+ CSS style rules to be applied to the component selected item
</description>
</property>
@@ -178,7 +178,7 @@
<name>disabledItemStyle</name>
<classname>java.lang.String</classname>
<description>
- Holds a fragment of a style sheet that applies to the component disabled item
+ CSS style rules to be applied to the component disabled item
</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
@@ -196,7 +196,7 @@
<name>itemStyle</name>
<classname>java.lang.String</classname>
<description>
- Holds a fragment of a style sheet that applies to the component item
+ CSS style rules to be applied to the component item
</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
15 years, 6 months
JBoss Rich Faces SVN: r14692 - branches/community/3.3.X/ui/combobox/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: ochikvina
Date: 2009-06-23 11:36:37 -0400 (Tue, 23 Jun 2009)
New Revision: 14692
Modified:
branches/community/3.3.X/ui/combobox/src/main/config/component/combobox.xml
Log:
https://jira.jboss.org/jira/browse/RF-6233 - definitions of the style attributes are corrected;
Modified: branches/community/3.3.X/ui/combobox/src/main/config/component/combobox.xml
===================================================================
--- branches/community/3.3.X/ui/combobox/src/main/config/component/combobox.xml 2009-06-23 15:36:14 UTC (rev 14691)
+++ branches/community/3.3.X/ui/combobox/src/main/config/component/combobox.xml 2009-06-23 15:36:37 UTC (rev 14692)
@@ -155,7 +155,7 @@
<property>
<name>listStyle</name>
<classname>java.lang.String</classname>
- <description>Holds a fragment of a style sheet that applies to the component popup list</description>
+ <description>CSS style rules to be applied to the component popup list</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -166,7 +166,7 @@
<property>
<name>inputStyle</name>
<classname>java.lang.String</classname>
- <description>Holds a fragment of a style sheet that applies to the component input field</description>
+ <description>CSS style rules to be applied to the component input field</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -177,7 +177,7 @@
<property>
<name>inputDisabledStyle</name>
<classname>java.lang.String</classname>
- <description>Holds a fragment of a style sheet that applies to the component input field disabled</description>
+ <description>CSS style rules to be applied to the component input field disabled</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -188,7 +188,7 @@
<property>
<name>inputInactiveStyle</name>
<classname>java.lang.String</classname>
- <description>Holds a fragment of a style sheet that applies to the component inactive input field</description>
+ <description>CSS style rules to be applied to the component inactive input field</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -209,7 +209,7 @@
<property>
<name>buttonStyle</name>
<classname>java.lang.String</classname>
- <description>Holds a fragment of a style sheet that applies to the component button</description>
+ <description>CSS style rules to be applied to the component button</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
@@ -220,7 +220,7 @@
<property>
<name>buttonDisabledStyle</name>
<classname>java.lang.String</classname>
- <description>Holds a fragment of a style sheet that applies to the component button disabled</description>
+ <description>CSS style rules to be applied to the component button disabled</description>
</property>
<property>
<name>buttonDisabledClass</name>
@@ -231,7 +231,7 @@
<property>
<name>buttonInactiveStyle</name>
<classname>java.lang.String</classname>
- <description>Holds a fragment of a style sheet that applies to the component inactive button</description>
+ <description>CSS style rules to be applied to the component inactive button</description>
</property>
<property>
<name>buttonInactiveClass</name>
@@ -242,7 +242,7 @@
<property>
<name>style</name>
<classname>java.lang.String</classname>
- <description>Holds a fragment of a style sheet that applies to the component</description>
+ <description>CSS style rules to be applied to the component</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
15 years, 6 months
JBoss Rich Faces SVN: r14691 - branches/community/3.3.X/ui/calendar/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: ochikvina
Date: 2009-06-23 11:36:14 -0400 (Tue, 23 Jun 2009)
New Revision: 14691
Modified:
branches/community/3.3.X/ui/calendar/src/main/config/component/calendar.xml
Log:
https://jira.jboss.org/jira/browse/RF-6233 - definitions of the style attributes are corrected;
Modified: branches/community/3.3.X/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- branches/community/3.3.X/ui/calendar/src/main/config/component/calendar.xml 2009-06-23 15:28:40 UTC (rev 14690)
+++ branches/community/3.3.X/ui/calendar/src/main/config/component/calendar.xml 2009-06-23 15:36:14 UTC (rev 14691)
@@ -285,7 +285,7 @@
<name>style</name>
<classname>java.lang.String</classname>
<description>
- Holds a fragment of a style sheet that applies to the component
+ CSS style rules to be applied to the component
</description>
</property>
<property>
@@ -298,7 +298,7 @@
<property>
<name>inputStyle</name>
<classname>java.lang.String</classname>
- <description>Holds a fragment of a style sheet that applies to the component input field</description>
+ <description>CSS style rules to be applied to the component input field</description>
</property>
<property>
<name>inputClass</name>
15 years, 6 months
JBoss Rich Faces SVN: r14690 - branches/community/3.3.X/cdk/generator/src/main/resources/META-INF/schema/entities.
by richfaces-svn-commits@lists.jboss.org
Author: ochikvina
Date: 2009-06-23 11:28:40 -0400 (Tue, 23 Jun 2009)
New Revision: 14690
Modified:
branches/community/3.3.X/cdk/generator/src/main/resources/META-INF/schema/entities/content_component_attributes.ent
branches/community/3.3.X/cdk/generator/src/main/resources/META-INF/schema/entities/header_component_attributes.ent
branches/community/3.3.X/cdk/generator/src/main/resources/META-INF/schema/entities/html_style_attributes.ent
Log:
https://jira.jboss.org/jira/browse/RF-6233 - the definitions of the style attributes are corrected;
Modified: branches/community/3.3.X/cdk/generator/src/main/resources/META-INF/schema/entities/content_component_attributes.ent
===================================================================
--- branches/community/3.3.X/cdk/generator/src/main/resources/META-INF/schema/entities/content_component_attributes.ent 2009-06-23 10:03:55 UTC (rev 14689)
+++ branches/community/3.3.X/cdk/generator/src/main/resources/META-INF/schema/entities/content_component_attributes.ent 2009-06-23 15:28:40 UTC (rev 14690)
@@ -2,7 +2,7 @@
<property>
<name>contentStyle</name>
<classname>java.lang.String</classname>
- <description>Holds a fragment of a style sheet that applies to the component content</description>
+ <description>CSS style rules to be applied to the component content</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
Modified: branches/community/3.3.X/cdk/generator/src/main/resources/META-INF/schema/entities/header_component_attributes.ent
===================================================================
--- branches/community/3.3.X/cdk/generator/src/main/resources/META-INF/schema/entities/header_component_attributes.ent 2009-06-23 10:03:55 UTC (rev 14689)
+++ branches/community/3.3.X/cdk/generator/src/main/resources/META-INF/schema/entities/header_component_attributes.ent 2009-06-23 15:28:40 UTC (rev 14690)
@@ -2,7 +2,7 @@
<property>
<name>headerStyle</name>
<classname>java.lang.String</classname>
- <description>Holds a fragment of a style sheet that applies to the component header</description>
+ <description>CSS style rules to be applied to the component header</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
Modified: branches/community/3.3.X/cdk/generator/src/main/resources/META-INF/schema/entities/html_style_attributes.ent
===================================================================
--- branches/community/3.3.X/cdk/generator/src/main/resources/META-INF/schema/entities/html_style_attributes.ent 2009-06-23 10:03:55 UTC (rev 14689)
+++ branches/community/3.3.X/cdk/generator/src/main/resources/META-INF/schema/entities/html_style_attributes.ent 2009-06-23 15:28:40 UTC (rev 14690)
@@ -2,7 +2,7 @@
<property>
<name>style</name>
<classname>java.lang.String</classname>
- <description>Holds a fragment of a style sheet that applies to the component</description>
+ <description>CSS style rules to be applied to the component</description>
</property>
<property>
<name>styleClass</name>
15 years, 6 months
JBoss Rich Faces SVN: r14689 - branches/community/3.3.X/ui/modal-panel/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: ochikvina
Date: 2009-06-23 06:03:55 -0400 (Tue, 23 Jun 2009)
New Revision: 14689
Modified:
branches/community/3.3.X/ui/modal-panel/src/main/config/component/modalPanel.xml
Log:
https://jira.jboss.org/jira/browse/RF-6821 - width/height defaults are corrected;
Modified: branches/community/3.3.X/ui/modal-panel/src/main/config/component/modalPanel.xml
===================================================================
--- branches/community/3.3.X/ui/modal-panel/src/main/config/component/modalPanel.xml 2009-06-22 16:43:08 UTC (rev 14688)
+++ branches/community/3.3.X/ui/modal-panel/src/main/config/component/modalPanel.xml 2009-06-23 10:03:55 UTC (rev 14689)
@@ -55,13 +55,13 @@
<property>
<name>width</name>
<classname>int</classname>
- <description> Attribute defines width of component. Default value is "300". </description>
+ <description> Attribute defines width of component. Default value is "200".</description>
<defaultvalue>-1</defaultvalue>
</property>
<property>
<name>height</name>
<classname>int</classname>
- <description>Attribute defines height of component. Default value is "200". </description>
+ <description>Attribute defines height of component. Default value is "300".</description>
<defaultvalue>-1</defaultvalue>
</property>
<property>
15 years, 6 months
JBoss Rich Faces SVN: r14688 - in branches/sandbox/rf4_build/ui/trunk/components: tree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-06-22 12:43:08 -0400 (Mon, 22 Jun 2009)
New Revision: 14688
Modified:
branches/sandbox/rf4_build/ui/trunk/components/calendar/pom.xml
branches/sandbox/rf4_build/ui/trunk/components/tree/pom.xml
Log:
Modified: branches/sandbox/rf4_build/ui/trunk/components/calendar/pom.xml
===================================================================
--- branches/sandbox/rf4_build/ui/trunk/components/calendar/pom.xml 2009-06-22 16:42:37 UTC (rev 14687)
+++ branches/sandbox/rf4_build/ui/trunk/components/calendar/pom.xml 2009-06-22 16:43:08 UTC (rev 14688)
@@ -16,9 +16,8 @@
<packaging>pom</packaging>
<modules>
- <module>api</module>
- <!-- TODO: create a better name for 'ui' submodule -->
- <module>ui</module>
+ <module>calendar-api</module>
+ <module>calendarf-ui</module>
</modules>
</project>
\ No newline at end of file
Modified: branches/sandbox/rf4_build/ui/trunk/components/tree/pom.xml
===================================================================
--- branches/sandbox/rf4_build/ui/trunk/components/tree/pom.xml 2009-06-22 16:42:37 UTC (rev 14687)
+++ branches/sandbox/rf4_build/ui/trunk/components/tree/pom.xml 2009-06-22 16:43:08 UTC (rev 14688)
@@ -16,9 +16,8 @@
<packaging>pom</packaging>
<modules>
- <module>api</module>
- <!-- TODO: create a better name for 'ui' submodule -->
- <module>ui</module>
+ <module>tree-api</module>
+ <module>tree-ui</module>
</modules>
</project>
\ No newline at end of file
15 years, 6 months
JBoss Rich Faces SVN: r14687 - branches/sandbox/rf4_build/examples/trunk.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-06-22 12:42:37 -0400 (Mon, 22 Jun 2009)
New Revision: 14687
Modified:
branches/sandbox/rf4_build/examples/trunk/pom.xml
Log:
Modified: branches/sandbox/rf4_build/examples/trunk/pom.xml
===================================================================
--- branches/sandbox/rf4_build/examples/trunk/pom.xml 2009-06-21 15:25:46 UTC (rev 14686)
+++ branches/sandbox/rf4_build/examples/trunk/pom.xml 2009-06-22 16:42:37 UTC (rev 14687)
@@ -15,32 +15,65 @@
<artifactId>examples</artifactId>
<packaging>pom</packaging>
+ <properties>
+ <jsf.version>2.0.0-PR2_3</jsf.version>
+ <framework.version>${project.version}</framework.version>
+ <ui.version>${project.version}</ui.version>
+ </properties>
+
<dependencies>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-api</artifactId>
+ <version>${framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>${framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui</artifactId>
+ <version>${ui.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>${jsf.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>${jsf.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
+ <version>1.2</version>
+ <scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- </dependency>
- <dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
</dependency>
@@ -50,9 +83,7 @@
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
</dependency -->
-
- <!-- TODO: move dependencies from version matrix to here -->
- </dependencies>
+ </dependencies>
<modules>
<module>components</module>
15 years, 6 months
JBoss Rich Faces SVN: r14686 - in branches/community/3.3.X/ui/fileUpload/src/main: resources/org/richfaces/renderkit/html/js and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-06-21 11:25:46 -0400 (Sun, 21 Jun 2009)
New Revision: 14686
Modified:
branches/community/3.3.X/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
branches/community/3.3.X/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
branches/community/3.3.X/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
Log:
https://jira.jboss.org/jira/browse/RF-7375
Modified: branches/community/3.3.X/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
===================================================================
--- branches/community/3.3.X/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2009-06-21 13:57:33 UTC (rev 14685)
+++ branches/community/3.3.X/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2009-06-21 15:25:46 UTC (rev 14686)
@@ -415,23 +415,21 @@
* @throws IOException
*/
@SuppressWarnings("unchecked")
- private String getActionScript(FacesContext context, UIComponent component,
- String action, Object oncomplete) throws IOException {
+ public String getActionScript(FacesContext context, UIComponent component) throws IOException {
String clientId = component.getClientId(context);
JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(component, context);
Map<String, Object> parameters = new HashMap<String, Object>();
- parameters.put(FileUploadConstants.FILE_UPLOAD_ACTION, action);
+ parameters.put(FileUploadConstants.FILE_UPLOAD_ACTION, new JSReference("action"));
parameters.put(FileUploadConstants.UPLOAD_FILES_ID, new JSReference("uid"));
parameters.put(AjaxRendererUtils.AJAX_SINGLE_ATTR, clientId);
Map options = AjaxRendererUtils.buildEventOptions(context, component, parameters, true);
- if (oncomplete != null) {
- options.put("onbeforedomupdate", oncomplete);
- }
+ options.put("onbeforedomupdate", new JSReference("callback"));
+
ajaxFunction.addParameter(options);
- JSFunctionDefinition function = new JSFunctionDefinition("uid");
+ JSFunctionDefinition function = new JSFunctionDefinition("uid", "action", "callback");
function.addParameter("event");
function.addToBody(ajaxFunction.toScript());
@@ -462,49 +460,6 @@
}
/**
- * Generates JS script for stopping uploading process
- *
- * @param context
- * @param component
- * @return
- * @throws IOException
- */
- public String getStopScript(FacesContext context, UIComponent component)
- throws IOException {
- JSFunctionDefinition oncomplete = new JSFunctionDefinition();
- oncomplete.addParameter("request");
- oncomplete.addParameter("event");
- oncomplete.addParameter("data");
- StringBuffer body = new StringBuffer("$('");
- body.append(component.getClientId(context));
- body.append("').component.cancelUpload(data);");
- oncomplete.addToBody(body);
- return getActionScript(context, component, FileUploadConstants.FILE_UPLOAD_ACTION_STOP, oncomplete);
- }
-
- /**
- * Generates JS script for getting file size from server
- *
- * @param context
- * @param component
- * @return
- * @throws IOException
- */
- public String getFileSizeScript(FacesContext context, UIComponent component)
- throws IOException {
- JSFunctionDefinition oncomplete = new JSFunctionDefinition();
- oncomplete.addParameter("request");
- oncomplete.addParameter("event");
- oncomplete.addParameter("data");
- StringBuffer body = new StringBuffer("$('");
- body.append(component.getClientId(context));
- body.append("').component.getFileSize(data);");
- oncomplete.addToBody(body);
- return getActionScript(context, component, FileUploadConstants.FILE_UPLOAD_ACTION_PROGRESS, oncomplete);
-
- }
-
- /**
* Generates progress label markup
*
* @param context
Modified: branches/community/3.3.X/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- branches/community/3.3.X/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2009-06-21 13:57:33 UTC (rev 14685)
+++ branches/community/3.3.X/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2009-06-21 15:25:46 UTC (rev 14686)
@@ -184,7 +184,7 @@
},
stop: function() {
- this.uploadObject.stopScript(this.uid);
+ this.uploadObject.executeStopScript(this.uid);
},
_clearInput: function() {
@@ -425,7 +425,7 @@
acceptedTypes: {"*" : true},
- initialize: function(id, actionUrl, stopScript, getFileSizeScript, progressBarId, sessionId, options) {
+ initialize: function(id, actionUrl, actionScript, progressBarId, sessionId, options) {
if(!options) {
options = {};
}
@@ -501,8 +501,7 @@
this.entries = new Array();
this.element.component = this;
- this.stopScript = stopScript;
- this.getFileSizeScript = getFileSizeScript;
+ this.actionScript = actionScript;
this.items = $(this.id + ":fileItems");
this.sessionId = sessionId;
@@ -521,7 +520,13 @@
this.initFileInput();
},
- cancelUpload: function(uid) {
+ executeStopScript: function (uid) {
+ this.actionScript(uid, "richfaces_file_upload_action_stop", this.cancelUpload.bind(this));
+ },
+
+ cancelUpload: function(request, event, data) {
+ var uid = data;
+
if (this.activeEntry && this.activeEntry.uid == uid) {
if (this.watcher) {
this.watcher.oncancel();
@@ -641,9 +646,12 @@
}
},
- getFileSize: function (data) {
+ executeFileSizeScript: function(uid) {
+ this.actionScript(uid, "progress", this.getFileSize.bind(this));
+ },
+
+ getFileSize: function(request, event, data) {
if (data) {
-
if (!this.isFlash) {
this.progressBar.enable();
}
@@ -655,11 +663,11 @@
this.activeEntry.setupLabelUpdate();
}
}
- }else {
+ } else {
if (this.activeEntry) {
this._fileSizeScriptTimeoutId = setTimeout(function() {
this._fileSizeScriptTimeoutId = undefined;
- this.getFileSizeScript(this.activeEntry.uid);
+ this.executeFileSizeScript(this.activeEntry.uid);
}.bind(this), this.progressBar.options['pollinterval'] || 500);
}
}
@@ -1184,7 +1192,7 @@
this.currentInput.disabled = true;
}else {
Richfaces.writeAttribute(parentForm, "target", oldTarget);
- this.getFileSizeScript(entry.uid)
+ this.executeFileSizeScript(entry.uid)
}
}
},
Modified: branches/community/3.3.X/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- branches/community/3.3.X/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2009-06-21 13:57:33 UTC (rev 14685)
+++ branches/community/3.3.X/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2009-06-21 15:25:46 UTC (rev 14686)
@@ -191,8 +191,7 @@
<c:scriptOption name="labels" value="#{labels}" />
</c:scriptObject>
<script type="text/javascript">
- new FileUpload('#{clientId}','#{actionUrl}',#{this:getStopScript(context, component)},
- #{this:getFileSizeScript(context, component)} ,'#{this:getProgressBarId(context, component)}',
+ new FileUpload('#{clientId}','#{actionUrl}', #{this:getActionScript(context, component)}, '#{this:getProgressBarId(context, component)}',
'#{this:getSessionId(context, component)}'
<c:if test="#{not empty options}">
, <f:writeAsScript value="#{options}" />
15 years, 6 months
JBoss Rich Faces SVN: r14685 - in branches/community/3.3.X/ui: calendar/src/main/java/org/richfaces/renderkit and 26 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-06-21 09:57:33 -0400 (Sun, 21 Jun 2009)
New Revision: 14685
Modified:
branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/component/UIAjaxValidator.java
branches/community/3.3.X/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxSupport.java
branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxCommandRendererBase.java
branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java
branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxFormRenderer.java
branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxPollRenderer.java
branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxPushRenderer.java
branches/community/3.3.X/ui/core/src/test/java/org/ajax4jsf/component/AbstractQueueComponentTest.java
branches/community/3.3.X/ui/dataFilterSlider/src/main/java/org/richfaces/renderkit/DataFilterSliderRendererBase.java
branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
branches/community/3.3.X/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
branches/community/3.3.X/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
branches/community/3.3.X/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/ExtDropzoneRendererContributor.java
branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/SimpleTableMenuRenderer.java
branches/community/3.3.X/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
branches/community/3.3.X/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
branches/community/3.3.X/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
branches/community/3.3.X/ui/layout/
branches/community/3.3.X/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
branches/community/3.3.X/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
branches/community/3.3.X/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
branches/community/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
branches/community/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableOptions.java
branches/community/3.3.X/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java
branches/community/3.3.X/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
branches/community/3.3.X/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
branches/community/3.3.X/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java
branches/community/3.3.X/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java
branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-7375
Modified: branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/component/UIAjaxValidator.java
===================================================================
--- branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/component/UIAjaxValidator.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/component/UIAjaxValidator.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -133,7 +133,7 @@
buildOnEvent.append(onsubmit).append(";");
}
buildOnEvent.append(AjaxRendererUtils.buildOnEvent(this,
- getFacesContext(), getEvent()));
+ getFacesContext(), getEvent(), true));
String script = buildOnEvent.toString();
return script;
}
Modified: branches/community/3.3.X/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- branches/community/3.3.X/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -460,7 +460,7 @@
HashMap<String, Object> params = new HashMap<String, Object>();
params.put(calendar.getClientId(context) + CURRENT_DATE_PRELOAD, Boolean.TRUE);
- Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, calendar, params);
+ Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, calendar, params, true);
options.put("calendar", JSReference.THIS);
String oncomplete = AjaxRendererUtils.getAjaxOncomplete(calendar);
Modified: branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxSupport.java
===================================================================
--- branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxSupport.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxSupport.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -95,7 +95,7 @@
buildOnEvent.append(onsubmit).append(";");
}
buildOnEvent.append(AjaxRendererUtils.buildOnEvent(this,
- getFacesContext(), getEvent()));
+ getFacesContext(), getEvent(), true));
String script = buildOnEvent.toString();
return script;
}
Modified: branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxCommandRendererBase.java
===================================================================
--- branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxCommandRendererBase.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxCommandRendererBase.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -80,7 +80,7 @@
public String getOnClick(FacesContext context, UIComponent component) {
StringBuffer onClick;
if (!getUtils().isBooleanAttribute(component, "disabled")) {
- onClick = AjaxRendererUtils.buildOnClick(component, context);
+ onClick = AjaxRendererUtils.buildOnClick(component, context, true);
if (!"reset".equals(component.getAttributes().get("type"))) {
onClick.append(";return false;");
}
Modified: branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java
===================================================================
--- branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -63,7 +63,7 @@
// Create AJAX Submit function.
JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(
component, context,AjaxRendererUtils.AJAX_FUNCTION_NAME);
- Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, component);
+ Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, component, true);
Map<String, Object> parameters = (Map<String, Object>) options.get("parameters");
if (null == parameters) {
parameters = new HashMap<String, Object>();
Modified: branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxFormRenderer.java
===================================================================
--- branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxFormRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxFormRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -132,7 +132,7 @@
component, context,
AJAX_FORM_FUNCTION_NAME);
ajaxFunction.addParameter(AjaxRendererUtils.buildEventOptions(
- context, component));
+ context, component, false));
ajaxFunction.appendScript(onSubmit);
writer.writeURIAttribute("action", onSubmit, "action");
} else {
Modified: branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxPollRenderer.java
===================================================================
--- branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxPollRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxPollRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -59,7 +59,7 @@
StringBuffer script = new StringBuffer("\n");
if(poll.isEnabled()){
JSFunction function = AjaxRendererUtils.buildAjaxFunction(component, context, AJAX_POLL_FUNCTION);
- Map options = AjaxRendererUtils.buildEventOptions(context, component);
+ Map options = AjaxRendererUtils.buildEventOptions(context, component, true);
Integer interval = new Integer(poll.getInterval());
options.put("pollinterval", interval);
options.put("pollId", component.getClientId(context));
Modified: branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxPushRenderer.java
===================================================================
--- branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxPushRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/core/src/main/java/org/ajax4jsf/renderkit/html/AjaxPushRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -69,7 +69,7 @@
if(push.isEnabled()){
JSFunction function = AjaxRendererUtils.buildAjaxFunction(component, context, AJAX_PUSH_FUNCTION);
// Set dummy form id, if nessesary.
- Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, component);
+ Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, component, false);
options.put("dummyForm", component.getClientId(context)+RendererUtils.DUMMY_FORM_ID);
int interval = push.getInterval();
if(interval == Integer.MIN_VALUE){
Modified: branches/community/3.3.X/ui/core/src/test/java/org/ajax4jsf/component/AbstractQueueComponentTest.java
===================================================================
--- branches/community/3.3.X/ui/core/src/test/java/org/ajax4jsf/component/AbstractQueueComponentTest.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/core/src/test/java/org/ajax4jsf/component/AbstractQueueComponentTest.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -103,7 +103,7 @@
public void encodeToHead(FacesContext facesContext, UIComponent component)
throws IOException {
JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(component, facesContext);
- Map<String, Object> options = AjaxRendererUtils.buildEventOptions(facesContext, component);
+ Map<String, Object> options = AjaxRendererUtils.buildEventOptions(facesContext, component, true);
options.put("requestDelay", new JSReference("options.requestDelay"));
options.put("similarityGroupingId", new JSReference("options.similarityGroupingId || '" +
component.getClientId(facesContext) + "'"));
Modified: branches/community/3.3.X/ui/dataFilterSlider/src/main/java/org/richfaces/renderkit/DataFilterSliderRendererBase.java
===================================================================
--- branches/community/3.3.X/ui/dataFilterSlider/src/main/java/org/richfaces/renderkit/DataFilterSliderRendererBase.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/dataFilterSlider/src/main/java/org/richfaces/renderkit/DataFilterSliderRendererBase.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -128,7 +128,7 @@
JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(slider,context);
ajaxFunction.addParameter(AjaxRendererUtils.buildEventOptions(
- context, slider));
+ context, slider, true));
StringBuffer script= new StringBuffer();
ajaxFunction.appendScript(script);
script.append("; return false");
Modified: branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -656,7 +656,7 @@
setRequiresScripts(context);
JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table, context);
- Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(context, table);
+ Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(context, table, true);
@SuppressWarnings("unchecked")
Modified: branches/community/3.3.X/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
===================================================================
--- branches/community/3.3.X/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -283,7 +283,7 @@
JSFunction function = AjaxRendererUtils.buildAjaxFunction(component,
context);
Map eventOptions = AjaxRendererUtils.buildEventOptions(context,
- component);
+ component, true);
Map parameters = (Map) eventOptions.get("parameters");
Map params = getParameters(context,component);
Modified: branches/community/3.3.X/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
===================================================================
--- branches/community/3.3.X/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -109,7 +109,7 @@
DraggableOptions options = new DraggableOptions(draggable);
Map eventOptions = AjaxRendererUtils.buildEventOptions(context, component,
- Collections.singletonMap(DRAG_SOURCE_ID, (Object) component.getClientId(context)));
+ Collections.singletonMap(DRAG_SOURCE_ID, (Object) component.getClientId(context)), true);
Map parameters = (Map) eventOptions.get("parameters");
if (parameters == null) {
Modified: branches/community/3.3.X/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
===================================================================
--- branches/community/3.3.X/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -278,7 +278,7 @@
definition.addParameter("event");
definition.addParameter("drag");
- Map requestOpts = AjaxRendererUtils.buildEventOptions(context, component);
+ Map requestOpts = AjaxRendererUtils.buildEventOptions(context, component, true);
definition.addToBody("var options = ").addToBody(ScriptUtils.toScript(requestOpts)).addToBody(";");
definition.addToBody("options.parameters['" + DROP_TARGET_ID + "'] = '" + component.getClientId(context) + "';");
//TODO nick - remove as legacy
Modified: branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
===================================================================
--- branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -920,7 +920,7 @@
definition.addParameter("ascending");
String id = table.getClientId(context);
Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(
- context, table);
+ context, table, true);
@SuppressWarnings("unchecked")
Map<String, Object> parameters = (Map<String, Object>) eventOptions
.get("parameters");
@@ -955,7 +955,7 @@
protected JSFunction getSortFunction(FacesContext context, UIDataTable table) {
String id = table.getClientId(context);
Map<String, Object> requestOpts = AjaxRendererUtils.buildEventOptions(
- context, table);
+ context, table, true);
@SuppressWarnings("unchecked")
Map<String, Object> parameters = (Map<String, Object>) requestOpts
.get("parameters");
@@ -978,7 +978,7 @@
UIDataTable table) {
String id = table.getClientId(context);
Map<String, Object> requestOpts = AjaxRendererUtils.buildEventOptions(
- context, table);
+ context, table, true);
@SuppressWarnings("unchecked")
Map<String, Object> parameters = (Map<String, Object>) requestOpts
.get("parameters");
@@ -1003,7 +1003,7 @@
definition.addParameter("columnId");
String id = table.getClientId(context);
Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(
- context, table);
+ context, table, true);
@SuppressWarnings("unchecked")
Map<String, Object> parameters = (Map<String, Object>) eventOptions
.get("parameters");
@@ -1032,7 +1032,7 @@
definition.addParameter("event");
definition.addParameter("groupIndex");
Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(
- context, table);
+ context, table, true);
@SuppressWarnings("unchecked")
Map<String, Object> parameters = (Map<String, Object>) eventOptions
.get("parameters");
@@ -1055,7 +1055,7 @@
definition.addParameter("columnWidths");
Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(
- context, table);
+ context, table, true);
@SuppressWarnings("unchecked")
Map<String, Object> parameters = (Map<String, Object>) eventOptions
.get("parameters");
@@ -1076,7 +1076,7 @@
FacesContext context, UIDataTable table) {
boolean ajaxSingle = true;
Map<String, Object> requestOpts = AjaxRendererUtils.buildEventOptions(
- context, table);
+ context, table, true);
JSFunctionDefinition onAjaxCompleteFunction = getOnAjaxCompleteFunction(
context, table);
@@ -1426,7 +1426,7 @@
JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table,
context);
Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(
- context, table);
+ context, table, true);
@SuppressWarnings("unchecked")
Map<String, Object> parameters = (Map<String, Object>) eventOptions
.get("parameters");
Modified: branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/ExtDropzoneRendererContributor.java
===================================================================
--- branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/ExtDropzoneRendererContributor.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/ExtDropzoneRendererContributor.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -95,7 +95,7 @@
definition.addParameter("event");
definition.addParameter("drag");
- Map<String, Object> requestOpts = AjaxRendererUtils.buildEventOptions(context, column);
+ Map<String, Object> requestOpts = AjaxRendererUtils.buildEventOptions(context, column, true);
//replace parameters
String clientId = column.getClientId(context);
@SuppressWarnings("unchecked")
Modified: branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/SimpleTableMenuRenderer.java
===================================================================
--- branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/SimpleTableMenuRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/SimpleTableMenuRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -90,7 +90,7 @@
if ((!columnVisible) || (visibleColumnsCount > 1)) {
boolean ajaxSingle = true;
Map<String, Object> requestOpts = AjaxRendererUtils
- .buildEventOptions(context, dataColumn);
+ .buildEventOptions(context, dataColumn, true);
if (onAjaxCompleteFunction != null)
requestOpts.put(AjaxRendererUtils.ONCOMPLETE_ATTR_NAME,
Modified: branches/community/3.3.X/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
===================================================================
--- branches/community/3.3.X/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -54,8 +54,6 @@
import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
-import org.ajax4jsf.renderkit.ComponentVariables;
-import org.ajax4jsf.renderkit.ComponentsVariableResolver;
import org.ajax4jsf.renderkit.RendererUtils;
import org.ajax4jsf.request.MultipartRequest;
import org.ajax4jsf.resource.CountingOutputWriter;
@@ -209,24 +207,6 @@
}
/**
- * Gets container id
- *
- * @param context -
- * faces context
- * @param component -
- * component
- * @return String container id
- */
- public String getContainerId(FacesContext context, UIComponent component) {
- UIComponent container = (UIComponent) AjaxRendererUtils
- .findAjaxContainer(context, component);
- if (container != null) {
- return container.getClientId(context);
- }
- return null;
- }
-
- /**
* Generates map with internalized labels to be put into JS
*
* @param o
@@ -437,31 +417,21 @@
@SuppressWarnings("unchecked")
private String getActionScript(FacesContext context, UIComponent component,
String action, Object oncomplete) throws IOException {
- ComponentVariables variables = ComponentsVariableResolver.getVariables(
- this, component);
String clientId = component.getClientId(context);
- String containerId = (String) variables.getVariable("containerId");
- JSFunction ajaxFunction = new JSFunction(
- AjaxRendererUtils.AJAX_FUNCTION_NAME);
- ajaxFunction.addParameter(containerId);
- ajaxFunction.addParameter(new JSReference("formId"));
- ajaxFunction.addParameter(new JSReference("event"));
- // AjaxRendererUtils.buildAjaxFunction(
- // component, context);
+ JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(component, context);
- Map options = AjaxRendererUtils.buildEventOptions(context, component);
- Map parameters = (Map) options.get("parameters");
+ Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(FileUploadConstants.FILE_UPLOAD_ACTION, action);
parameters.put(FileUploadConstants.UPLOAD_FILES_ID, new JSReference("uid"));
- parameters.put(clientId, clientId);
parameters.put(AjaxRendererUtils.AJAX_SINGLE_ATTR, clientId);
+
+ Map options = AjaxRendererUtils.buildEventOptions(context, component, parameters, true);
if (oncomplete != null) {
options.put("onbeforedomupdate", oncomplete);
}
ajaxFunction.addParameter(options);
JSFunctionDefinition function = new JSFunctionDefinition("uid");
- function.addParameter("formId");
function.addParameter("event");
function.addToBody(ajaxFunction.toScript());
Modified: branches/community/3.3.X/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- branches/community/3.3.X/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2009-06-21 13:57:33 UTC (rev 14685)
@@ -184,7 +184,7 @@
},
stop: function() {
- this.uploadObject.stopScript(this.uid, this.uploadObject.formId);
+ this.uploadObject.stopScript(this.uid);
},
_clearInput: function() {
@@ -659,7 +659,7 @@
if (this.activeEntry) {
this._fileSizeScriptTimeoutId = setTimeout(function() {
this._fileSizeScriptTimeoutId = undefined;
- this.getFileSizeScript(this.activeEntry.uid, this.formId);
+ this.getFileSizeScript(this.activeEntry.uid);
}.bind(this), this.progressBar.options['pollinterval'] || 500);
}
}
@@ -1123,7 +1123,7 @@
Richfaces.writeAttribute(parentForm, "enctype", "multipart/form-data");
Richfaces.writeAttribute(parentForm, "action",
- this.actionUrl + (/\?/.test(this.actionUrl) ? '&_richfaces_upload_uid' : '?_richfaces_upload_uid') + '=' + encodeURI(entry.uid) + "&" + this.id + "=" + this.id + "&_richfaces_upload_file_indicator=true"+"&AJAXREQUEST="+this.progressBar.containerId);
+ this.actionUrl + (/\?/.test(this.actionUrl) ? '&_richfaces_upload_uid' : '?_richfaces_upload_uid') + '=' + encodeURI(entry.uid) + "&" + this.id + "=" + this.id + "&_richfaces_upload_file_indicator=true"+"&AJAXREQUEST=" + (this.progressBar.options.containerId || A4J.AJAX.VIEW_ROOT_ID));
Richfaces.writeAttribute(parentForm, "target", this.id + "_iframe");
@@ -1184,7 +1184,7 @@
this.currentInput.disabled = true;
}else {
Richfaces.writeAttribute(parentForm, "target", oldTarget);
- this.getFileSizeScript(entry.uid, this.formId)
+ this.getFileSizeScript(entry.uid)
}
}
},
@@ -1336,7 +1336,7 @@
},
_flashGetPostParams: function () {
- var query = new A4J.Query(this.progressBar.containerId, this.form);
+ var query = new A4J.Query(this.progressBar.options.containerId, this.form);
if (query) {
query.appendFormControls();
var qStr = query.getQueryString();
Modified: branches/community/3.3.X/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- branches/community/3.3.X/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2009-06-21 13:57:33 UTC (rev 14685)
@@ -53,8 +53,6 @@
String ajaxActionUrl = ajaxContext.getAjaxActionURL(context);
variables.setVariable("actionUrl", ajaxActionUrl);
- variables.setVariable("formId",getFormId(context, component));
- variables.setVariable("containerId",getContainerId(context, component));
variables.setVariable("listWidth", getFileListWidth(component));
variables.setVariable("listHeight", getFileListHeight(component));
Property changes on: branches/community/3.3.X/ui/layout
___________________________________________________________________
Name: svn:ignore
+ target
Modified: branches/community/3.3.X/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
===================================================================
--- branches/community/3.3.X/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -229,7 +229,7 @@
}
}
scriptValue.append(AjaxRendererUtils.buildOnEvent(
- menuItem, context, event).toString());
+ menuItem, context, event, true).toString());
menuItemAttributes.put(HTML.onselect_ATTRIBUTE, null);
} else if (MenuComponent.MODE_SERVER.equalsIgnoreCase(mode)) {
Modified: branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
===================================================================
--- branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -501,7 +501,7 @@
JSFunction function = AjaxRendererUtils.buildAjaxFunction(child,
context);
Map eventOptions = AjaxRendererUtils.buildEventOptions(context,
- child);
+ child, true);
function.addParameter(eventOptions);
buffer.append(",\"");
Modified: branches/community/3.3.X/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
===================================================================
--- branches/community/3.3.X/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -265,8 +265,6 @@
RendererUtils utils = getUtils();
String clientId = component.getClientId(context);
- String containerId = ((UIComponent) AjaxRendererUtils
- .findAjaxContainer(context, component)).getClientId(context);
utils.addToScriptHash(options, "mode", component.getAttributes().get("mode"), "ajax");
utils.addToScriptHash(options, "minValue", component.getAttributes().get("minValue"), "0");
@@ -279,8 +277,7 @@
utils.addToScriptHash(options, "state", state, "initialState");
utils.addToScriptHash(options, "value", variables.getVariable("value"));
- script.append("new ProgressBar('").append(clientId).append("','") // id
- .append(containerId).append("'"); // containerId
+ script.append("new ProgressBar('").append(clientId).append("'");
if (!options.isEmpty()) {
script.append(",").append(ScriptUtils.toScript(options));
}
@@ -298,7 +295,7 @@
*/
private Map buildAjaxOptions(String clientId, UIProgressBar progressBar,
FacesContext context) {
- Map options = AjaxRendererUtils.buildEventOptions(context, progressBar);
+ Map options = AjaxRendererUtils.buildEventOptions(context, progressBar, true);
Integer interval = new Integer(progressBar.getInterval());
options.put("pollId", clientId);
options.put("pollinterval", interval);
Modified: branches/community/3.3.X/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
===================================================================
--- branches/community/3.3.X/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2009-06-21 13:57:33 UTC (rev 14685)
@@ -9,7 +9,7 @@
options : {},
state : "initialState",
- initialize: function(id, containerId, options) {
+ initialize: function(id, options) {
this.id = id;
Object.extend(this, options);
var f = this.getForm();
@@ -69,7 +69,7 @@
},
poll: function () {
- A4J.AJAX.Poll(this.containerId, this.formId, this.options);
+ A4J.AJAX.Poll(this.formId, this.options);
},
interpolate: function (placeholders) {
for(var k in this.context) {
@@ -248,6 +248,6 @@
if (oncomplete) {
options['oncomplete'] = oncomplete;
}
- A4J.AJAX.SubmitRequest(this.containerId, this.formId, null, options);
+ A4J.AJAX.SubmitRequest(this.formId, null, options);
}
});
Modified: branches/community/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
===================================================================
--- branches/community/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -628,7 +628,7 @@
public String getRowsAjaxUpdate(FacesContext context, UIScrollableDataTable grid){
JSFunction function = AjaxRendererUtils.buildAjaxFunction(grid, context);
- Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, grid);
+ Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, grid, true);
options.put("oncomplete", AjaxFunctionBuilder.getOnComplete(context, grid, AjaxFunctionBuilder.SCROLL));
@SuppressWarnings("unchecked")
Modified: branches/community/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableOptions.java
===================================================================
--- branches/community/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableOptions.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableOptions.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -75,7 +75,7 @@
JSReference sortStartRow = new JSReference("event.startRow");
JSReference sortIndex = new JSReference("event.index");
- Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, grid);
+ Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, grid, true);
@SuppressWarnings("unchecked")
Map<String, Object> parametersMap = (Map)options.get("parameters");
Modified: branches/community/3.3.X/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java
===================================================================
--- branches/community/3.3.X/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -152,7 +152,7 @@
onClick.append(";");
JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(tgComp, context);
- ajaxFunction.addParameter(AjaxRendererUtils.buildEventOptions(context, tgComp));
+ ajaxFunction.addParameter(AjaxRendererUtils.buildEventOptions(context, tgComp, true));
ajaxFunction.appendScript(onClick);
if (tgComp instanceof AjaxSupport) {
Modified: branches/community/3.3.X/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- branches/community/3.3.X/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -391,7 +391,7 @@
submitSuggest.addParameter(targetId);
submitSuggest.addParameter(component.getClientId(context));
submitSuggest.addParameter(component.getAttributes().get("onsubmit"));
- Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, component);
+ Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, component, true);
options.put("popup", component.getClientId(context));
for (int i = 0; i < OPTIONS.length; i++) {
String option = OPTIONS[i];
Modified: branches/community/3.3.X/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- branches/community/3.3.X/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2009-06-21 13:57:33 UTC (rev 14685)
@@ -1008,7 +1008,7 @@
return;
}
- A4J.AJAX.Submit(this.containerId, this.actionUrl, event, this.options);
+ A4J.AJAX.Submit(this.actionUrl, event, this.options);
},
onComplete: function(request, event, data) {
Modified: branches/community/3.3.X/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java
===================================================================
--- branches/community/3.3.X/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -133,7 +133,7 @@
JSFunction function = AjaxRendererUtils.buildAjaxFunction(tab,
context);
Map eventOptions = AjaxRendererUtils.buildEventOptions(context,
- tab);
+ tab, true);
function.addParameter(eventOptions);
StringBuffer buffer = new StringBuffer();
Modified: branches/community/3.3.X/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java
===================================================================
--- branches/community/3.3.X/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -113,7 +113,7 @@
} else if(UITogglePanel.AJAX_METHOD.equals(switchType)) {
// Ajax
if ( !getUtils().isBooleanAttribute(component,"disabled")) {
- return AjaxRendererUtils.buildOnClick(component, context).toString();
+ return AjaxRendererUtils.buildOnClick(component, context, true).toString();
} else {
return "return false;";
}
Modified: branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
===================================================================
--- branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -154,7 +154,7 @@
public Map<String, Object> buildEventOptions(FacesContext context,
UIComponent component) {
Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(
- context, component);
+ context, component, true);
String clientId = component.getClientId(context);
String oncompleteTooltip = "; request.options.control.displayDiv();";
Modified: branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
===================================================================
--- branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -97,7 +97,7 @@
JSFunction function = AjaxRendererUtils.buildAjaxFunction(nodeFacet,
context);
Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(context,
- nodeFacet);
+ nodeFacet, true);
Map<String, Object> parameters = (Map<String, Object>) eventOptions.get("parameters");
parameters.remove(id);
Modified: branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2009-06-21 13:51:28 UTC (rev 14684)
+++ branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2009-06-21 13:57:33 UTC (rev 14685)
@@ -560,7 +560,7 @@
String id = tree.getBaseClientId(context);
JSFunction function = AjaxRendererUtils
.buildAjaxFunction(tree, context);
- Map eventOptions = AjaxRendererUtils.buildEventOptions(context, tree);
+ Map eventOptions = AjaxRendererUtils.buildEventOptions(context, tree, true);
Map parameters = (Map) eventOptions.get("parameters");
parameters.remove(id);
parameters.put(id + UITree.SELECTED_NODE_PARAMETER_NAME,
15 years, 6 months
JBoss Rich Faces SVN: r14684 - in branches/community/3.3.X/framework/impl/src/main: java/org/ajax4jsf/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-06-21 09:51:28 -0400 (Sun, 21 Jun 2009)
New Revision: 14684
Modified:
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
branches/community/3.3.X/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
https://jira.jboss.org/jira/browse/RF-7375
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2009-06-20 14:50:01 UTC (rev 14683)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2009-06-21 13:51:28 UTC (rev 14684)
@@ -70,8 +70,6 @@
public static final String ROOT_ID = "_viewRoot";
- public static final String JS_NULL = "null";
-
private Lifecycle lifecycle;
private AjaxRegionBrige _brige;
@@ -217,9 +215,8 @@
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
String submittedRegionClientId = ajaxContext
.getSubmittedRegionClientId();
- // !submittedRegionClientId.equals(JS_NULL) - fix for myfaces 1.2.4
if (ajaxContext.isAjaxRequest() && submittedRegionClientId != null &&
- !submittedRegionClientId.equals(JS_NULL)
+ !submittedRegionClientId.equals(ROOT_ID)
&& !submittedRegionClientId.equals(getClientId(context))) {
invokeOnComponent(context, submittedRegionClientId, new InvokerCallbackWrapper(callback));
} else {
@@ -539,7 +536,7 @@
String submittedRegionClientId = ajaxContext
.getSubmittedRegionClientId();
boolean invoked = false;
- if (submittedRegionClientId != null && !submittedRegionClientId.equals(JS_NULL) && !submittedRegionClientId.equals(getClientId(context))) {
+ if (submittedRegionClientId != null && !submittedRegionClientId.equals(ROOT_ID) && !submittedRegionClientId.equals(getClientId(context))) {
invoked = invokeOnComponent(context, submittedRegionClientId, _ajaxInvoker);
}
// if container not found, use Root for encode.
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-06-20 14:50:01 UTC (rev 14683)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-06-21 13:51:28 UTC (rev 14684)
@@ -26,7 +26,6 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Locale;
@@ -127,6 +126,8 @@
public static final String SIMILARITY_GROUPING_ID_ATTR = "similarityGroupingId";
+ private static final RendererUtils rendererUtils = RendererUtils.getInstance();
+
/**
* Static class - protect constructor
*
@@ -145,8 +146,24 @@
*/
public static StringBuffer buildOnClick(UIComponent uiComponent,
FacesContext facesContext) {
- return buildOnEvent(uiComponent, facesContext, HTML.onclick_ATTRIBUTE);
+
+ return buildOnClick(uiComponent, facesContext, false);
}
+
+ /**
+ * Build JavaScript onclick event for given component
+ *
+ * @param uiComponent -
+ * component for build event
+ * @param facesContext
+ * @param omitDefaultActionUrl - default action URL is not encoded if parameter is true
+ *
+ * @return <code>StringBuffer</code> with Javascript code
+ */
+ public static StringBuffer buildOnClick(UIComponent uiComponent,
+ FacesContext facesContext, boolean omitDefaultActionUrl) {
+ return buildOnEvent(uiComponent, facesContext, HTML.onclick_ATTRIBUTE, omitDefaultActionUrl);
+ }
/**
* Build JavaScript event for component
@@ -160,6 +177,24 @@
*/
public static StringBuffer buildOnEvent(UIComponent uiComponent,
FacesContext facesContext, String eventName) {
+
+ return buildOnEvent(uiComponent, facesContext, eventName, false);
+ }
+
+ /**
+ * Build JavaScript event for component
+ *
+ * @param uiComponent -
+ * component for build event
+ * @param facesContext
+ * @param eventName -
+ * name of event
+ * @param omitDefaultActionUrl - default action URL is not encoded if parameter is true
+ *
+ * @return <code>StringBuffer</code> with Javascript code
+ */
+ public static StringBuffer buildOnEvent(UIComponent uiComponent,
+ FacesContext facesContext, String eventName, boolean omitDefaultActionUrl) {
StringBuffer onEvent = new StringBuffer();
if (null != eventName) {
String commandOnEvent = (String) uiComponent.getAttributes().get(
@@ -182,7 +217,7 @@
// status - id of request status component.
// parameters - map of parameters name/value for append on request.
// ..........
- ajaxFunction.addParameter(buildEventOptions(facesContext, uiComponent));
+ ajaxFunction.addParameter(buildEventOptions(facesContext, uiComponent, omitDefaultActionUrl));
// appendAjaxSubmitParameters(facesContext, uiComponent, onEvent);
ajaxFunction.appendScript(onEvent);
@@ -204,16 +239,36 @@
return buildEventOptions(facesContext, component, null);
}
+ public static Map<String, Object> buildEventOptions(FacesContext facesContext,
+ UIComponent uiComponent, Map<String, Object> params) {
+
+ return buildEventOptions(facesContext, uiComponent, params, false);
+ }
+
+ public static Map<String, Object> buildEventOptions(FacesContext facesContext,
+ UIComponent component, boolean omitDefaultActionUrl) {
+
+ return buildEventOptions(facesContext, component, null, omitDefaultActionUrl);
+ }
+
/**
* @param facesContext
* @param uiComponent
* @return
*/
public static Map<String, Object> buildEventOptions(FacesContext facesContext,
- UIComponent uiComponent, Map<String, Object> params) {
+ UIComponent uiComponent, Map<String, Object> params, boolean omitDefaultActionUrl) {
String clientId = uiComponent.getClientId(facesContext);
Map<String, Object> componentAttributes = uiComponent.getAttributes();
Map<String, Object> options = new HashMap<String, Object>();
+
+ UIComponent nestingContainer = (UIComponent) findAjaxContainer(
+ facesContext, uiComponent);
+ String containerClientId = nestingContainer.getClientId(facesContext);
+ if (containerClientId != null && !AjaxViewRoot.ROOT_ID.equals(containerClientId)) {
+ options.put("containerId", containerClientId);
+ }
+
Map<String, Object> parameters = new HashMap<String, Object>();
UIComponent targetComponent = (uiComponent instanceof AjaxSupport)?uiComponent.getParent():uiComponent;
// UIForm form = getNestingForm(uiComponent);
@@ -242,9 +297,23 @@
controlValue = clientId;
parameters.put(controlName, controlValue);
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
- // Setup action URL. For portlet environment, it will be different from
- // page.
- options.put("actionUrl", ajaxContext.getAjaxActionURL(facesContext));
+
+ String ajaxActionURL = ajaxContext.getAjaxActionURL(facesContext);
+ if (omitDefaultActionUrl) {
+ UIComponent form = getNestingForm(uiComponent);
+ if (form != null && !rendererUtils.isBooleanAttribute(form, "ajaxSubmit")) {
+ if (rendererUtils.getActionUrl(facesContext).equals(ajaxActionURL)) {
+ ajaxActionURL = null;
+ }
+ }
+ }
+
+ if (ajaxActionURL != null) {
+ // Setup action URL. For portlet environment, it will be different from
+ // page.
+ options.put("actionUrl", ajaxActionURL);
+ }
+
// Add application-wide Ajax parameters
parameters.putAll(ajaxContext.getCommonAjaxParameters());
// add child parameters
@@ -399,18 +468,6 @@
public static JSFunction buildAjaxFunction(UIComponent uiComponent,
FacesContext facesContext, String functionName) {
JSFunction ajaxFunction = new JSFunction(functionName);
- UIComponent nestingContainer = (UIComponent) findAjaxContainer(
- facesContext, uiComponent);
-
-
- String clientId = nestingContainer.getClientId(facesContext);
- if (clientId != null) {
- ajaxFunction.addParameter(clientId);
- } else {
- // fix for myfaces 1.2.4
- ajaxFunction.addParameter(JSReference.NULL);
- }
-
// build form name or ActionUrl for script
UIComponent nestingForm = getNestingForm(uiComponent);
if (null == nestingForm) {
Modified: branches/community/3.3.X/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2009-06-20 14:50:01 UTC (rev 14683)
+++ branches/community/3.3.X/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2009-06-21 13:51:28 UTC (rev 14684)
@@ -10,6 +10,8 @@
A4J.AJAX = {};
+A4J.AJAX.VIEW_ROOT_ID = "_viewRoot";
+
A4J.AJAX.Stub = function() {};
A4J.AJAX.isWebKit = navigator.userAgent.search(/( AppleWebKit\/)([^ ]+)/) != -1;
@@ -671,7 +673,7 @@
*
*
*/
-A4J.AJAX.Poll = function( containerId, form, options ) {
+A4J.AJAX.Poll = function(form, options) {
A4J.AJAX.StopPoll(options.pollId);
if(!options.onerror){
options.onerror = function(req,status,message){
@@ -679,13 +681,13 @@
A4J.AJAX.onError(req,status,message);
}
// For error, re-submit request.
- A4J.AJAX.Poll(containerId,form,options);
+ A4J.AJAX.Poll(form,options);
};
}
if (!options.onqueuerequestdrop) {
options.onqueuerequestdrop = function() {
- A4J.AJAX.Poll(containerId,form,options);
+ A4J.AJAX.Poll(form,options);
};
}
@@ -695,9 +697,9 @@
A4J.AJAX._pollers[options.pollId]=undefined;
if((typeof(options.onsubmit) == 'function') && (options.onsubmit()==false)){
// Onsubmit disable current poll, start next interval.
- A4J.AJAX.Poll(containerId,form,options);
+ A4J.AJAX.Poll(form,options);
} else {
- A4J.AJAX.Submit(containerId,form,null,options);
+ A4J.AJAX.Submit(form,null,options);
}
},options.pollinterval);
};
@@ -713,11 +715,11 @@
*
*
*/
-A4J.AJAX.Push = function( containerId, form, options ) {
+A4J.AJAX.Push = function(form, options) {
A4J.AJAX.StopPush(options.pushId);
options.onerror = function(){
// For error, re-submit request.
- A4J.AJAX.Push(containerId,form,options);
+ A4J.AJAX.Push(form, options);
};
options.onqueuerequestdrop = function() {
@@ -732,7 +734,7 @@
if(request.status == 200){
if(request.getResponseHeader("Ajax-Push-Status")=="READY"){
A4J.AJAX.SetZeroRequestDelay(options);
- A4J.AJAX.Submit(containerId,form||options.dummyForm,null,options);
+ A4J.AJAX.Submit(form||options.dummyForm,null,options);
}
}
} catch(e){
@@ -742,10 +744,10 @@
request=null;
A4J.AJAX._pollers[options.pushId] = null;
// Re-send request.
- A4J.AJAX.Push( containerId, form, options );
+ A4J.AJAX.Push(form, options);
}
}
- A4J.AJAX.SendPush( request,options );
+ A4J.AJAX.SendPush(request, options);
},options.pushinterval);
};
@@ -780,7 +782,7 @@
}
-A4J.AJAX.SubmitForm = function( containerId, form, options ) {
+A4J.AJAX.SubmitForm = function(form, options) {
var opt = A4J.AJAX.CloneObject(options);
// Setup active control if form submitted by button.
if(A4J._formInput){
@@ -789,7 +791,7 @@
A4J._formInput = null;
opt.submitByForm=true;
}
- A4J.AJAX.Submit(containerId,form,null,opt);
+ A4J.AJAX.Submit(form,null,opt);
}
/**
@@ -815,7 +817,7 @@
return domEvt;
};
-A4J.AJAX.PrepareQuery = function(containerId, formId, domEvt, options) {
+A4J.AJAX.PrepareQuery = function(formId, domEvt, options) {
// Process listeners.
for(var li = 0; li < A4J.AJAX._listeners.length; li++){
var listener = A4J.AJAX._listeners[li];
@@ -840,7 +842,7 @@
return false;
};
};
- var tosend = new A4J.Query(containerId, form);
+ var tosend = new A4J.Query(options.containerId, form);
tosend.appendFormControls(options.single, options.control);
//appending options.control moved to appendFormControls
//if(options.control){
@@ -906,9 +908,9 @@
//Submit or put in queue request. It not full queues - framework perform waiting only one request to same queue, new events simple replace last.
//If request for same queue already performed, replace with current parameters.
-A4J.AJAX.Submit = function( containerId, formId, event , options ) {
+A4J.AJAX.Submit = function(formId, event , options ) {
var domEvt = A4J.AJAX.CloneEvent(event);
- var query = A4J.AJAX.PrepareQuery(containerId, formId, domEvt, options);
+ var query = A4J.AJAX.PrepareQuery(formId, domEvt, options);
if (query) {
var queue = A4J.AJAX.EventQueue.getOrCreateQueue(options, formId);
@@ -931,9 +933,9 @@
// list of updated areas in response.
// statusID - DOM id request status tags.
// oncomplete - function for call after complete request.
-A4J.AJAX.SubmitRequest = function( containerId, formId, event, options ) {
+A4J.AJAX.SubmitRequest = function(formId, event, options ) {
var domEvt = A4J.AJAX.CloneEvent(event);
- var query = A4J.AJAX.PrepareQuery(containerId, formId, domEvt, options);
+ var query = A4J.AJAX.PrepareQuery(formId, domEvt, options);
if (query) {
A4J.AJAX.SubmitQuery(query, options, domEvt);
}
@@ -1405,11 +1407,12 @@
// Class for build query string.
A4J.Query = function(containerId, form){
- // For detect AJAX Request.
- this._query = {AJAXREQUEST : containerId};
+ var containerIdOrDefault = containerId || A4J.AJAX.VIEW_ROOT_ID;
+ // For detect AJAX Request.
+ this._query = {AJAXREQUEST : containerIdOrDefault};
this._oldSubmit = null ;
this._form = form;
- this._containerId = containerId;
+ this._containerId = containerIdOrDefault;
this._actionUrl = ( this._form.action)?this._form.action:this._form;
};
15 years, 6 months