JBoss Rich Faces SVN: r11682 - trunk/test-applications/facelets/src/main/webapp/Queue.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-09 14:03:05 -0500 (Tue, 09 Dec 2008)
New Revision: 11682
Modified:
trunk/test-applications/facelets/src/main/webapp/Queue/QueueProperty.xhtml
Log:
Modified: trunk/test-applications/facelets/src/main/webapp/Queue/QueueProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Queue/QueueProperty.xhtml 2008-12-09 19:02:41 UTC (rev 11681)
+++ trunk/test-applications/facelets/src/main/webapp/Queue/QueueProperty.xhtml 2008-12-09 19:03:05 UTC (rev 11682)
@@ -5,6 +5,7 @@
xmlns:rich="http://richfaces.org/rich" id="queuePropertySubviewID">
<h:commandButton value="add test" action="#{queue.addQueue}"></h:commandButton>
+ <a4j:commandButton value="sleep5sec" actionListener="#{queueComponent.sleepThread}"></a4j:commandButton>
<h:panelGrid columns="2">
<h:outputText value="disabled" />
<h:selectBooleanCheckbox value="#{queue.disabled}" onclick="submit()" />
17 years, 5 months
JBoss Rich Faces SVN: r11681 - trunk/test-applications/facelets/src/main/java/queue.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-09 14:02:41 -0500 (Tue, 09 Dec 2008)
New Revision: 11681
Modified:
trunk/test-applications/facelets/src/main/java/queue/QueueComponent.java
Log:
Thread.sleep(5000)
Modified: trunk/test-applications/facelets/src/main/java/queue/QueueComponent.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/queue/QueueComponent.java 2008-12-09 18:56:49 UTC (rev 11680)
+++ trunk/test-applications/facelets/src/main/java/queue/QueueComponent.java 2008-12-09 19:02:41 UTC (rev 11681)
@@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.Date;
+import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
public class QueueComponent {
@@ -23,6 +24,15 @@
private String suggestionValue;
private String suggestionQueue;
+ public void sleepThread(ActionEvent e){
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+
public String getSuggestionValue() {
return suggestionValue;
}
17 years, 5 months
JBoss Rich Faces SVN: r11680 - trunk/test-applications/facelets/src/main/java/rich.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-09 13:56:49 -0500 (Tue, 09 Dec 2008)
New Revision: 11680
Modified:
trunk/test-applications/facelets/src/main/java/rich/Options.java
Log:
+log
Modified: trunk/test-applications/facelets/src/main/java/rich/Options.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/rich/Options.java 2008-12-09 18:56:28 UTC (rev 11679)
+++ trunk/test-applications/facelets/src/main/java/rich/Options.java 2008-12-09 18:56:49 UTC (rev 11680)
@@ -80,15 +80,24 @@
private static String[] INPUTNUMBERSLIDER_STYLE = { "barClass", "barStyle",
"handleClass", "inputClass", "handleSelectedClass", "inputSize",
"styleClass", "inputStyle", "tipStyle", "style", "tipClass" };
-
+
private boolean reDefault;
private boolean reComponent;
private boolean reProperty;
private boolean reStraightforward;
private boolean attribute;
+ private boolean log;
+ public boolean isLog() {
+ return log;
+ }
+
+ public void setLog(boolean log) {
+ this.log = log;
+ }
+
public Options() {
-
+ log = false;
reDefault = true;
reComponent = true;
reProperty = true;
17 years, 5 months
JBoss Rich Faces SVN: r11679 - in trunk/test-applications/facelets/src/main/webapp/pages: RichMenu and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-09 13:56:28 -0500 (Tue, 09 Dec 2008)
New Revision: 11679
Modified:
trunk/test-applications/facelets/src/main/webapp/pages/Rich/Rich.xhtml
trunk/test-applications/facelets/src/main/webapp/pages/RichMenu/RichMenu.xhtml
Log:
+a4j:log
Modified: trunk/test-applications/facelets/src/main/webapp/pages/Rich/Rich.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/pages/Rich/Rich.xhtml 2008-12-09 18:29:36 UTC (rev 11678)
+++ trunk/test-applications/facelets/src/main/webapp/pages/Rich/Rich.xhtml 2008-12-09 18:56:28 UTC (rev 11679)
@@ -57,18 +57,18 @@
<h:messages showDetail="true" showSummary="true"></h:messages>
<h:panelGrid id="richGridID" columns="1" width="100%">
- <h:column rendered="#{option.reComponent}">
+ <h:panelGroup rendered="#{option.reComponent}">
<ui:include src="${richBean.pathComponent}" />
- </h:column>
+ </h:panelGroup>
- <h:column rendered="#{option.reStraightforward}">
+ <h:panelGroup rendered="#{option.reStraightforward}">
<ui:include src="${richBean.pathStraightforward}" />
- </h:column>
+ </h:panelGroup>
- <h:column rendered="#{option.reProperty}">
+ <h:panelGroup rendered="#{option.reProperty}">
<ui:include src="${richBean.pathProperty}" />
- </h:column>
-
+ </h:panelGroup>
+ <a4j:log popup="false" rendered="#{option.log}"></a4j:log>
</h:panelGrid>
<ui:include src="/pages/Info/Info.xhtml" />
Modified: trunk/test-applications/facelets/src/main/webapp/pages/RichMenu/RichMenu.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/pages/RichMenu/RichMenu.xhtml 2008-12-09 18:29:36 UTC (rev 11678)
+++ trunk/test-applications/facelets/src/main/webapp/pages/RichMenu/RichMenu.xhtml 2008-12-09 18:56:28 UTC (rev 11679)
@@ -1,29 +1,42 @@
-<f:subview xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" id="richMenuSubviewID">
+<f:subview xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich" id="richMenuSubviewID">
<h:panelGrid columns="5" border="1">
<h:panelGrid columns="2">
<h:outputText value="h" />
<h:outputText value="a4j" />
<h:commandButton value="submit" style="width : 85px; height : 21px;"></h:commandButton>
- <a4j:commandButton value="submit" reRender="richGridID" style="width : 85px; height : 21px;"></a4j:commandButton>
- <h:commandButton value="immediate" immediate="true" style="width : 85px; height : 21px;"></h:commandButton>
- <a4j:commandButton value="immediate" immediate="true" reRender="richGridID" style="width : 85px; height : 21px;"></a4j:commandButton>
+ <a4j:commandButton value="submit" reRender="richGridID"
+ style="width : 85px; height : 21px;"></a4j:commandButton>
+ <h:commandButton value="immediate" immediate="true"
+ style="width : 85px; height : 21px;"></h:commandButton>
+ <a4j:commandButton value="immediate" immediate="true"
+ reRender="richGridID" style="width : 85px; height : 21px;"></a4j:commandButton>
</h:panelGrid>
<h:panelGrid columns="1">
- <a4j:status startText="WORK!" startStyle="color: red;" stopText="a4j:status"></a4j:status>
+ <h:outputLabel for="a4jLodID" value="a4j:log"></h:outputLabel>
+ <h:selectBooleanCheckbox id="a4jLodID" value="#{option.log}"
+ onchange="submit();"></h:selectBooleanCheckbox>
+ <a4j:status startText="WORK!" startStyle="color: red;"
+ stopText="a4j:status"></a4j:status>
</h:panelGrid>
<h:panelGrid columns="1">
<h:panelGrid columns="4">
<h:outputText value="Default:" />
<h:selectBooleanCheckbox value="#{option.reDefault}" />
-
+
<h:outputText value="Component" />
- <h:selectBooleanCheckbox value="#{option.reComponent}" onchange="submit();" />
+ <h:selectBooleanCheckbox value="#{option.reComponent}"
+ onchange="submit();" />
<h:outputText value="Straightforward" />
- <h:selectBooleanCheckbox value="#{option.reStraightforward}" onchange="submit();" />
+ <h:selectBooleanCheckbox value="#{option.reStraightforward}"
+ onchange="submit();" />
<h:outputText value="Property" />
- <h:selectBooleanCheckbox value="#{option.reProperty}" onchange="submit();" />
+ <h:selectBooleanCheckbox value="#{option.reProperty}"
+ onchange="submit();" />
</h:panelGrid>
</h:panelGrid>
@@ -32,20 +45,22 @@
<h:selectOneMenu binding="#{skinBean.component}" onblur="submit();">
<a4j:support action="#{skinBean.change}" event="onchange" />
</h:selectOneMenu>
- <h:selectOneMenu value="#{skinning.selectSkinning}" onblur="submit();">
- <f:selectItem itemLabel="none" itemValue="none"/>
- <f:selectItem itemLabel="skinning" itemValue="SKINNING"/>
- <f:selectItem itemLabel="skinningClass" itemValue="SKINNING_CLASSES"/>
+ <h:selectOneMenu value="#{skinning.selectSkinning}"
+ onblur="submit();">
+ <f:selectItem itemLabel="none" itemValue="none" />
+ <f:selectItem itemLabel="skinning" itemValue="SKINNING" />
+ <f:selectItem itemLabel="skinningClass" itemValue="SKINNING_CLASSES" />
</h:selectOneMenu>
</h:panelGrid>
<h:panelGrid columns="1">
<h:outputText value="Select component:" />
- <h:selectOneMenu value="#{richBean.src}" immediate="true" onchange="submit();">
+ <h:selectOneMenu value="#{richBean.src}" immediate="true"
+ onchange="submit();">
<f:selectItems value="#{richBean.list}" />
- <f:param value="#{richBean.src}" name="currentComponent"/>
+ <f:param value="#{richBean.src}" name="currentComponent" />
</h:selectOneMenu>
</h:panelGrid>
</h:panelGrid>
<h:commandLink value="Back" action="main"></h:commandLink>
-</f:subview>
+</f:subview>
17 years, 5 months
JBoss Rich Faces SVN: r11678 - in trunk/ui/fileUpload/src/main: flash/src and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-12-09 13:29:36 -0500 (Tue, 09 Dec 2008)
New Revision: 11678
Added:
trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as2proj
trunk/ui/fileUpload/src/main/flash/bin/
trunk/ui/fileUpload/src/main/flash/src/
trunk/ui/fileUpload/src/main/flash/src/FileUploadComponent.as
Removed:
trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/swf/fileUploadComponent.swf
trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4917
Deleted: trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as
===================================================================
--- trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as 2008-12-09 18:14:01 UTC (rev 11677)
+++ trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as 2008-12-09 18:29:36 UTC (rev 11678)
@@ -1,183 +0,0 @@
-/**
- * FlashUploadComponent for Richfaces.ui.flashupload
- */
-/**
- *
- */
-import flash.external.*;
-import flash.net.FileReference;
-import flash.net.FileReferenceList;
-
-// _root variables (from flashVars):
-// fileUploadId:String
-
-class FileUploadComponent {
-
- public static var app : FileUploadComponent;
-
- private var fileDataList: Array;
- private var fileRefList: Array;
- private var acceptedTypes: Object;
- private var noDuplicate: Boolean;
- private var maxFiles: Number;
- private var fileTypes: Array;
- private var uploadIndex: Number;
-
- public function FileUploadComponent() {
- this.fileDataList = new Array();
- this.fileRefList = new Array();
- this.acceptedTypes = new Object();
- this.noDuplicate = true;
- this.maxFiles = 5;
- this.fileTypes = null;
- this.uploadIndex = -1;
-
- ExternalInterface.addCallback("browse", this, browse);
- ExternalInterface.addCallback("setProperties", this, setProperties);
- ExternalInterface.addCallback("removeFile", this, removeFile);
- ExternalInterface.addCallback("uploadFile", this, uploadFile);
- ExternalInterface.addCallback("cancelUploadFile", this, cancelUploadFile);
- }
-
- public function setProperties(properties:Object)
- {
- this.acceptedTypes = properties.acceptedTypes;
- this.noDuplicate = properties.noDuplicate;
- this.maxFiles = properties.maxFiles;
- if (!this.acceptedTypes['*'])
- {
- var types:String = "";
- for (var type in this.acceptedTypes)
- {
- types += "*."+type+";";
- }
- this.fileTypes = [{description: types, extension: types}];
- }
- }
-
- public function removeFile(index:Number)
- {
- if (index<this.uploadIndex) this.uploadIndex--;
- this.fileRefList.splice(index, 1);
- this.fileDataList.splice(index, 1);
- return this.uploadIndex;
- }
-
- public function uploadFile(index, actionURL, postData)
- {
- this.uploadIndex = index;
- var item: FileReference = fileRefList[index];
- if (item)
- {
- if (postData) item["postData"] = postData;
- item.upload(actionURL);
- return item.size;
- }
- return -1;
- }
-
- public function cancelUploadFile(index) {
- var item: FileReference = fileRefList[index];
- if (item)
- {
- item.cancel();
- }
- }
-
-
- public function onSelect (frl: FileReferenceList) {
-
- var list: Array = frl.fileList;
- var item: FileReference;
- for (var i:Number = 0; i < list.length; i++) {
- if (this.fileRefList.length==this.maxFiles) break;
- item = list[i];
- if (!this.checkFileType(item.name) || !this.checkDuplicated(item.name)) {
- ExternalInterface.call(this.getComponentString()+"._flashFireEvent('ontyperejected', {})");
- continue;
- }
- item.addListener(this);
- this.fileRefList.push(item);
- this.fileDataList.push("{creationDate: "+this.getJSDateString(item.creationDate)+", creator: '"+item.creator+"', modificationDate: "+this.getJSDateString(item.modificationDate)+", name: '"+item.name+"', size: "+item.size+", type: '"+item.type+"'}");
- }
- ExternalInterface.call(this.getComponentString()+"._flashAdd(["+this.fileDataList.join(",")+"])");
- }
-
- public function onCancel() {
- }
-
- public function onProgress (file:FileReference, bytesLoaded:Number, bytesTotal:Number) {
- ExternalInterface.call(this.getComponentString()+"._flashOnProgress("+bytesLoaded+", "+bytesTotal+")");
- }
-
- public function onComplete (file:FileReference) {
- ExternalInterface.call(this.getComponentString()+"._flashOnComplete()");
- }
-
- public function onHTTPError (file:FileReference, httpError:Number): Void {
- ExternalInterface.call(this.getComponentString()+"._flashHTTPError("+httpError+")");
- }
- public function onIOError (file:FileReference) {
- ExternalInterface.call(this.getComponentString()+"._flashIOError()");
- }
- public function onSecurityError (file:FileReference, errorString:String) {
- ExternalInterface.call(this.getComponentString()+"._flashOnSecurityError('"+errorString+"')");
- }
-
- public function browse() {
- var fileRef:FileReferenceList = new FileReferenceList();
- fileRef.addListener(this);
- //[{description: "Image files", extension: "*.jpg;*.gif;*.png", macType: "JPEG;jp2_;GIFf;PNGf"}, {description: "Flash Movies", extension: "*.swf", macType: "SWFL"}]
- if (this.fileTypes) fileRef.browse(this.fileTypes); else fileRef.browse();
- }
-
- public function getComponentString()
- {
- return "FlashFileUpload.getComponent('"+_root.fileUploadId+"')";
- }
-
- private function checkFileType (fileType) {
- if (!this.acceptedTypes || this.acceptedTypes['*']) { return true; }
- var p:Number = fileType.lastIndexOf('.');
- if (p!=-1) fileType = fileType.substr(p+1); else fileType="";
- if (this.acceptedTypes[fileType.toLowerCase()]) {
- return true;
- }
- return false;
- }
-
- private function checkDuplicated (fileName:String) {
- if (!this.noDuplicate) return true;
- for (var i = 0; i < this.fileRefList.length; i++) {
- if (fileName == this.fileRefList[i].name) {
- return false;
- }
- }
- return true;
- }
-
- private function getJSDateString(d:Date) {
- var result:String = "new Date(";
- result+=d.getFullYear()+","+d.getMonth()+","+d.getDate()+","+d.getHours()+","+d.getMinutes()+","+d.getSeconds()+","+d.getMilliseconds()+")";
- return result;
- }
-
- private function jstrace (msg: String)
- {
- ExternalInterface.call("FlashFileUpload.ASTrace", msg);
- }
-
- private function jsalert (msg: String)
- {
- ExternalInterface.call("FlashFileUpload.ASAlert", msg);
- }
-
- public static function main(mc) {
- app = new FileUploadComponent();
- ExternalInterface.call(app.getComponentString()+"._flashSetComponent()");
- mc.gotoAndStop(1);
- mc.onEnterFrame = function ()
- {
- };
- }
-}
\ No newline at end of file
Added: trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as2proj
===================================================================
--- trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as2proj (rev 0)
+++ trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as2proj 2008-12-09 18:29:36 UTC (rev 11678)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project>
+ <!-- Output SWF options -->
+ <output>
+ <movie disabled="False" />
+ <movie input="" />
+ <movie path="bin\FileUploadComponent.swf" />
+ <movie fps="10" />
+ <movie width="256" />
+ <movie height="256" />
+ <movie version="8" />
+ <movie background="#FFFFFF" />
+ </output>
+ <!-- Other classes to be compiled into your SWF -->
+ <classpaths>
+ <class path="src" />
+ </classpaths>
+ <!-- Build options -->
+ <build>
+ <option verbose="False" />
+ <option strict="False" />
+ <option infer="False" />
+ <option useMain="True" />
+ <option useMX="False" />
+ <option warnUnusedImports="False" />
+ <option traceMode="FlashConnectExtended" />
+ <option traceFunction="" />
+ <option libraryPrefix="" />
+ <option excludeFile="" />
+ <option groupClasses="False" />
+ <option frame="1" />
+ <option keep="True" />
+ </build>
+ <!-- Class files to compile (other referenced classes will automatically be included) -->
+ <compileTargets>
+ <compile path="src\FileUploadComponent.as" />
+ </compileTargets>
+ <!-- Assets to embed into the output SWF -->
+ <library>
+ <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
+ </library>
+ <!-- Paths to exclude from the Project Explorer tree -->
+ <hiddenPaths>
+ <!-- example: <hidden path="..." /> -->
+ </hiddenPaths>
+ <!-- Executed before build -->
+ <preBuildCommand />
+ <!-- Executed after build -->
+ <postBuildCommand alwaysRun="False" />
+ <!-- Other project options -->
+ <options>
+ <option showHiddenPaths="False" />
+ <option testMovie="NewTab" />
+ </options>
+</project>
\ No newline at end of file
Added: trunk/ui/fileUpload/src/main/flash/src/FileUploadComponent.as
===================================================================
--- trunk/ui/fileUpload/src/main/flash/src/FileUploadComponent.as (rev 0)
+++ trunk/ui/fileUpload/src/main/flash/src/FileUploadComponent.as 2008-12-09 18:29:36 UTC (rev 11678)
@@ -0,0 +1,202 @@
+/**
+ * FlashUploadComponent for Richfaces.ui.flashupload
+ */
+/**
+ *
+ */
+import flash.external.*;
+import flash.net.FileReference;
+import flash.net.FileReferenceList;
+
+// _root variables (from flashVars):
+// fileUploadId:String
+
+class FileUploadComponent {
+
+ private var fileDataList: Array;
+ private var fileRefList: Array;
+ private var acceptedTypes: Object;
+ private var noDuplicate: Boolean;
+ private var maxFiles: Number;
+ private var fileTypes: Array;
+ private var uploadIndex: Number;
+ private var parent:MovieClip;
+
+ public function FileUploadComponent(parent:MovieClip) {
+ this.parent = parent;
+ this.fileDataList = new Array();
+ this.fileRefList = new Array();
+ this.acceptedTypes = new Object();
+ this.noDuplicate = true;
+ this.maxFiles = 5;
+ this.fileTypes = null;
+ this.uploadIndex = -1;
+
+ //ExternalInterface.addCallback("browse", this, browse);
+ ExternalInterface.addCallback("setProperties", this, setProperties);
+ ExternalInterface.addCallback("removeFile", this, removeFile);
+ ExternalInterface.addCallback("uploadFile", this, uploadFile);
+ ExternalInterface.addCallback("cancelUploadFile", this, cancelUploadFile);
+ }
+
+ public function setProperties(properties:Object)
+ {
+ this.acceptedTypes = properties.acceptedTypes;
+ this.noDuplicate = properties.noDuplicate;
+ this.maxFiles = properties.maxFiles;
+ if (!this.acceptedTypes['*'])
+ {
+ var types:String = "";
+ for (var type in this.acceptedTypes)
+ {
+ types += "*."+type+";";
+ }
+ this.fileTypes = [{description: types, extension: types}];
+ }
+ }
+
+ public function removeFile(index:Number)
+ {
+ if (index<this.uploadIndex) this.uploadIndex--;
+ this.fileRefList.splice(index, 1);
+ this.fileDataList.splice(index, 1);
+ return this.uploadIndex;
+ }
+
+ public function uploadFile(index, actionURL, postData)
+ {
+ this.uploadIndex = index;
+ var item: FileReference = fileRefList[index];
+ if (item)
+ {
+ if (postData) item["postData"] = postData;
+ item.upload(actionURL);
+ return item.size;
+ }
+ return -1;
+ }
+
+ public function cancelUploadFile(index) {
+ var item: FileReference = fileRefList[index];
+ if (item)
+ {
+ item.cancel();
+ }
+ }
+
+
+ public function onSelect (frl: FileReferenceList) {
+
+ var list: Array = frl.fileList;
+ var item: FileReference;
+ for (var i:Number = 0; i < list.length; i++) {
+ if (this.fileRefList.length==this.maxFiles) break;
+ item = list[i];
+ if (!this.checkFileType(item.name) || !this.checkDuplicated(item.name)) {
+ ExternalInterface.call(this.getComponentString()+"._flashFireEvent('ontyperejected', {})");
+ continue;
+ }
+ item.addListener(this);
+ this.fileRefList.push(item);
+ this.fileDataList.push("{creationDate: "+this.getJSDateString(item.creationDate)+", creator: '"+item.creator+"', modificationDate: "+this.getJSDateString(item.modificationDate)+", name: '"+item.name+"', size: "+item.size+", type: '"+item.type+"'}");
+ }
+ ExternalInterface.call(this.getComponentString()+"._flashAdd(["+this.fileDataList.join(",")+"])");
+ }
+
+ public function onCancel() {
+ }
+
+ public function onProgress (file:FileReference, bytesLoaded:Number, bytesTotal:Number) {
+ ExternalInterface.call(this.getComponentString()+"._flashOnProgress("+bytesLoaded+", "+bytesTotal+")");
+ }
+
+ public function onComplete (file:FileReference) {
+ ExternalInterface.call(this.getComponentString()+"._flashOnComplete()");
+ }
+
+ public function onHTTPError (file:FileReference, httpError:Number): Void {
+ ExternalInterface.call(this.getComponentString()+"._flashHTTPError("+httpError+")");
+ }
+ public function onIOError (file:FileReference) {
+ ExternalInterface.call(this.getComponentString()+"._flashIOError()");
+ }
+ public function onSecurityError (file:FileReference, errorString:String) {
+ ExternalInterface.call(this.getComponentString()+"._flashOnSecurityError('"+errorString+"')");
+ }
+
+ public function browse() {
+ var fileRef:FileReferenceList = new FileReferenceList();
+ fileRef.addListener(this);
+ //[{description: "Image files", extension: "*.jpg;*.gif;*.png", macType: "JPEG;jp2_;GIFf;PNGf"}, {description: "Flash Movies", extension: "*.swf", macType: "SWFL"}]
+ if (this.fileTypes) fileRef.browse(this.fileTypes); else fileRef.browse();
+ }
+
+ public function getComponentString()
+ {
+ return "FlashFileUpload.getComponent('"+_root.fileUploadId+"')";
+ }
+
+ private function checkFileType (fileType) {
+ if (!this.acceptedTypes || this.acceptedTypes['*']) { return true; }
+ var p:Number = fileType.lastIndexOf('.');
+ if (p!=-1) fileType = fileType.substr(p+1); else fileType="";
+ if (this.acceptedTypes[fileType.toLowerCase()]) {
+ return true;
+ }
+ return false;
+ }
+
+ private function checkDuplicated (fileName:String) {
+ if (!this.noDuplicate) return true;
+ for (var i = 0; i < this.fileRefList.length; i++) {
+ if (fileName == this.fileRefList[i].name) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private function getJSDateString(d:Date) {
+ var result:String = "new Date(";
+ result+=d.getFullYear()+","+d.getMonth()+","+d.getDate()+","+d.getHours()+","+d.getMinutes()+","+d.getSeconds()+","+d.getMilliseconds()+")";
+ return result;
+ }
+
+ private function jstrace (msg: String)
+ {
+ ExternalInterface.call("FlashFileUpload.ASTrace", msg);
+ }
+
+ private function jsalert (msg: String)
+ {
+ ExternalInterface.call("FlashFileUpload.ASAlert", msg);
+ }
+
+ public static function main(swfRoot:MovieClip):Void
+ {
+ // entry point
+ swfRoot.app = new FileUploadComponent(swfRoot);
+ var mc = swfRoot.createEmptyMovieClip("mc", swfRoot.getNextHighestDepth());
+ mc.beginFill(0xffff80, 0);
+ mc.moveTo(0, 0);
+ mc.lineTo(2048, 0);
+ mc.lineTo(2048, 2048);
+ mc.lineTo(0, 2048);
+ mc.lineTo(0, 0);
+ mc.endFill();
+ mc.onRelease = function () { }
+
+ swfRoot.onMouseUp = function ()
+ {
+ swfRoot.app.browse();
+ ExternalInterface.call(swfRoot.app.getComponentString() + "._flashClearFocus()");
+ }
+
+ ExternalInterface.call(swfRoot.app.getComponentString() + "._flashSetComponent()");
+
+ swfRoot.gotoAndStop(1);
+ swfRoot.onEnterFrame = function ()
+ {
+ };
+ }
+}
\ No newline at end of file
Modified: trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-12-09 18:14:01 UTC (rev 11677)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-12-09 18:29:36 UTC (rev 11678)
@@ -1108,50 +1108,51 @@
var allowFlash = this.options.allowFlash;
if (allowFlash=="auto" || allowFlash=="true")
{
- var object = document.createElement('div');
- object.innerHTML = '<a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a>';
+ var div = document.createElement('div');
+ div.innerHTML = '<a href="http://www.adobe.com/go/getflashplayer"><img style="border:0px; margin:2px" src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a>';
var oid = this.id+":flashContainer";
- object.style.display = allowFlash=="true" ? "" : "none";
- object.id = oid;
- this.items.appendChild(object);
+ var object = document.getElementById(oid);
this.isFlash = swfobject.hasFlashPlayerVersion("9.0.28");
if (this.isFlash)
{
this.disable();
var flashvars = {fileUploadId:this.id};
- var params = {allowscriptaccess:true};
- var attributes = {};
- swfobject.embedSWF(this.options.flashComponentUrl, oid, "0", "0", "9.0.28", false, flashvars, params, attributes);
+ var params = {allowscriptaccess:true, menu: "false", wmode: "transparent", salign: "TL", scale: "noscale"};
+ var attributes = {style:"position:absolute; top:0px; left:0px;"};
+ swfobject.embedSWF(this.options.flashComponentUrl, oid, "100%", "100%", "9.0.28", false, flashvars, params, attributes);
+
this.currentInput.parentNode.innerHTML = '<input type="text" style="cursor: pointer; right: 0px; top: 0px; font-size: 10em; position: absolute; padding: 0px" class="rich-fileupload-hidden" id="'+this.id+':file" name="'+this.id+':file"></input>'
this.currentInput = $(this.id + ":file");
- //this.currentInput.type="text";
- //this.currentInput.onchange = null;
+ this.currentInput.style.display = "none";
this.currentInput.onmousedown=(function (){this.createFrame();}).bind(this);
- this.currentInput.onclick = this._flashOnOpenFileDialog.bind(this);
- } else if (allowFlash=="true")
+ } if (allowFlash=="true")
{
+ this.items.appendChild(div);
this.disable();
}
-
}
},
- _flashOnOpenFileDialog: function (event) {
- // call flash
- this.flashComponent.browse();
- return false;
+ _flashClearFocus: function()
+ {
+ //this.flashComponent.style.display = "none";
+ //this.flashComponent.style.display = "";
},
_flashSetComponent: function() {
var flashId = this.id+":flashContainer";
this.flashComponent = (document[flashId]) ? document[flashId] : (window[flashId] ? window[flashId] : $(flashId));
- this.flashComponent.style.display = 'none';
this.flashComponent.setProperties({
acceptedTypes: this.acceptedTypes,
noDuplicate: this.options.noDuplicate,
maxFiles: this.maxFileBatchSize });
+ if (Richfaces.browser.isIE)
+ {
+ this.flashComponent.style.width = this.currentInput.parentNode.style.width;
+ this.flashComponent.style.height = this.currentInput.parentNode.style.height;
+ }
this.enable();
},
@@ -1176,8 +1177,6 @@
}
var newUpload = this.currentInput.cloneNode(true);
- newUpload.onclick = this._flashOnOpenFileDialog.bind(this);
- //this.currentInput.onchange = null;
this.currentInput.style.cssText = "position: absolute; right: 0px; top: 0px; display: none; visibility: hidden;";
newUpload.id = this.id + ":file" + (this.idCounter++);
newUpload.value = '';
Modified: trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/swf/fileUploadComponent.swf
===================================================================
(Binary files differ)
Modified: trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-12-09 18:14:01 UTC (rev 11677)
+++ trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-12-09 18:29:36 UTC (rev 11678)
@@ -24,7 +24,7 @@
<f:clientId var="clientId" />
- <f:resource var="flashComponent" name="/org/richfaces/renderkit/html/swf/fileUploadComponent.swf"/>
+ <f:resource var="flashComponent" name="/org/richfaces/renderkit/html/swf/FileUploadComponent.swf"/>
<jsp:scriptlet>
<![CDATA[
@@ -94,6 +94,7 @@
name="#{clientId}:file"
onchange="return $('#{clientId}').component.add(this);"/>
</div>
+ <div id="#{clientId}:flashContainer" style="display:none"></div>
</div>
</div>
<div class="rich-fileupload-button-border" style=" float:left; display: none;">
17 years, 5 months
JBoss Rich Faces SVN: r11677 - trunk/test-applications/seamApp/web/src/main/webapp/Queue.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-09 13:14:01 -0500 (Tue, 09 Dec 2008)
New Revision: 11677
Modified:
trunk/test-applications/seamApp/web/src/main/webapp/Queue/QueueProperty.xhtml
Log:
+server timeout possibility
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Queue/QueueProperty.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Queue/QueueProperty.xhtml 2008-12-09 18:13:25 UTC (rev 11676)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Queue/QueueProperty.xhtml 2008-12-09 18:14:01 UTC (rev 11677)
@@ -5,7 +5,11 @@
xmlns:rich="http://richfaces.org/rich" id="queuePropertySubviewID">
<h:commandButton value="add test" action="#{queue.addQueue}"></h:commandButton>
- <h:panelGrid columns="2">
+ <a4j:commandButton actionListener="#{queueComponent.sleepThread}"
+ value="sleep5sec" />
+
+ <h:panelGrid columns="2">
+
<h:outputText value="disabled" />
<h:selectBooleanCheckbox value="#{queue.disabled}" onclick="submit()" />
@@ -23,7 +27,7 @@
<a4j:support event="onchange" reRender="queueID"></a4j:support>
</h:inputText>
- <h:outputText value="sizeExceededBehavior" />
+ <h:outputText value="sizeExceededBehavior" />
<h:selectOneRadio value="#{queue.sizeExceededBehavior}"
onchange="submit();">
<f:selectItem itemLabel="dropNext" itemValue="dropNext" />
@@ -31,7 +35,7 @@
<f:selectItem itemLabel="fireNext" itemValue="fireNext" />
<f:selectItem itemLabel="fireNew" itemValue="fireNew" />
</h:selectOneRadio>
-
+
<h:outputText value="timeout" />
<h:inputText value="#{queue.timeout}">
<a4j:support event="onchange" reRender="queueID"></a4j:support>
17 years, 5 months
JBoss Rich Faces SVN: r11676 - in trunk/test-applications/seamApp/web/src/main/webapp/pages: RichMenu and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-09 13:13:25 -0500 (Tue, 09 Dec 2008)
New Revision: 11676
Modified:
trunk/test-applications/seamApp/web/src/main/webapp/pages/Rich/Rich.xhtml
trunk/test-applications/seamApp/web/src/main/webapp/pages/RichMenu/RichMenu.xhtml
Log:
+a4j:log
Modified: trunk/test-applications/seamApp/web/src/main/webapp/pages/Rich/Rich.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/pages/Rich/Rich.xhtml 2008-12-09 18:12:57 UTC (rev 11675)
+++ trunk/test-applications/seamApp/web/src/main/webapp/pages/Rich/Rich.xhtml 2008-12-09 18:13:25 UTC (rev 11676)
@@ -5,7 +5,8 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
- xmlns:s="http://jboss.com/products/seam/taglib">
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:a4j="http://richfaces.org/a4j">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>HelloWorld</title>
@@ -52,6 +53,7 @@
<h:panelGroup rendered="#{option.reProperty}">
<ui:include src="#{richBean.pathProperty}" />
</h:panelGroup>
+ <a4j:log popup="false" rendered="#{option.log}"></a4j:log>
</h:panelGrid>
<ui:include src="/pages/Info/Info.xhtml" />
Modified: trunk/test-applications/seamApp/web/src/main/webapp/pages/RichMenu/RichMenu.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/pages/RichMenu/RichMenu.xhtml 2008-12-09 18:12:57 UTC (rev 11675)
+++ trunk/test-applications/seamApp/web/src/main/webapp/pages/RichMenu/RichMenu.xhtml 2008-12-09 18:13:25 UTC (rev 11676)
@@ -1,49 +1,65 @@
-<f:subview xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" id="richMenuSubviewID">
+<f:subview xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich" id="richMenuSubviewID">
<h:panelGrid columns="5" border="1">
<h:panelGrid columns="2">
<h:outputText value="h" />
<h:outputText value="a4j" />
<h:commandButton value="submit" style="width : 85px; height : 21px;"></h:commandButton>
- <a4j:commandButton value="submit" reRender="richGridID" style="width : 85px; height : 21px;"></a4j:commandButton>
- <h:commandButton value="immediate" immediate="true" style="width : 85px; height : 21px;"></h:commandButton>
- <a4j:commandButton value="immediate" immediate="true" reRender="richGridID" style="width : 85px; height : 21px;"></a4j:commandButton>
+ <a4j:commandButton value="submit" reRender="richGridID"
+ style="width : 85px; height : 21px;"></a4j:commandButton>
+ <h:commandButton value="immediate" immediate="true"
+ style="width : 85px; height : 21px;"></h:commandButton>
+ <a4j:commandButton value="immediate" immediate="true"
+ reRender="richGridID" style="width : 85px; height : 21px;"></a4j:commandButton>
</h:panelGrid>
<h:panelGrid columns="1">
- <a4j:status startText="WORK!" startStyle="color: red;" stopText="a4j:status"></a4j:status>
+ <h:outputLabel for="a4jLodID" value="a4j:log"></h:outputLabel>
+ <h:selectBooleanCheckbox id="a4jLodID" value="#{option.log}"
+ onchange="submit();"></h:selectBooleanCheckbox>
+ <a4j:status startText="WORK!" startStyle="color: red;"
+ stopText="a4j:status"></a4j:status>
</h:panelGrid>
<h:panelGrid columns="1">
<h:panelGrid columns="4">
<h:outputText value="Default:" />
<h:selectBooleanCheckbox value="#{option.reDefault}" />
-
+
<h:outputText value="Component" />
- <h:selectBooleanCheckbox value="#{option.reComponent}" onchange="submit();" />
+ <h:selectBooleanCheckbox value="#{option.reComponent}"
+ onchange="submit();" />
<h:outputText value="Straightforward" />
- <h:selectBooleanCheckbox value="#{option.reStraightforward}" onchange="submit();" />
+ <h:selectBooleanCheckbox value="#{option.reStraightforward}"
+ onchange="submit();" />
<h:outputText value="Property" />
- <h:selectBooleanCheckbox value="#{option.reProperty}" onchange="submit();" />
+ <h:selectBooleanCheckbox value="#{option.reProperty}"
+ onchange="submit();" />
</h:panelGrid>
</h:panelGrid>
<h:panelGrid columns="1">
<h:outputText value="Select skin: " />
- <h:selectOneMenu binding="#{skinBean.skinComponent}" onblur="submit();">
+ <h:selectOneMenu binding="#{skinBean.skinComponent}"
+ onblur="submit();">
<a4j:support action="#{skinBean.change}" event="onchange" />
</h:selectOneMenu>
- <h:selectOneMenu value="#{skinning.selectSkinning}" onblur="submit();">
- <f:selectItem itemLabel="none" itemValue="none"/>
- <f:selectItem itemLabel="skinning" itemValue="SKINNING"/>
- <f:selectItem itemLabel="skinningClass" itemValue="SKINNING_CLASSES"/>
+ <h:selectOneMenu value="#{skinning.selectSkinning}"
+ onblur="submit();">
+ <f:selectItem itemLabel="none" itemValue="none" />
+ <f:selectItem itemLabel="skinning" itemValue="SKINNING" />
+ <f:selectItem itemLabel="skinningClass" itemValue="SKINNING_CLASSES" />
</h:selectOneMenu>
</h:panelGrid>
<h:panelGrid columns="1">
<h:outputText value="Select component:" />
- <h:selectOneMenu value="#{richBean.src}" immediate="true" onchange="submit();">
+ <h:selectOneMenu value="#{richBean.src}" immediate="true"
+ onchange="submit();">
<f:selectItems value="#{richBean.list}" />
- <f:param value="#{richBean.src}" name="currentComponent"/>
+ <f:param value="#{richBean.src}" name="currentComponent" />
</h:selectOneMenu>
</h:panelGrid>
</h:panelGrid>
17 years, 5 months
JBoss Rich Faces SVN: r11675 - trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-09 13:12:57 -0500 (Tue, 09 Dec 2008)
New Revision: 11675
Modified:
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/Options.java
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/RichBean.java
Log:
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/Options.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/Options.java 2008-12-09 18:12:45 UTC (rev 11674)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/Options.java 2008-12-09 18:12:57 UTC (rev 11675)
@@ -1,9 +1,12 @@
package org.richfaces.helloworld.domain.rich;
+import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
@Name("option")
+(a)Scope(ScopeType.SESSION)
public class Options {
private static String[] CALENDAR_EVENT = { "onbeforedomupdate",
"onchanged", "oncollapse", "oncomplete", "oncurrentdateselect",
@@ -90,9 +93,18 @@
private boolean reProperty;
private boolean reStraightforward;
private boolean attribute;
+ private boolean log;
+ public boolean isLog() {
+ return log;
+ }
+
+ public void setLog(boolean log) {
+ this.log = log;
+ }
+
public Options() {
-
+ log = false;
reDefault = true;
reComponent = true;
reProperty = true;
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/RichBean.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/RichBean.java 2008-12-09 18:12:45 UTC (rev 11674)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/RichBean.java 2008-12-09 18:12:57 UTC (rev 11675)
@@ -8,10 +8,13 @@
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
+import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
import org.richfaces.VersionBean;
@Name("richBean")
+(a)Scope(ScopeType.SESSION)
public class RichBean {
private static final String EXT = ".xhtml";
private String version = VersionBean.SCM_REVISION;
17 years, 5 months
JBoss Rich Faces SVN: r11674 - trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/queue.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-09 13:12:45 -0500 (Tue, 09 Dec 2008)
New Revision: 11674
Modified:
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/queue/QueueComponent.java
Log:
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/queue/QueueComponent.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/queue/QueueComponent.java 2008-12-09 17:29:40 UTC (rev 11673)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/queue/QueueComponent.java 2008-12-09 18:12:45 UTC (rev 11674)
@@ -3,14 +3,15 @@
import java.util.ArrayList;
import java.util.Date;
+import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Synchronized;
@Name("queueComponent")
-(a)Scope(ScopeType.SESSION)
public class QueueComponent {
private String inputValue;
private String inputQueue;
@@ -29,6 +30,15 @@
private String suggestionValue;
private String suggestionQueue;
+ public void sleepThread(ActionEvent event){
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ System.out.println("Sleeping for 5 sec failed");
+ e.printStackTrace();
+ }
+ }
+
public String getSuggestionValue() {
return suggestionValue;
}
17 years, 5 months
JBoss Rich Faces SVN: r11673 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-12-09 12:29:40 -0500 (Tue, 09 Dec 2008)
New Revision: 11673
Added:
trunk/docs/userguide/en/src/main/resources/images/editor3.png
Log:
https://jira.jboss.org/jira/browse/RF-5042
added a creenshot
Added: trunk/docs/userguide/en/src/main/resources/images/editor3.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/editor3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 5 months
JBoss Rich Faces SVN: r11672 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-12-09 12:29:04 -0500 (Tue, 09 Dec 2008)
New Revision: 11672
Modified:
trunk/docs/userguide/en/src/main/docbook/included/editor.xml
Log:
https://jira.jboss.org/jira/browse/RF-5042
added a creenshot
Modified: trunk/docs/userguide/en/src/main/docbook/included/editor.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/editor.xml 2008-12-09 17:23:06 UTC (rev 11671)
+++ trunk/docs/userguide/en/src/main/docbook/included/editor.xml 2008-12-09 17:29:04 UTC (rev 11672)
@@ -1101,9 +1101,20 @@
</section>
<section>
<title>Definition of Custom Style Selectors</title>
+
+ <para>On the screenshot there are CSS selectors that define styles for component elements.</para>
+
+ <figure>
+ <title>Classes names</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editor3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
<table>
- <title>Skin parameters redefinition for main text area</title>
+ <title>CSS selectors for the layout of the editor</title>
<tgroup cols="2">
<thead>
17 years, 5 months
JBoss Rich Faces SVN: r11671 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-12-09 12:23:06 -0500 (Tue, 09 Dec 2008)
New Revision: 11671
Modified:
trunk/docs/userguide/en/src/main/docbook/included/editor.xml
Log:
https://jira.jboss.org/jira/browse/RF-5042
added css selectors
Modified: trunk/docs/userguide/en/src/main/docbook/included/editor.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/editor.xml 2008-12-09 17:21:29 UTC (rev 11670)
+++ trunk/docs/userguide/en/src/main/docbook/included/editor.xml 2008-12-09 17:23:06 UTC (rev 11671)
@@ -1114,29 +1114,48 @@
</row>
</thead>
- <tbody>
-
+ <tbody>
<row>
- <entry>generalFamilyFont</entry>
-
- <entry>font-family</entry>
+ <entry>.richfacesSkin table.mceToolbar</entry>
+ <entry></entry>
</row>
-
-
<row>
- <entry>generalTextColor</entry>
-
- <entry>color</entry>
+ <entry>.richfacesSkin .mceButton</entry>
+ <entry></entry>
</row>
-
<row>
- <entry>tableBackgroundColor</entry>
-
- <entry>background</entry>
+ <entry>.richfacesSkin .mceButtonDisabled .mceIcon </entry>
+ <entry></entry>
</row>
+ <row>
+ <entry>.richfacesSkin .mceListBox</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin .mceSeparator</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin .mceIframeContainer</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin table.mceLayout tr.mceLast td</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin table.mceLayout tr.mceFirst td</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin .mceToolbar</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin table.mceLayout</entry>
+ <entry></entry>
+ </row>
-
-
</tbody>
</tgroup>
</table>
17 years, 5 months
JBoss Rich Faces SVN: r11670 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-12-09 12:21:29 -0500 (Tue, 09 Dec 2008)
New Revision: 11670
Modified:
trunk/docs/userguide/en/src/main/docbook/included/editor.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-426
added css selectors
Modified: trunk/docs/userguide/en/src/main/docbook/included/editor.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/editor.xml 2008-12-09 17:10:16 UTC (rev 11669)
+++ trunk/docs/userguide/en/src/main/docbook/included/editor.xml 2008-12-09 17:21:29 UTC (rev 11670)
@@ -715,13 +715,433 @@
</tbody>
</tgroup>
</table>
+
+
+
+
+
+ <table>
+ <title>Skin parameters redefinition for dialog box</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>generalFamilyFont</entry>
+
+ <entry>font-family</entry>
+ </row>
+
+ <row>
+ <entry>generalBackgroundColor</entry>
+
+ <entry>background</entry>
+ </row>
+
+
+
+
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <table>
+ <title>Skin parameters redefinition for link in dialog box</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>generalTextColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>hoverLinkColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+
+
+
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+
+
+ <table>
+ <title>Skin parameters redefinition for link in dialog box</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>generalTextColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>hoverLinkColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+
+
+
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <table>
+ <title>Skin parameters redefinition for fieldset in dialog box</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>generalFamilyFont</entry>
+
+ <entry>font-family</entry>
+ </row>
+
+ <row>
+ <entry>panelBorderColor</entry>
+
+ <entry>border-color</entry>
+ </row>
+
+
+
+
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <table>
+ <title>Skin parameters redefinition for fieldset legend in dialog box</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>generalLinkColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+
+
+
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+
+
+ <table>
+ <title>Skin parameters redefinition for input elements in dialog box</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>warningColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+
+
+ <row>
+ <entry>warningColor</entry>
+
+ <entry>border-color</entry>
+ </row>
+
+
+
+ <row>
+ <entry>controlBackgroundColor</entry>
+
+ <entry>background</entry>
+ </row>
+
+ <row>
+ <entry>tableBorderColor</entry>
+
+ <entry>border-color</entry>
+ </row>
+
+
+ <row>
+ <entry>generalFamilyFont</entry>
+
+ <entry>font-family</entry>
+ </row>
+
+
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+
+
+ <table>
+ <title>Skin parameters redefinition for panel wrapper in dialog box</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>panelBorderColor</entry>
+
+ <entry>border-color</entry>
+ </row>
+
+ <row>
+ <entry>tableBackgroundColor</entry>
+
+ <entry>background</entry>
+ </row>
+
+
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <table>
+ <title>Skin parameters redefinition for headers in dialog box</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>generalLinkColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <table>
+ <title>Skin parameters redefinition for links in tabs in dialog box</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>generalFamilyFont</entry>
+
+ <entry>font-family</entry>
+ </row>
+
+
+ <row>
+ <entry>generalTextColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+
+ <table>
+ <title>Skin parameters redefinition for main text area</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>generalFamilyFont</entry>
+
+ <entry>font-family</entry>
+ </row>
+
+
+ <row>
+ <entry>generalTextColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>tableBackgroundColor</entry>
+
+ <entry>background</entry>
+ </row>
+
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+
+
+
</section>
<section>
- <title>Definition of Custom Style Classes</title>
-
+ <title>Definition of Custom Style Selectors</title>
+
+ <table>
+ <title>Skin parameters redefinition for main text area</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Selector</entry>
+
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>generalFamilyFont</entry>
+
+ <entry>font-family</entry>
+ </row>
+
+
+ <row>
+ <entry>generalTextColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>tableBackgroundColor</entry>
+
+ <entry>background</entry>
+ </row>
+
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
17 years, 5 months
JBoss Rich Faces SVN: r11669 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-12-09 12:10:16 -0500 (Tue, 09 Dec 2008)
New Revision: 11669
Modified:
trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml
Log:
https://jira.jboss.org/jira/browse/RF-391
correcting error in docs due to http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4195281#4195281
Modified: trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml 2008-12-09 16:30:08 UTC (rev 11668)
+++ trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml 2008-12-09 17:10:16 UTC (rev 11669)
@@ -253,7 +253,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[Richfaces.showModalPanel('panelId', {left: auto}, {param1: value1});]]></programlisting>
+ <programlisting role="XML"><![CDATA[Richfaces.showModalPanel('panelId', {left: auto, param1: value1});]]></programlisting>
<para> Thus, except the standard modalPanel parameters you can pass any of your
own parameters. </para>
<para> Also modalPanel allows to handle its own opening and closing events on
17 years, 5 months
JBoss Rich Faces SVN: r11668 - in trunk/test-applications/facelets/src/main: webapp/PickList and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-12-09 11:30:08 -0500 (Tue, 09 Dec 2008)
New Revision: 11668
Modified:
trunk/test-applications/facelets/src/main/java/util/event/Event.java
trunk/test-applications/facelets/src/main/webapp/PickList/PickList.xhtml
trunk/test-applications/facelets/src/main/webapp/PickList/PickListProperty.xhtml
Log:
+ events to pickList
Modified: trunk/test-applications/facelets/src/main/java/util/event/Event.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/util/event/Event.java 2008-12-09 16:29:42 UTC (rev 11667)
+++ trunk/test-applications/facelets/src/main/java/util/event/Event.java 2008-12-09 16:30:08 UTC (rev 11668)
@@ -128,7 +128,16 @@
private String onsetup;
private String onsave;
private String onsizeexceeded;
+ private String onlistchanged;
+ public String getOnlistchanged() {
+ return onlistchanged;
+ }
+
+ public void setOnlistchanged(String onlistchanged) {
+ this.onlistchanged = onlistchanged;
+ }
+
public String getOnsizeexceeded() {
return onsizeexceeded;
}
@@ -139,6 +148,7 @@
// showEvent('onkeypressInputID', 'onkeypress work!')
public Event() {
+ onlistchanged = "showEvent('formID:infoSubview:onlistchangedInputID', 'onlistchanged work!')";
onsave = "showEvent('formID:infoSubview:onsaveInputID', 'onsave work!')";
onsetup = "showEvent('formID:infoSubview:onsetupInputID', 'onsetup work!')";
onitemclick = "showEvent('formID:infoSubview:onitemclickInputID', 'onitemclick work!')";
Modified: trunk/test-applications/facelets/src/main/webapp/PickList/PickList.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/PickList/PickList.xhtml 2008-12-09 16:29:42 UTC (rev 11667)
+++ trunk/test-applications/facelets/src/main/webapp/PickList/PickList.xhtml 2008-12-09 16:30:08 UTC (rev 11668)
@@ -29,10 +29,10 @@
onkeypress="#{event.onkeypress}"
onkeyup="#{event.onkeyup}"
onmousedown="#{event.onmousedown}"
- onmousemove="#{event.onmousemove}"
- onmouseout="#{event.onmouseout}"
- onmouseover="#{event.onmouseover}"
- onmouseup="#{event.onmouseup}"
+ onmousemove="#{event.onmousemove}" onblur="#{event.onblur}"
+ onmouseout="#{event.onmouseout}" onfocus="#{event.onfocus}"
+ onmouseover="#{event.onmouseover}"
+ onmouseup="#{event.onmouseup}" onlistchanged="#{event.onlistchanged}"
binding="#{pickList.myPickList}">
<f:selectItem itemValue="selectItem" itemLabel="selectItem" />
<f:selectItem itemValue="selectItem 1" itemLabel="selectItem 1" />
Modified: trunk/test-applications/facelets/src/main/webapp/PickList/PickListProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/PickList/PickListProperty.xhtml 2008-12-09 16:29:42 UTC (rev 11667)
+++ trunk/test-applications/facelets/src/main/webapp/PickList/PickListProperty.xhtml 2008-12-09 16:30:08 UTC (rev 11668)
@@ -83,6 +83,7 @@
</h:panelGrid>
<br />
<br />
+ <!--
<div style="FONT-WEIGHT: bold;">rich:findComponent</div>
<h:panelGrid columns="2">
<rich:column>
@@ -93,4 +94,5 @@
value="#{rich:findComponent('pickListID').selectedValues}" />
</rich:column>
</h:panelGrid>
+ -->
</f:subview>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r11667 - in trunk/test-applications/jsp/src/main: java/util/event and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-12-09 11:29:42 -0500 (Tue, 09 Dec 2008)
New Revision: 11667
Modified:
trunk/test-applications/jsp/src/main/java/pickList/PickList.java
trunk/test-applications/jsp/src/main/java/util/event/Event.java
trunk/test-applications/jsp/src/main/webapp/PickList/PickList.jsp
trunk/test-applications/jsp/src/main/webapp/PickList/PickListProperty.jsp
Log:
+ events to pickList
Modified: trunk/test-applications/jsp/src/main/java/pickList/PickList.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/pickList/PickList.java 2008-12-09 16:28:04 UTC (rev 11666)
+++ trunk/test-applications/jsp/src/main/java/pickList/PickList.java 2008-12-09 16:29:42 UTC (rev 11667)
@@ -108,6 +108,7 @@
}
public void valueChangeListener(ValueChangeEvent event) {
+ System.out.println("valueChangeListener work!");
valueCL = "valueChangeListener work!";
}
Modified: trunk/test-applications/jsp/src/main/java/util/event/Event.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/event/Event.java 2008-12-09 16:28:04 UTC (rev 11666)
+++ trunk/test-applications/jsp/src/main/java/util/event/Event.java 2008-12-09 16:29:42 UTC (rev 11667)
@@ -130,7 +130,16 @@
private String onsetup;
private String onsave;
private String onsizeexceeded;
+ private String onlistchanged;
+ public String getOnlistchanged() {
+ return onlistchanged;
+ }
+
+ public void setOnlistchanged(String onlistchanged) {
+ this.onlistchanged = onlistchanged;
+ }
+
public String getOnsetup() {
return onsetup;
}
@@ -166,6 +175,7 @@
// showEvent('onkeypressInputID', 'onkeypress work!')
public Event() {
/* Events for toolBar */
+ onlistchanged = "showEvent('infoFormID:infoSubview:onlistchangedInputID', 'onlistchanged work!')";
onsave = "showEvent('infoFormID:infoSubview:onsaveInputID', 'onsave work!')";
onsetup = "showEvent('infoFormID:infoSubview:onsetupInputID', 'onsetup work!')";
onitemclick = "showEvent('infoFormID:infoSubview:onitemclickInputID', 'onitemclick work!')";
Modified: trunk/test-applications/jsp/src/main/webapp/PickList/PickList.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/PickList/PickList.jsp 2008-12-09 16:28:04 UTC (rev 11666)
+++ trunk/test-applications/jsp/src/main/webapp/PickList/PickList.jsp 2008-12-09 16:29:42 UTC (rev 11667)
@@ -27,13 +27,13 @@
ondblclick="#{event.ondblclick}"
onkeydown="#{event.onkeydown}"
onkeypress="#{event.onkeypress}"
- onkeyup="#{event.onkeyup}"
+ onkeyup="#{event.onkeyup}"
onmousedown="#{event.onmousedown}"
onmousemove="#{event.onmousemove}"
- onmouseout="#{event.onmouseout}"
+ onmouseout="#{event.onmouseout}" onlistchanged="#{event.onlistchanged}"
onmouseover="#{event.onmouseover}"
onmouseup="#{event.onmouseup}"
- binding="#{pickList.myPickList}">
+ binding="#{pickList.myPickList}" onblur="#{event.onblur}" onfocus="#{event.onfocus}">
<f:selectItems value="#{pickList.data}"/>
</rich:pickList>
<h:panelGrid columns="2">
Modified: trunk/test-applications/jsp/src/main/webapp/PickList/PickListProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/PickList/PickListProperty.jsp 2008-12-09 16:28:04 UTC (rev 11666)
+++ trunk/test-applications/jsp/src/main/webapp/PickList/PickListProperty.jsp 2008-12-09 16:29:42 UTC (rev 11667)
@@ -82,6 +82,7 @@
</h:panelGrid>
<br />
<br />
+ <%--
<div style="FONT-WEIGHT: bold;">rich:findComponent</div>
<h:panelGrid columns="2">
<rich:column>
@@ -91,4 +92,5 @@
<h:outputText value="#{rich:findComponent('pickListID').selectedValues}" />
</rich:column>
</h:panelGrid>
+ --%>
</f:subview>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r11666 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-12-09 11:28:04 -0500 (Tue, 09 Dec 2008)
New Revision: 11666
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
https://jira.jboss.org/jira/browse/RF-4584
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-12-09 15:18:48 UTC (rev 11665)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-12-09 16:28:04 UTC (rev 11666)
@@ -101,28 +101,50 @@
buttonMouseUpHandler : function(e) {
this.buttonBG.className = "rich-combobox-font rich-combobox-button-background rich-combobox-button";
this.button.className = this.classes.button.classes.active + " rich-combobox-button-hovered";
+
+ var styleCss = this.classes.button.style;
+ if(styleCss && !styleCss.active.blank()) {
+ Element.setStyle(this.button,styleCss.active);
+ }
+
this.field.focus();
},
buttonMousedownHandler : function(e) {
this.buttonBG.className = "rich-combobox-font rich-combobox-button-pressed-background rich-combobox-button";
this.button.className = this.classes.button.classes.active + " rich-combobox-button-hovered";
+
+ var styleCss = this.classes.button.style;
+ if(styleCss && !styleCss.active.blank()) {
+ Element.setStyle(this.button,styleCss.active);
+ }
+
this.comboList.isList = true;
},
buttonMouseOverHandler : function(e) {
var classCss = this.classes.button.classes;
var iconStyles = this.classes.buttonicon.style;
-
+ var styleCss = this.classes.button.style;
if (this.isActive()) {
this.button.className= classCss.active + " " + classCss.hovered;
- if (!iconStyles.active.blank()) {
+
+ if(styleCss && !styleCss.active.blank()) {
+ Element.setStyle(this.button,styleCss.active);
+ }
+
+ if (iconStyles && !iconStyles.active.blank()) {
Element.setStyle(this.button,{backgroundImage : iconStyles.active});
}
} else {
this.button.className = classCss.normal + " " + classCss.hovered;
- if (!iconStyles.normal.blank()) {
+
+ if(styleCss && !styleCss.normal.blank()) {
+ Element.setStyle(this.button,styleCss.normal);
+ }
+
+ if (iconStyles && !iconStyles.normal.blank()) {
Element.setStyle(this.button,{backgroundImage : iconStyles.normal});
}
}
@@ -130,16 +152,27 @@
buttonMouseOutHandler : function(e) {
var classCss = this.classes.button.classes;
+ var styleCss = this.classes.button.style;
var iconStyles = this.classes.buttonicon.style;
if (this.isActive()) {
this.button.className= classCss.active;
- if (!iconStyles.active.blank()) {
- Element.setStyle(this.button,{backgroundImage : iconStyles.active});
+
+ if(styleCss && !styleCss.active.blank()) {
+ Element.setStyle(this.button,styleCss.active);
+ }
+
+ if (iconStyles && !iconStyles.active.blank()) {
+ Element.setStyle(this.button,{backgroundImage : iconStyles.active});
}
} else {
this.button.className = classCss.normal;
- if (!iconStyles.normal.blank()) {
+
+ if(styleCss && !styleCss.normal.blank()) {
+ Element.setStyle(this.button,styleCss.normal);
+ }
+
+ if (iconStyles && !iconStyles.normal.blank()) {
Element.setStyle(this.button,{backgroundImage : iconStyles.normal});
}
}
@@ -359,8 +392,13 @@
this.field.className = this.classes.field.classes.disabled;
Element.setStyle(this.field, this.classes.field.style.disabled);
+ var styleCss = this.classes.button.style;
+ if(styleCss && !styleCss.disabled.blank()) {
+ Element.setStyle(this.button, styleCss.disabled);
+ }
+
var iconStyles = this.classes.buttonicon.style;
- if(!iconStyles.disabled.blank()) {
+ if(iconStyles && !iconStyles.disabled.blank()) {
Element.setStyle(this.button,{backgroundImage : iconStyles.disabled});
}
@@ -381,6 +419,11 @@
if(!iconStyles.normal.blank()) {
Element.setStyle(this.button,{backgroundImage : iconStyles.normal});
}
+
+ var styleCss = this.classes.button.style;
+ if(styleCss && !styleCss.normal.blank()) {
+ Element.setStyle(this.button, styleCss.normal);
+ }
this.button.disabled = false;
this.field.disabled = false;
17 years, 5 months
JBoss Rich Faces SVN: r11665 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-09 10:18:48 -0500 (Tue, 09 Dec 2008)
New Revision: 11665
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/testMoreThanOneMessage.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5127
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/testMoreThanOneMessage.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/testMoreThanOneMessage.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java 2008-12-09 15:06:12 UTC (rev 11664)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java 2008-12-09 15:18:48 UTC (rev 11665)
@@ -29,7 +29,11 @@
protected String label;
protected void init(Template template) {
- renderPage(template, "#{messageBean.init}");
+ init(template, null);
+ }
+
+ protected void init(Template template, String url) {
+ renderPage(url, template, "#{messageBean.init}");
mainForm = getParentId() + "mainForm";
inputText = mainForm + ":inputText";
message = mainForm + ":message";
@@ -112,13 +116,13 @@
public void testRendered(Template template) {
init(template);
init(template);
- Assert.assertTrue(selenium.isElementPresent(message), "ListShuttle must be rendered.");
+ Assert.assertTrue(selenium.isElementPresent(message), "Message must be rendered.");
selenium.click(rendered);
waitForAjaxCompletion();
clickAjaxCommandAndWait(submit);
- Assert.assertFalse(selenium.isElementPresent(message), "ListShuttle mustn't be rendered.");
+ Assert.assertFalse(selenium.isElementPresent(message), "Message mustn't be rendered.");
}
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java 2008-12-09 15:06:12 UTC (rev 11664)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java 2008-12-09 15:18:48 UTC (rev 11665)
@@ -1,9 +1,14 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
+import org.testng.Assert;
+import org.testng.annotations.Test;
public class MessagesTest extends AbstractMessageTest {
+ private static String TEST_MORE_THAN_ONE_MESSAGE = "pages/message/testMoreThanOneMessage.xhtml";
+ private static String TEST_MESSAGES_WITH_FOR_ATTRIBUTE = "pages/message/testMessagesWithForAttribute.xhtml";
+
@Override
protected void init(Template template) {
super.init(template);
@@ -14,4 +19,31 @@
public String getTestUrl() {
return "pages/message/messages.xhtml";
}
+
+ @Test
+ public void testComponentOutputAllMessagesByAjax(Template template) {
+ init(template, TEST_MORE_THAN_ONE_MESSAGE);
+
+ Assert.assertFalse(selenium.isElementPresent(mainForm + ":fatalMarker"));
+ Assert.assertFalse(selenium.isElementPresent(mainForm + ":errorMarker"));
+
+ selenium.type(inputText, "fatal");
+ selenium.type(inputText + "2", "");
+ selenium.type(inputText + "3", "");
+
+ clickAjaxCommandAndWait(mainForm + ":submitWithoutReRender");
+ Assert.assertTrue(selenium.isElementPresent(mainForm + ":fatalMarker"));
+ Assert.assertTrue(selenium.isElementPresent(mainForm + ":errorMarker"));
+ Assert.assertEquals("messageSummary", selenium.getText("xpath=id('" + message + "')/dt[1]/span[2]"));
+ Assert.assertEquals("Required message 1", selenium.getText("xpath=id('" + message + "')/dt[2]/span[2]"));
+ Assert.assertEquals("Required message 2", selenium.getText("xpath=id('" + message + "')/dt[3]/span[2]"));
+
+ selenium.type(inputText, "passed");
+ selenium.type(inputText + "2", "passed");
+ selenium.type(inputText + "3", "passed");
+
+ clickAjaxCommandAndWait(mainForm + ":submitWithoutReRender");
+ Assert.assertFalse(selenium.isElementPresent(mainForm + ":fatalMarker"));
+ Assert.assertFalse(selenium.isElementPresent(mainForm + ":errorMarker"));
+ }
}
17 years, 5 months
JBoss Rich Faces SVN: r11664 - Reports/3.3.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-12-09 10:06:12 -0500 (Tue, 09 Dec 2008)
New Revision: 11664
Added:
trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA3.xls
Log:
Added: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA3.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA3.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 5 months
JBoss Rich Faces SVN: r11663 - trunk/test-applications/facelets/src/main/webapp/HotKey.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-12-09 09:27:43 -0500 (Tue, 09 Dec 2008)
New Revision: 11663
Modified:
trunk/test-applications/facelets/src/main/webapp/HotKey/HotKey.xhtml
Log:
changes in hotKey
Modified: trunk/test-applications/facelets/src/main/webapp/HotKey/HotKey.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/HotKey/HotKey.xhtml 2008-12-09 14:27:23 UTC (rev 11662)
+++ trunk/test-applications/facelets/src/main/webapp/HotKey/HotKey.xhtml 2008-12-09 14:27:43 UTC (rev 11663)
@@ -1,19 +1,26 @@
-<f:subview xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" id="hotKeySubviewID">
+<f:subview xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich" id="hotKeySubviewID">
+
+ <rich:calendar id="hotKeyCalendarID" popup="false" />
- <rich:calendar id="hotKeyCalendarID" popup="false" />
- <h:commandButton id="commandButtonID" onclick="return false;" value="test select"></h:commandButton>
+ <h:commandButton id="commandButtonID" onclick="return false;"
+ value="test select"></h:commandButton>
+
<rich:hotKey id="hotKeyID" binding="#{hotKey.binding}"
disableInInput="#{hotKey.disableInInput}" handler="#{hotKey.handler}"
key="#{hotKey.key}" rendered="#{hotKey.rendered}"
- selector="#{hotKey.selector}" timing="#{hotKey.timing}" type="#{hotKey.type}" />
+ selector="#{hotKey.selector}" timing="#{hotKey.timing}"
+ type="#{hotKey.type}" />
<h:panelGrid columns="2">
<h:outputText value="type"></h:outputText>
- <h:selectOneMenu value="#{hotKey.type}">
+ <h:selectOneMenu value="#{hotKey.type}" onchange="submit();">
<f:selectItem itemLabel="onkeydown" itemValue="onkeydown" />
<f:selectItem itemLabel="onkeypress" itemValue="onkeypress" />
<f:selectItem itemLabel="onkeyup" itemValue="onkeyup" />
- <a4j:support reRender="hotKeyID" event="onchange"></a4j:support>
</h:selectOneMenu>
<h:outputText value="key"></h:outputText>
@@ -27,10 +34,9 @@
</h:selectOneMenu>
<h:outputText value="selector"></h:outputText>
- <h:selectOneMenu value="#{hotKey.selector}">
+ <h:selectOneMenu value="#{hotKey.selector}" onchange="submit();">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItem itemLabel="Button" itemValue="#commandButtonID" />
- <a4j:support reRender="hotKeyID" event="onchange"></a4j:support>
</h:selectOneMenu>
<h:outputText value="handler"></h:outputText>
@@ -42,40 +48,53 @@
</h:selectOneMenu>
<h:outputText value="disableInInput"></h:outputText>
- <h:selectBooleanCheckbox value="#{hotKey.disableInInput}">
- <a4j:support reRender="hotKeyID" event="onchange"></a4j:support>
- </h:selectBooleanCheckbox>
+ <h:selectBooleanCheckbox value="#{hotKey.disableInInput}" onchange="submit();" />
<h:outputText value="rendered"></h:outputText>
- <h:selectBooleanCheckbox value="#{hotKey.rendered}">
- <a4j:support reRender="hotKeyID" event="onchange"></a4j:support>
- </h:selectBooleanCheckbox>
+ <h:selectBooleanCheckbox value="#{hotKey.rendered}" onchange="submit();"/>
<h:outputText value="test binding: "></h:outputText>
<h:outputText value="#{hotKey.bindingInfo}"></h:outputText>
- <h:commandButton onclick="$('formID:hotKeySubviewID:hotKeyID').component.enable(); return false;" value="enable"></h:commandButton>
- <h:commandButton onclick="$('formID:hotKeySubviewID:hotKeyID').component.disable(); return false;" value="disable"></h:commandButton>
+ <h:commandButton
+ onclick="$('formID:hotKeySubviewID:hotKeyID').component.enable(); return false;"
+ value="enable"></h:commandButton>
+ <h:commandButton
+ onclick="$('formID:hotKeySubviewID:hotKeyID').component.disable(); return false;"
+ value="disable"></h:commandButton>
</h:panelGrid>
- <f:verbatim><hr /></f:verbatim>
+ <f:verbatim>
+ <hr />
+ </f:verbatim>
+
<rich:hotKey id="jsID" timing="onregistercall" />
<h:panelGrid columns="2">
- <h:commandButton id="jsAddCCID" value="add hotkey: alt+z" onclick="return false;"></h:commandButton>
- <h:commandButton id="jsRemoveCCID" value="remove hotkey: alt+z" onclick="return false;"></h:commandButton>
+ <h:commandButton id="jsAddCCID" value="add hotkey: shift+d"
+ onclick="return false;"></h:commandButton>
+ <h:commandButton id="jsRemoveCCID" value="remove hotkey: shift+d"
+ onclick="return false;"></h:commandButton>
- <rich:componentControl disableDefault="true" attachTo="jsAddCCID" for="jsID" event="onclick" operation="add">
- <f:param name="key" value="alt+z" />
- <f:param name="handler" value="alert('alt+z')" />
+ <rich:componentControl disableDefault="true" attachTo="jsAddCCID"
+ for="jsID" event="onclick" operation="add">
+ <f:param name="key" value="shift+d" />
+ <f:param name="handler" value="alert('shift+d')" />
</rich:componentControl>
- <rich:componentControl disableDefault="true" attachTo="jsRemoveCCID" for="jsID" event="onclick" operation="remove">
- <f:param name="key" value="alt+z" />
+ <rich:componentControl disableDefault="true" attachTo="jsRemoveCCID"
+ for="jsID" event="onclick" operation="remove">
+ <f:param name="key" value="shift+d" />
</rich:componentControl>
</h:panelGrid>
- <f:verbatim><hr /></f:verbatim>
+
+ <f:verbatim>
+ <hr />
+ </f:verbatim>
+
<h:commandButton action="#{hotKey.add}" value="add test" />
+
+ <!--
<br />
<div style="FONT-WEIGHT: bold;">rich:findComponent</div>
<h:panelGrid columns="2">
@@ -83,7 +102,8 @@
<a4j:commandLink value="getRendererType" reRender="findID"></a4j:commandLink>
</rich:column>
<rich:column id="findID">
- <!--<h:outputText value="#{rich:findComponent('hotKeyID').rendererType}" />-->
+ <h:outputText value="#{rich:findComponent('hotKeyID').rendererType}" />
</rich:column>
</h:panelGrid>
+ -->
</f:subview>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r11662 - in trunk/test-applications/jsp/src/main/webapp: pages/RichMenu and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-12-09 09:27:23 -0500 (Tue, 09 Dec 2008)
New Revision: 11662
Modified:
trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp
trunk/test-applications/jsp/src/main/webapp/pages/RichMenu/RichMenu.jsp
Log:
changes in hotKey
Modified: trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp 2008-12-09 12:30:27 UTC (rev 11661)
+++ trunk/test-applications/jsp/src/main/webapp/HotKey/HotKey.jsp 2008-12-09 14:27:23 UTC (rev 11662)
@@ -5,21 +5,23 @@
<f:subview id="hotKeySubviewID">
<rich:calendar id="hotKeyCalendarID" popup="false" />
-
-
- <h:commandButton id="commandButtonID" onclick="return false;" value="test select"></h:commandButton>
+
+ <h:commandButton id="commandButtonID" onclick="return false;"
+ value="test select"></h:commandButton>
+
<rich:hotKey id="hotKeyID" binding="#{hotKey.htmlHotKey}"
disableInInput="#{hotKey.disableInInput}" handler="#{hotKey.handler}"
key="#{hotKey.key}" rendered="#{hotKey.rendered}"
- selector="#{hotKey.selector}" timing="#{hotKey.timing}" type="#{hotKey.type}" disableInInputTypes="#{hotKey.disableInInputTypes}"/>
+ selector="#{hotKey.selector}" timing="#{hotKey.timing}"
+ type="#{hotKey.type}"
+ disableInInputTypes="#{hotKey.disableInInputTypes}" />
<h:panelGrid columns="2">
<h:outputText value="type"></h:outputText>
- <h:selectOneMenu value="#{hotKey.type}">
+ <h:selectOneMenu value="#{hotKey.type}" onchange="submit();">
<f:selectItem itemLabel="onkeydown" itemValue="onkeydown" />
<f:selectItem itemLabel="onkeypress" itemValue="onkeypress" />
<f:selectItem itemLabel="onkeyup" itemValue="onkeyup" />
- <a4j:support reRender="hotKeyID" event="onchange"></a4j:support>
</h:selectOneMenu>
<h:outputText value="key"></h:outputText>
@@ -33,10 +35,9 @@
</h:selectOneMenu>
<h:outputText value="selector"></h:outputText>
- <h:selectOneMenu value="#{hotKey.selector}">
+ <h:selectOneMenu value="#{hotKey.selector}" onchange="submit();">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItem itemLabel="Button" itemValue="#commandButtonID" />
- <a4j:support reRender="hotKeyID" event="onchange"></a4j:support>
</h:selectOneMenu>
<h:outputText value="handler"></h:outputText>
@@ -48,16 +49,13 @@
</h:selectOneMenu>
<h:outputText value="disableInInput"></h:outputText>
- <h:selectBooleanCheckbox value="#{hotKey.disableInInput}">
- <a4j:support reRender="hotKeyID" event="onchange"></a4j:support>
- </h:selectBooleanCheckbox>
-
+ <h:selectBooleanCheckbox value="#{hotKey.disableInInput}" onchange="submit();" />
+
<h:outputText value="disableInInput"></h:outputText>
- <h:selectOneRadio value="#{hotKey.disableInInputTypes}" >
- <f:selectItem itemValue="all" itemLabel="all"/>
- <f:selectItem itemValue="buttons" itemLabel="buttons"/>
- <f:selectItem itemValue="texts" itemLabel="texts"/>
- <a4j:support reRender="hotKeyID" event="onchange"></a4j:support>
+ <h:selectOneRadio value="#{hotKey.disableInInputTypes}" onchange="submit();">
+ <f:selectItem itemValue="all" itemLabel="all" />
+ <f:selectItem itemValue="buttons" itemLabel="buttons" />
+ <f:selectItem itemValue="texts" itemLabel="texts" />
</h:selectOneRadio>
<%--<h:outputText value="checkParent"></h:outputText>
@@ -66,35 +64,50 @@
</h:selectBooleanCheckbox>--%>
<h:outputText value="rendered"></h:outputText>
- <h:selectBooleanCheckbox value="#{hotKey.rendered}">
- <a4j:support reRender="hotKeyID" event="onchange"></a4j:support>
- </h:selectBooleanCheckbox>
+ <h:selectBooleanCheckbox value="#{hotKey.rendered}" onchange="submit();" />
<h:outputText value="test binding:"></h:outputText>
<h:outputText value="#{hotKey.bindingInfo}"></h:outputText>
- <h:commandButton onclick="#{rich:component('hotKeyID')}.enable(); return false;" value="enable"></h:commandButton>
- <h:commandButton onclick="#{rich:component('hotKeyID')}.disable(); return false;" value="disable"></h:commandButton>
+ <h:commandButton
+ onclick="$('formID:hotKeySubviewID:hotKeyID').component.enable(); return false;"
+ value="enable"></h:commandButton>
+ <h:commandButton
+ onclick="$('formID:hotKeySubviewID:hotKeyID').component.disable(); return false;"
+ value="disable"></h:commandButton>
</h:panelGrid>
- <f:verbatim><hr /></f:verbatim>
+ <f:verbatim>
+ <hr />
+ </f:verbatim>
+
<rich:hotKey id="jsID" timing="onregistercall" />
<h:panelGrid columns="2">
- <h:commandButton id="jsAddCCID" value="add hotkey: alt+z" onclick="return false;"></h:commandButton>
- <h:commandButton id="jsRemoveCCID" value="remove hotkey: alt+z" onclick="return false;"></h:commandButton>
+ <h:commandButton id="jsAddCCID" value="add hotkey: shift+d"
+ onclick="return false;"></h:commandButton>
+ <h:commandButton id="jsRemoveCCID" value="remove hotkey: shift+d"
+ onclick="return false;"></h:commandButton>
- <rich:componentControl disableDefault="true" attachTo="jsAddCCID" for="jsID" event="onclick" operation="add">
- <f:param name="key" value="alt+z" />
- <f:param name="handler" value="alert('alt+z')" />
+ <rich:componentControl disableDefault="true" attachTo="jsAddCCID"
+ for="jsID" event="onclick" operation="add">
+ <f:param name="key" value="shift+d" />
+ <f:param name="handler" value="alert('shift+d')" />
</rich:componentControl>
- <rich:componentControl disableDefault="true" attachTo="jsRemoveCCID" for="jsID" event="onclick" operation="remove">
- <f:param name="key" value="alt+z" />
+ <rich:componentControl disableDefault="true" attachTo="jsRemoveCCID"
+ for="jsID" event="onclick" operation="remove">
+ <f:param name="key" value="shift+d" />
</rich:componentControl>
</h:panelGrid>
- <f:verbatim><hr /></f:verbatim>
+
+ <f:verbatim>
+ <hr />
+ </f:verbatim>
+
<h:commandButton action="#{hotKey.add}" value="add test" />
+
+ <%--
<div style="FONT-WEIGHT: bold;">rich:findComponent</div>
<h:panelGrid columns="2">
<rich:column>
@@ -104,4 +117,5 @@
<h:outputText value="#{rich:findComponent('hotKeyID').rendererType}" />
</rich:column>
</h:panelGrid>
+ --%>
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/pages/RichMenu/RichMenu.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/pages/RichMenu/RichMenu.jsp 2008-12-09 12:30:27 UTC (rev 11661)
+++ trunk/test-applications/jsp/src/main/webapp/pages/RichMenu/RichMenu.jsp 2008-12-09 14:27:23 UTC (rev 11662)
@@ -18,6 +18,7 @@
<h:selectBooleanCheckbox id="a4jLodID" value="#{option.log}" onchange="submit();"></h:selectBooleanCheckbox>
<a4j:status id="a4jStatusID" startText="WORK!" startStyle="color: red;" stopText="a4j:status"></a4j:status>
+ <h:panelGroup></h:panelGroup>
</h:panelGrid>
<h:panelGrid columns="1">
<h:panelGrid columns="4">
17 years, 5 months
JBoss Rich Faces SVN: r11661 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/modalPanel/examples.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-12-09 07:30:27 -0500 (Tue, 09 Dec 2008)
New Revision: 11661
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/modalPanel/examples/simplePanel.xhtml
Log:
minor fix according to customers mistakes caused by this zindex and comboBox samples.
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/modalPanel/examples/simplePanel.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/modalPanel/examples/simplePanel.xhtml 2008-12-09 11:48:08 UTC (rev 11660)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/modalPanel/examples/simplePanel.xhtml 2008-12-09 12:30:27 UTC (rev 11661)
@@ -14,7 +14,7 @@
}
</script>
<rich:modalPanel id="mp" minHeight="200" minWidth="450"
- height="200" width="500" zindex="2000">
+ height="200" width="500">
<f:facet name="header">
<h:outputText value="Modal Panel Title" />
</f:facet>
17 years, 5 months
JBoss Rich Faces SVN: r11660 - trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-12-09 06:48:08 -0500 (Tue, 09 Dec 2008)
New Revision: 11660
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
Log:
https://jira.jboss.org/jira/browse/RF-4343
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-12-09 11:10:01 UTC (rev 11659)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-12-09 11:48:08 UTC (rev 11660)
@@ -96,7 +96,7 @@
List<SelectItem> selectItems = SelectUtils.getSelectItems(context, inplaceSelect);
for (SelectItem selectItem : selectItems) {
String value = getConvertedStringValue(context, inplaceSelect, selectItem.getValue());
- String label = selectItem.getLabel();
+ String label = selectItem.getLabel().trim();
labels.add(label);
encodeSuggestion(context, inplaceSelect, label, RICH_INPLACE_SELECT_CLASSES);
Object[] child = new Object[2];
17 years, 5 months
JBoss Rich Faces SVN: r11659 - trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-12-09 06:10:01 -0500 (Tue, 09 Dec 2008)
New Revision: 11659
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java
Log:
removed redundant code
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java 2008-12-09 09:27:35 UTC (rev 11658)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java 2008-12-09 11:10:01 UTC (rev 11659)
@@ -371,10 +371,4 @@
setAdvisor(null);
}
- private static long id = 1;
-
- public long nextId() {
- return id++;
- }
-
}
17 years, 5 months
JBoss Rich Faces SVN: r11658 - in trunk/test-applications/seleniumTest/richfaces/src/main: java/org/ajax4jsf/bean/tree/rich and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-12-09 04:27:35 -0500 (Tue, 09 Dec 2008)
New Revision: 11658
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeBuilder.java
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Album.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Performer.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Song.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tree/treeAutoTest.xhtml
Log:
changed tree entity id generation method + lost commit
Added: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeBuilder.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeBuilder.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeBuilder.java 2008-12-09 09:27:35 UTC (rev 11658)
@@ -0,0 +1,35 @@
+package org.ajax4jsf.bean.tree;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.ajax4jsf.bean.tree.rich.AudioLibrary;
+import org.apache.commons.digester.Digester;
+import org.apache.commons.digester.xmlrules.DigesterLoader;
+import org.xml.sax.SAXException;
+
+public class TreeBuilder {
+
+ private static long id = 1;
+
+ public static long nextId() {
+ return id++;
+ }
+
+ public static void main(String[] args) {
+ URL rulesUrl = TreeBuilder.class.getResource("/digester-rules.xml");
+ Digester digester = DigesterLoader.createDigester(rulesUrl);
+ AudioLibrary library = new AudioLibrary();
+ digester.push(library);
+
+ try {
+ digester.parse(TreeBuilder.class.getResourceAsStream("/audio-library.xml"));
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (SAXException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeBuilder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java 2008-12-09 01:00:53 UTC (rev 11657)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java 2008-12-09 09:27:35 UTC (rev 11658)
@@ -111,7 +111,7 @@
private TreeNode<Object> richRootNode = null;
- public TreeNode<Object> getRichTreeNode() {
+ public synchronized TreeNode<Object> getRichTreeNode() {
if (null == richRootNode) {
Digester digester = DigesterLoader.createDigester(getClass().getResource("/rich-digester-rules.xml"));
AudioLibrary library = new AudioLibrary();
@@ -133,7 +133,7 @@
private javax.swing.tree.TreeNode swingRootNode = null;
- public javax.swing.tree.TreeNode getSwingTreeNode() {
+ public synchronized javax.swing.tree.TreeNode getSwingTreeNode() {
if (null == swingRootNode) {
Digester digester = DigesterLoader.createDigester(getClass().getResource("/swing-digester-rules.xml"));
org.ajax4jsf.bean.tree.swing.AudioLibrary library = new org.ajax4jsf.bean.tree.swing.AudioLibrary();
@@ -371,4 +371,10 @@
setAdvisor(null);
}
+ private static long id = 1;
+
+ public long nextId() {
+ return id++;
+ }
+
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Album.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Album.java 2008-12-09 01:00:53 UTC (rev 11657)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Album.java 2008-12-09 09:27:35 UTC (rev 11658)
@@ -1,5 +1,7 @@
package org.ajax4jsf.bean.tree.rich;
+import static org.ajax4jsf.bean.tree.TreeBuilder.nextId;
+
import org.richfaces.model.TreeNodeImpl;
public class Album extends TreeNodeImpl<Object> {
@@ -14,7 +16,7 @@
private Integer year;
public Album() {
- setId(System.currentTimeMillis());
+ setId(nextId());
}
//
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Performer.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Performer.java 2008-12-09 01:00:53 UTC (rev 11657)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Performer.java 2008-12-09 09:27:35 UTC (rev 11658)
@@ -1,5 +1,7 @@
package org.ajax4jsf.bean.tree.rich;
+import static org.ajax4jsf.bean.tree.TreeBuilder.nextId;
+
import org.richfaces.model.TreeNodeImpl;
public class Performer extends TreeNodeImpl<Object> {
@@ -13,7 +15,7 @@
private String name;
public Performer() {
- setId(System.currentTimeMillis());
+ setId(nextId());
}
//
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Song.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Song.java 2008-12-09 01:00:53 UTC (rev 11657)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Song.java 2008-12-09 09:27:35 UTC (rev 11658)
@@ -1,5 +1,7 @@
package org.ajax4jsf.bean.tree.rich;
+import static org.ajax4jsf.bean.tree.TreeBuilder.nextId;
+
import org.richfaces.model.TreeNode;
import org.richfaces.model.TreeNodeImpl;
@@ -14,7 +16,7 @@
private String title;
public Song() {
- setId(System.currentTimeMillis());
+ setId(nextId());
}
//
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tree/treeAutoTest.xhtml
===================================================================
(Binary files differ)
17 years, 5 months
JBoss Rich Faces SVN: r11657 - in trunk/ui/core/src: test/java/org/ajax4jsf/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-08 20:00:53 -0500 (Mon, 08 Dec 2008)
New Revision: 11657
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIQueue.java
trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueRendererTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5244
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIQueue.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIQueue.java 2008-12-08 19:03:13 UTC (rev 11656)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIQueue.java 2008-12-09 01:00:53 UTC (rev 11657)
@@ -81,6 +81,9 @@
public abstract String getOnrequestdequeue();
public abstract void setOnrequestdequeue(String onrequestdequeue);
+ public abstract String getStatus();
+ public abstract void setStatus(String status);
+
@Override
public String getFamily() {
return COMPONENT_FAMILY;
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueRendererTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueRendererTest.java 2008-12-08 19:03:13 UTC (rev 11656)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/QueueRendererTest.java 2008-12-09 01:00:53 UTC (rev 11657)
@@ -156,6 +156,8 @@
queue1.setSize(10);
queue1.setOnsizeexceeded("sizeexceeded_handler()");
queue1.setSizeExceededBehavior("dropNext");
+ queue1.setOnrequestqueue("request_queue_handler()");
+ queue1.setOnrequestdequeue("request_de_queue_handler()");
form.getChildren().add(queue1);
UIQueue queue2 = (UIQueue) application.createComponent(UIQueue.COMPONENT_TYPE);
@@ -173,7 +175,7 @@
assertEquals(3, scripts.length);
assertEquals(dry(createQueueInitString("theform",
- "{'size':10,'sizeExceededBehavior':'dropNext','onsizeexceeded':function(query,options,event){sizeexceeded_handler()}}",
+ "{'size':10,'sizeExceededBehavior':'dropNext','onsizeexceeded':function(query,options,event){sizeexceeded_handler()},'onrequestqueue':function(query,options,event){request_queue_handler()},'onrequestdequeue':function(query,options,event){request_de_queue_handler()}}",
null)),
scripts[0]);
@@ -199,6 +201,7 @@
queue2.setIgnoreDupResponses(true);
queue2.setOnbeforedomupdate("beforedomupdate_handler()");
queue2.setOncomplete("complete_handler()");
+ queue2.setStatus("mystatus");
form.getChildren().add(queue2);
HtmlPage page = renderView();
@@ -209,7 +212,7 @@
assertEquals(dry(createQueueInitString("theform:queue1", null,
"{'timeout':50021,'queueonsubmit':function(request){submit_queue_handler()},'queueonerror':function(request,status,message){error_queue_handler()}}")), scripts[0]);
assertEquals(dry(createQueueInitString("theform:queue2", null,
- "{'ignoreDupResponses':true,'requestDelay':600,'queueonbeforedomupdate':function(request,event,data){beforedomupdate_handler()},'queueoncomplete':function(request,event,data){complete_handler()}}")),
+ "{'ignoreDupResponses':true,'requestDelay':600,'status':'mystatus','queueonbeforedomupdate':function(request,event,data){beforedomupdate_handler()},'queueoncomplete':function(request,event,data){complete_handler()}}")),
scripts[1]);
}
17 years, 5 months
JBoss Rich Faces SVN: r11656 - in trunk/ui/inplaceSelect/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-08 14:03:13 -0500 (Mon, 08 Dec 2008)
New Revision: 11656
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
https://jira.jboss.org/jira/browse/RF-5275
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-12-08 18:27:05 UTC (rev 11655)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-12-08 19:03:13 UTC (rev 11656)
@@ -126,36 +126,34 @@
return UIInplaceSelect.class;
}
- public String getSelectedItemLabel(FacesContext context, UIInplaceSelect component) {
- String selectedItemLabel = (String)component.getSubmittedValue();
- if(selectedItemLabel == null) {
- Object value = component.getAttributes().get("value");
- if (value == null || "".equals(value)) {
- selectedItemLabel = createDefaultLabel(component);
- } else {
- selectedItemLabel = getItemLabel(context, component, value);
- }
- }
- return selectedItemLabel;
- }
+// public String getSelectedItemLabel(FacesContext context, UIInplaceSelect component) {
+// String selectedItemLabel = (String)component.getSubmittedValue();
+// if(selectedItemLabel == null || !component.isValid()) {
+// Object value = component.getAttributes().get("value");
+// if (value == null || "".equals(value)) {
+// selectedItemLabel = createDefaultLabel(component);
+// } else {
+// selectedItemLabel = getItemLabel(context, component, value);
+// }
+// }
+// return selectedItemLabel;
+// }
protected String getItemLabel(FacesContext context, UIInplaceSelect component, Object value) {
String itemLabel = null;
// TODO: SelectUtils.getSelectItems is called minimum twice during encode
- List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
- if (!selectItems.isEmpty()) {
- for (SelectItem item : selectItems) {
- if (value.equals(item.getValue())) {
- itemLabel = component.isShowValueInView() ? getConvertedStringValue(context, component, item.getValue()) : item.getLabel();
- break;
+ if(value != null) {
+ List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
+ if (!selectItems.isEmpty()) {
+ for (SelectItem item : selectItems) {
+ if (value.equals(item.getValue())) {
+ itemLabel = component.isShowValueInView() ? getConvertedStringValue(context, component, item.getValue()) : item.getLabel();
+ break;
+ }
+ }
}
- }
}
-
- if (itemLabel == null) {
- itemLabel = createDefaultLabel(component);
- }
-
+
return itemLabel;
}
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-12-08 18:27:05 UTC (rev 11655)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-12-08 19:03:13 UTC (rev 11656)
@@ -199,9 +199,9 @@
getParameters : function (args) {
var result = {};
- var label = args[1]['label'];
+ var label = args[1]['itemLabel'];
if(label) {
- var value = args[1]['value'];
+ var value = args[1]['itemValue'];
result.itemLabel = label;
result.itemValue = value;
} else {
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-12-08 18:27:05 UTC (rev 11655)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-12-08 19:03:13 UTC (rev 11656)
@@ -32,19 +32,22 @@
<jsp:scriptlet>
<![CDATA[
- Object value = component.getSubmittedValue();
- if(value == null) {
- value = component.getAttributes().get("value");
- value = getConvertedStringValue(context, component,value);
- }
-
- String fieldValue = (String)value;
- String fieldLabel = getSelectedItemLabel(context, component);
+ Object value = component.getAttributes().get("value");
+ value = getConvertedStringValue(context, component,value);
+
+ String selectedItemLabel = getItemLabel(context, component, value);
- if (value == null || value.equals("")) {
- fieldValue = "";
- }
-
+ String fieldValue = null;
+ String fieldLabel = null;
+
+ if (selectedItemLabel == null) {
+ fieldValue = null;
+ fieldLabel = createDefaultLabel(component);
+ } else {
+ fieldValue = (String)value;
+ fieldLabel = selectedItemLabel;
+ }
+
String encodedFieldValue = encodeValue(fieldValue);
variables.setVariable("fieldLabel", fieldLabel);
17 years, 5 months
JBoss Rich Faces SVN: r11655 - trunk/ui/calendar/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-08 13:27:05 -0500 (Mon, 08 Dec 2008)
New Revision: 11655
Modified:
trunk/ui/calendar/src/main/config/component/calendar.xml
Log:
https://jira.jboss.org/jira/browse/RF-5209
Modified: trunk/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/ui/calendar/src/main/config/component/calendar.xml 2008-12-08 18:24:39 UTC (rev 11654)
+++ trunk/ui/calendar/src/main/config/component/calendar.xml 2008-12-08 18:27:05 UTC (rev 11655)
@@ -42,11 +42,10 @@
</superclassname>
</test>
</tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
- </taghandler>
- -->
+ <taghandler generate="true">
+ <classname>org.richfaces.taglib.CalendarTagHandler</classname>
+ <superclass>com.sun.facelets.tag.jsf.ComponentHandler</superclass>
+ </taghandler>
&ui_component_attributes;
&ajax_component_attributes;
&ui_input_attributes;
@@ -617,7 +616,6 @@
minimal days required must be a full week, this method returns 7. Default value is "getDefaultMinDaysInFirstWeek()".
</description>
</property>
-
</component>
&listeners;
</components>
17 years, 5 months
JBoss Rich Faces SVN: r11654 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-08 13:24:39 -0500 (Mon, 08 Dec 2008)
New Revision: 11654
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
small fix
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-08 18:18:38 UTC (rev 11653)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-08 18:24:39 UTC (rev 11654)
@@ -144,7 +144,7 @@
if ("*firefox".equals(browser)) {
String firefox = findFirefox();
if (firefox != null) {
- browser = findFirefox();
+ browser = firefox;
}
}
synchronized (MUTEX) {
17 years, 5 months
JBoss Rich Faces SVN: r11653 - in trunk/test-applications/seleniumTest/richfaces: src/test/java/org/richfaces and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-08 13:18:38 -0500 (Mon, 08 Dec 2008)
New Revision: 11653
Added:
trunk/test-applications/seleniumTest/richfaces/src/test/testng/hudson/
trunk/test-applications/seleniumTest/richfaces/src/test/testng/hudson/testng.xml
Modified:
trunk/test-applications/seleniumTest/richfaces/pom.xml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
RF-5197
Modified: trunk/test-applications/seleniumTest/richfaces/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-08 17:36:50 UTC (rev 11652)
+++ trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-08 18:18:38 UTC (rev 11653)
@@ -15,76 +15,121 @@
<version>3.3.0-SNAPSHOT</version>
<build>
<finalName>richfaces</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <!-- Skip the normal tests, we'll run them in the integration-test phase -->
- <skip>true</skip>
- <suiteXmlFiles>
- <!--suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_all_all_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_all_all_tidy.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_all_all_neko.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
- </suiteXmlFile>
- <suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_default_neko.xml
- </suiteXmlFile-->
- <suiteXmlFile>
- src/test/testng/win/local_testng.xml
- </suiteXmlFile>
- </suiteXmlFiles>
- <properties>
- <property>
- <name>listener</name>
- <value>org.richfaces.TestAnnotationTransformer</value>
- </property>
- </properties>
- </configuration>
- <executions>
- <execution>
- <phase>integration-test</phase>
- <goals>
- <!--goal>test</goal-->
- </goals>
+ </build>
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
<configuration>
- <skip>false</skip>
+ <!-- Skip the normal tests, we'll run them in the integration-test phase -->
+ <skip>true</skip>
+ <suiteXmlFiles>
+ <!--suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_all_tidy.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_all_neko.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_all_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_all_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_default_neko.xml
+ </suiteXmlFile-->
+ <suiteXmlFile>
+ src/test/testng/win/local_testng.xml
+ </suiteXmlFile>
+ </suiteXmlFiles>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.richfaces.TestAnnotationTransformer</value>
+ </property>
+ </properties>
</configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <!--goal>test</goal-->
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>hudson</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <!-- Skip the normal tests, we'll run them in the integration-test phase -->
+ <skip>true</skip>
+ <suiteXmlFiles>
+ <suiteXmlFile>
+ src/test/testng/hudson/testng.xml
+ </suiteXmlFile>
+ </suiteXmlFiles>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.richfaces.TestAnnotationTransformer</value>
+ </property>
+ </properties>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
<repositories>
<repository>
<releases>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-08 17:36:50 UTC (rev 11652)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-08 18:18:38 UTC (rev 11653)
@@ -141,38 +141,12 @@
@BeforeClass
@Parameters({"browser", "filterPrefix"})
public void startSelenium(String browser, String filterPrefix) {
- if ("*firefox".equals(browser)) {
- File[] libs = {new File("/usr/lib"), new File("/usr/lib64")};
- for (int i = 0; i < libs.length && "*firefox".equals(browser); i++) {
- File lib = libs[i];
- if (lib.isDirectory()) {
- System.out.println("---->lib#" + i + ": " + lib.getPath());
- File[] firefoxDirs = lib.listFiles(new FileFilter() {
- public boolean accept(File pathname) {
- return pathname != null&& pathname.getName().startsWith("firefox")
- && pathname.isDirectory();
- }
- });
- for (int j = firefoxDirs.length - 1; j >= 0 && "*firefox".equals(browser); j--) {
- System.out.println("------>firefoxDir#" + j + ": " + firefoxDirs[j].getPath());
- File[] firefoxes = firefoxDirs[j].listFiles(new FileFilter() {
- public boolean accept(File pathname) {
- boolean result = false;
- if (pathname != null && pathname.isFile()) {
- String name = pathname.getName();
- result = "firefox".equals(name) || "firefox-bin".equals(name);
- }
- return result;
- }
- });
- for (int k = firefoxes.length - 1; k >= 0 && "*firefox".equals(browser); k--) {
- System.out.println("-------->firefoxes#" + k + ": " + firefoxes[k].getPath());
- browser += " " + firefoxes[k].getPath();
- }
- }
- }
- }
- }
+ if ("*firefox".equals(browser)) {
+ String firefox = findFirefox();
+ if (firefox != null) {
+ browser = findFirefox();
+ }
+ }
synchronized (MUTEX) {
this.filterPrefix = filterPrefix;
selenium = createSeleniumClient(protocol + "://" + host + ":" + port + "/", browser);
@@ -181,6 +155,41 @@
selenium.allowNativeXpath("false");
}
}
+
+ private String findFirefox() {
+ String browser = null;
+ File[] libs = {new File("/usr/lib"), new File("/usr/lib64")};
+ for (int i = 0; browser == null && i < libs.length; i++) {
+ File lib = libs[i];
+ if (lib.isDirectory()) {
+ System.out.println("---->lib#" + i + ": " + lib.getPath());
+ File[] firefoxDirs = lib.listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ return pathname != null&& pathname.getName().startsWith("firefox")
+ && pathname.isDirectory();
+ }
+ });
+ for (int j = firefoxDirs.length - 1; browser == null && j >= 0; j--) {
+ System.out.println("------>firefoxDir#" + j + ": " + firefoxDirs[j].getPath());
+ File[] firefoxes = firefoxDirs[j].listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ boolean result = false;
+ if (pathname != null && pathname.isFile()) {
+ String name = pathname.getName();
+ result = "firefox".equals(name) || "firefox-bin".equals(name);
+ }
+ return result;
+ }
+ });
+ for (int k = firefoxes.length - 1; browser == null && k >= 0; k--) {
+ System.out.println("-------->firefox#" + k + ": " + firefoxes[k].getPath());
+ browser = "*firefox " + firefoxes[k].getPath();
+ }
+ }
+ }
+ }
+ return browser;
+ }
private void setFileExtensionContent() {
try {
Added: trunk/test-applications/seleniumTest/richfaces/src/test/testng/hudson/testng.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/testng/hudson/testng.xml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/testng/hudson/testng.xml 2008-12-08 18:18:38 UTC (rev 11653)
@@ -0,0 +1,111 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestAANe">
+ <test name="all_all_neko">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="all_all_none">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="all_all_tidy">
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="all_default_neko">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="all_default_none">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="all_default_tidy">
+ <parameter name="loadStyleStrategy" value="ALL"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="default_all_neko">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="default_all_none">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="default_all_tidy">
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="default_default_neko">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="default_default_none">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="default_default_tidy">
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/TIDY/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
17 years, 5 months
JBoss Rich Faces SVN: r11652 - in trunk/samples/queue-sample/src/main/webapp: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-08 12:36:50 -0500 (Mon, 08 Dec 2008)
New Revision: 11652
Added:
trunk/samples/queue-sample/src/main/webapp/pages/blocked-queue.xhtml
Modified:
trunk/samples/queue-sample/src/main/webapp/pages/events.xhtml
trunk/samples/queue-sample/src/main/webapp/templates/navigation.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-5244
Added: trunk/samples/queue-sample/src/main/webapp/pages/blocked-queue.xhtml
===================================================================
--- trunk/samples/queue-sample/src/main/webapp/pages/blocked-queue.xhtml (rev 0)
+++ trunk/samples/queue-sample/src/main/webapp/pages/blocked-queue.xhtml 2008-12-08 17:36:50 UTC (rev 11652)
@@ -0,0 +1,63 @@
+<html
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <head>
+ <title>Events blocking and status check page</title>
+ </head>
+ <body>
+ <f:view>
+ <ui:include src="/templates/navigation.xhtml" />
+
+ <a4j:status startText="...link status - request running..." startStyle="color: green" id="linkStatus" forceId="true" />
+ <a4j:status startText="...queue status - request running..." startStyle="color: green" id="queueStatus" forceId="true" />
+ <h:form id="form">
+ <fieldset>
+
+ <h:outputLabel for="queueRequestDelay" value="Queue request delay " />
+ <h:inputText id="queueRequestDelay" value="#{bean.queueRequestDelay}">
+ <f:convertNumber />
+ </h:inputText>
+
+ <br />
+
+ <h:outputLabel for="clientRequestDelay" value="Client request delay " />
+ <h:inputText id="clientRequestDelay" value="#{bean.clientRequestDelay}">
+ <f:convertNumber />
+ </h:inputText>
+
+ <br />
+
+ <h:outputLabel for="processRequestDelay" value="Process request delay " />
+ <h:inputText id="processRequestDelay" value="#{bean.processRequestDelay}">
+ <f:convertNumber />
+ </h:inputText>
+
+ <br />
+
+ <h:outputLabel value="Poll enabled" for="pollEnabled" />
+ <h:selectBooleanCheckbox value="#{bean.pollEnabled}" id="pollEnabled" />
+ <br />
+
+ <h:commandButton value="Apply values" />
+ <br />
+
+ </fieldset>
+ <a4j:queue name="queue" status="queueStatus" size="3"
+ onrequestqueue="if (this.getSize() == this.getMaximumSize()) {document.getElementById('form:group').style.display = 'none'}"
+ onrequestdequeue="document.getElementById('form:group').style.display = ''"
+ requestDelay="#{bean.queueRequestDelay}" />
+
+ <h:panelGroup id="group">
+ <a4j:commandLink actionListener="#{bean.processActionListener}" action="#{bean.processAction}"
+ value="Trigger link status" status="linkStatus" eventsQueue="queue" /><br />
+ <a4j:commandLink actionListener="#{bean.processActionListener}" action="#{bean.processAction}"
+ value="Trigger queue status" eventsQueue="queue" /><br />
+ <a4j:commandLink actionListener="#{bean.processActionListener}" action="#{bean.processAction}"
+ value="Trigger queue status II" eventsQueue="queue" /><br />
+ </h:panelGroup>
+ </h:form>
+ </f:view>
+ </body>
+</html>
Modified: trunk/samples/queue-sample/src/main/webapp/pages/events.xhtml
===================================================================
--- trunk/samples/queue-sample/src/main/webapp/pages/events.xhtml 2008-12-08 17:36:10 UTC (rev 11651)
+++ trunk/samples/queue-sample/src/main/webapp/pages/events.xhtml 2008-12-08 17:36:50 UTC (rev 11652)
@@ -28,14 +28,18 @@
<td colspan="4">Queue - Q, Component - C</td>
</tr>
<tr id="handlersTableHeaders">
+ <td>onrequestqueue</td>
<td>onsubmit</td>
<td>onbeforedomupdate</td>
+ <td>onrequestdequeue</td>
<td>oncomplete</td>
<td>onerror</td>
</tr>
<tr>
+ <td id="onrequestqueueElt"></td>
<td id="onsubmitElt"></td>
<td id="onbeforedomupdateElt"></td>
+ <td id="onrequestdequeueElt"></td>
<td id="oncompleteElt"></td>
<td id="onerrorElt"></td>
</tr>
@@ -60,6 +64,8 @@
resetCells();
var events = {
+ "onrequestqueue": ["query", "options", "event"],
+ "onrequestdequeue": ["query", "options", "event"],
"onbeforedomupdate": ["request", "event", "data"],
"onsubmit": ["request"],
"oncomplete": ["request", "event", "data"],
@@ -80,7 +86,9 @@
}
//]]></script>
<a4j:queue name="queue" onsubmit="handlers['queue:onsubmit'](request)" onerror="handlers['queue:onerror'](request, status, message)"
- oncomplete="handlers['queue:oncomplete'](request, event, data)" onbeforedomupdate="handlers['queue:onbeforedomupdate'](request, event, data)" />
+ onrequestdequeue="handlers['queue:onrequestdequeue'](query, options, event)" onrequestqueue="handlers['queue:onrequestqueue'](query, options, event)"
+ oncomplete="handlers['queue:oncomplete'](request, event, data)"
+ onbeforedomupdate="handlers['queue:onbeforedomupdate'](request, event, data)" />
<h:form>
<h:panelGrid columns="1">
Modified: trunk/samples/queue-sample/src/main/webapp/templates/navigation.xhtml
===================================================================
--- trunk/samples/queue-sample/src/main/webapp/templates/navigation.xhtml 2008-12-08 17:36:10 UTC (rev 11651)
+++ trunk/samples/queue-sample/src/main/webapp/templates/navigation.xhtml 2008-12-08 17:36:50 UTC (rev 11652)
@@ -14,6 +14,8 @@
<h:outputLink value="sized-queue.jsf">Size exceed behaviors</h:outputLink>
<h:outputText value=" " />
<h:outputLink value="events.jsf">Events handling</h:outputLink>
+ <h:outputText value=" " />
+ <h:outputLink value="blocked-queue.jsf">Queue blocking and status</h:outputLink>
<br />
</ui:composition>
17 years, 5 months
JBoss Rich Faces SVN: r11651 - in trunk/ui/core/src/main: java/org/ajax4jsf/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-08 12:36:10 -0500 (Mon, 08 Dec 2008)
New Revision: 11651
Modified:
trunk/ui/core/src/main/config/component/queue.xml
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIQueue.java
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRenderer.java
Log:
https://jira.jboss.org/jira/browse/RF-5244
Modified: trunk/ui/core/src/main/config/component/queue.xml
===================================================================
--- trunk/ui/core/src/main/config/component/queue.xml 2008-12-08 17:34:44 UTC (rev 11650)
+++ trunk/ui/core/src/main/config/component/queue.xml 2008-12-08 17:36:10 UTC (rev 11651)
@@ -93,7 +93,20 @@
<classname>java.lang.String</classname>
<description>A script expression; a size is exceed</description>
</property>
+ <property>
+ <name>onrequestqueue</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property>
+ <name>onrequestdequeue</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property>
+ <name>status</name>
+ <classname>java.lang.String</classname>
+ </property>
+
<property hidden="true">
<name>rendered</name>
</property>
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIQueue.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIQueue.java 2008-12-08 17:34:44 UTC (rev 11650)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIQueue.java 2008-12-08 17:36:10 UTC (rev 11651)
@@ -75,7 +75,11 @@
public abstract boolean isIgnoreDupResponses();
public abstract void setIgnoreDupResponses(boolean ignoreDupResponses);
+ public abstract String getOnrequestqueue();
+ public abstract void setOnrequestqueue(String onrequestqueue);
+ public abstract String getOnrequestdequeue();
+ public abstract void setOnrequestdequeue(String onrequestdequeue);
@Override
public String getFamily() {
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRenderer.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRenderer.java 2008-12-08 17:34:44 UTC (rev 11650)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/QueueRenderer.java 2008-12-08 17:36:10 UTC (rev 11651)
@@ -118,6 +118,16 @@
data.addQueueAttribute("onsizeexceeded", new JSFunctionDefinition("query", "options", "event").addToBody(onsizeexceeded));
}
+ String onrequestqueue = queue.getOnrequestqueue();
+ if (utils.shouldRenderAttribute(onrequestqueue)) {
+ data.addQueueAttribute("onrequestqueue", new JSFunctionDefinition("query", "options", "event").addToBody(onrequestqueue));
+ }
+
+ String onrequestdequeue = queue.getOnrequestdequeue();
+ if (utils.shouldRenderAttribute(onrequestdequeue)) {
+ data.addQueueAttribute("onrequestdequeue", new JSFunctionDefinition("query", "options", "event").addToBody(onrequestdequeue));
+ }
+
for (String attributeName : REQUEST_ATTRIBUTES) {
Object value = attributes.get(attributeName);
if (utils.shouldRenderAttribute(value)) {
@@ -125,6 +135,11 @@
}
}
+ String status = AjaxRendererUtils.getAjaxStatus(queue);
+ if (utils.shouldRenderAttribute(status)) {
+ data.addRequestAttribute(AjaxRendererUtils.STATUS_ATTR_NAME, status);
+ }
+
String onBeforeDomUpdate = queue.getOnbeforedomupdate();
if (utils.shouldRenderAttribute(onBeforeDomUpdate)) {
data.addRequestAttribute(QUEUE_ONBEFOREDOMUPDATE_ATTRIBUTE, AjaxRendererUtils.buildAjaxOnBeforeDomUpdate(onBeforeDomUpdate));
17 years, 5 months
JBoss Rich Faces SVN: r11650 - trunk/framework/impl/src/main/javascript/ajaxjsf.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-08 12:34:44 -0500 (Mon, 08 Dec 2008)
New Revision: 11650
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
trunk/framework/impl/src/main/javascript/ajaxjsf/queue.js
Log:
https://jira.jboss.org/jira/browse/RF-5244
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-12-08 17:24:32 UTC (rev 11649)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-12-08 17:34:44 UTC (rev 11650)
@@ -55,11 +55,9 @@
if(window.document.documentElement != _this._documentElement){
LOG.warn("Page for current request have been unloaded - abort processing" );
_this.abort();
- _this = undefined;
return;
};
if(_this._aborted){
- _this = undefined;
return;
};
LOG.debug("Reqest state : "+_this._request.readyState );
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/queue.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/queue.js 2008-12-08 17:24:32 UTC (rev 11649)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/queue.js 2008-12-08 17:34:44 UTC (rev 11650)
@@ -121,6 +121,10 @@
setEventsCount: function(newCount) {
this.eventsCount = newCount;
+ },
+
+ getEventArguments: function() {
+ return [this.query, this.options, this.event];
}
});
@@ -161,7 +165,11 @@
}
},
- getQueueSize: function() {
+ getSize: function() {
+ return this.items.length;
+ },
+
+ getMaximumSize: function() {
return this.queueOptions.size;
},
@@ -174,6 +182,24 @@
return policy;
},
+ queue: function(entry) {
+ this.items.push(entry);
+
+ if (this.queueOptions.onrequestqueue) {
+ LOG.debug("Call onrequestqueue handler");
+ this.queueOptions.onrequestqueue.apply(this, entry.getEventArguments());
+ }
+ },
+
+ dequeue: function() {
+ var entry = this.items.shift();
+
+ if (this.queueOptions.onrequestdequeue) {
+ LOG.debug("Call onrequestdequeue handler");
+ this.queueOptions.onrequestdequeue.apply(this, entry.getEventArguments());
+ }
+ },
+
push: function(query, opts, event) {
var options = extendOptions.call(this, opts);
@@ -198,7 +224,7 @@
LOG.debug("Current request in queue '" + this.name + "' has been aborted");
//remove last (that is actually first) from queue - will be safer to do that in LinkedList
- this.items.shift();
+ this.dequeue();
}
} else {
LOG.debug("Combine similar requests and reset timer");
@@ -231,7 +257,7 @@
}
if (this.queueOptions.onsizeexceeded) {
- this.queueOptions.onsizeexceeded.call(this, query, opts, event);
+ this.queueOptions.onsizeexceeded.apply(this, entry.getEventArguments());
}
// TODO: create one function that will be implement this functionality // function (behaviorFlag, entry): should return handled flag
if (b == DROP_NEW) {
@@ -274,7 +300,7 @@
}
if (!handled) {
- this.items.push(entry);
+ this.queue(entry);
LOG.debug("New request added to queue '" + this.name + "'. Queue similarityGroupingId changed to " + similarityGroupingId);
@@ -285,7 +311,7 @@
pop: function() {
LOG.debug("After request: queue '" + this.name + "'");
- this.items.shift();
+ this.dequeue();
LOG.debug("There are " + this.items.length + " requests more in this queue");
17 years, 5 months
JBoss Rich Faces SVN: r11649 - trunk/ui/suggestionbox/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-12-08 12:24:32 -0500 (Mon, 08 Dec 2008)
New Revision: 11649
Modified:
trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
Log:
https://jira.jboss.org/jira/browse/RF-5191
SuggestionBox: frequency deafult value is changed
Modified: trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
--- trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-12-08 17:21:54 UTC (rev 11648)
+++ trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-12-08 17:24:32 UTC (rev 11649)
@@ -249,8 +249,7 @@
Delay (in seconds) before activating the suggestion
pop-up. Default value is 400ms
</description>
- <defaultvalue>"400ms"</defaultvalue>
- </property>
+ </property>
<property>
<name>minChars</name>
<classname>java.lang.String</classname>
17 years, 5 months
JBoss Rich Faces SVN: r11648 - trunk/ui/suggestionbox/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-12-08 12:21:54 -0500 (Mon, 08 Dec 2008)
New Revision: 11648
Modified:
trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
Log:
https://jira.jboss.org/jira/browse/RF-5191
SuggestionBox: frequency deafult value is changed
Modified: trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
--- trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-12-08 16:48:41 UTC (rev 11647)
+++ trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-12-08 17:21:54 UTC (rev 11648)
@@ -247,8 +247,9 @@
<classname>double</classname>
<description>
Delay (in seconds) before activating the suggestion
- pop-up
+ pop-up. Default value is 400ms
</description>
+ <defaultvalue>"400ms"</defaultvalue>
</property>
<property>
<name>minChars</name>
17 years, 5 months
JBoss Rich Faces SVN: r11647 - trunk/ui/core/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-12-08 11:48:41 -0500 (Mon, 08 Dec 2008)
New Revision: 11647
Modified:
trunk/ui/core/src/main/config/component/queue.xml
Log:
RF-4664 - language correction has been done
Modified: trunk/ui/core/src/main/config/component/queue.xml
===================================================================
--- trunk/ui/core/src/main/config/component/queue.xml 2008-12-08 16:46:17 UTC (rev 11646)
+++ trunk/ui/core/src/main/config/component/queue.xml 2008-12-08 16:48:41 UTC (rev 11647)
@@ -31,42 +31,41 @@
<property>
<name>size</name>
<classname>int</classname>
- <description>Defines the number of items allowed in the queue at one time.</description>
+ <description>Defines the number of requests allowed in the queue at one time.</description>
</property>
<property>
<name>name</name>
<classname>java.lang.String</classname>
- <description>The optional name of this component</description>
+ <description>The name of the queue</description>
<defaultvalue>""</defaultvalue>
</property>
<property >
<name>requestDelay</name>
<classname>int</classname>
- <description>Attribute defines the time (in ms.) that the request will be wait in the queue before it is ready to send.
- When the delay time is over, the request will be sent to the server or removed if the newest 'similar' request is in a queue already</description>
+ <description>Attribute defines the time (in ms) the request will be waiting in the queue before it is ready to be sent.</description>
</property>
<property>
<name>ignoreDupResponses</name>
<classname>boolean</classname>
- <description>Attribute allows to ignore an Ajax Response produced by a request if the newest 'similar' request is in a queue already.
- ignoreDupResponses="true" does not cancel the request while it is processed on the server, but just allows to avoid unnecessary updates on the client side if the response isn't actual now</description>
+ <description>Attribute allows you to ignore an Ajax response produced by a request if the newest 'similar' request is in the queue already.
+ ignoreDupResponses="true" does not cancel the request while it is processed on the server, but just allows avoiding unnecessary updates on the client side if the response isn't actual now</description>
</property>
<property>
<name>timeout</name>
<classname>int</classname>
- <description>Response waiting time on a particular request. If a response is not received during this time, the request is aborted</description>
+ <description>Waiting time for response on a particular request. If no response is received during this time, the request is aborted</description>
</property>
<property>
<name>disabled</name>
<classname>boolean</classname>
- <description>If "true", disable this component on page.</description>
+ <description>If "true", disables this component on page.</description>
</property>
<property>
<name>onsubmit</name>
<classname>java.lang.String</classname>
- <description>JavaScript code for call before submission of ajax event</description>
+ <description>JavaScript code for call before submission of an ajax request</description>
</property>
<property>
<name>onbeforedomupdate</name>
@@ -81,7 +80,7 @@
<property>
<name>onerror</name>
<classname>java.lang.String</classname>
- <description>HTML: a script expression; event fires whenever an JavaScript error occurs</description>
+ <description>HTML: a script expression; event fires whenever an JavaScript server side error occurs</description>
</property>
<property>
<name>sizeExceededBehavior</name>
17 years, 5 months
JBoss Rich Faces SVN: r11646 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-12-08 11:46:17 -0500 (Mon, 08 Dec 2008)
New Revision: 11646
Modified:
trunk/docs/userguide/en/src/main/docbook/included/queue.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/queue.xml
Log:
RF-4664 - new information and description of the component have been added; language correction has been done
Modified: trunk/docs/userguide/en/src/main/docbook/included/queue.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/queue.desc.xml 2008-12-08 16:45:58 UTC (rev 11645)
+++ trunk/docs/userguide/en/src/main/docbook/included/queue.desc.xml 2008-12-08 16:46:17 UTC (rev 11646)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<chapter>
+<chapter role="new">
<section>
<sectioninfo>
<keywordset>
@@ -7,6 +7,7 @@
</keywordset>
</sectioninfo>
<title>Description</title>
- <para>The <emphasis role="bold"><property><a4j:queue></property></emphasis> component creates queues that other components can reference and use.</para>
+ <para>The <emphasis role="bold"><property><a4j:queue></property></emphasis> component creates queues that other components can use and reference.</para>
+ <para>User can create a default queue for a form ( overriding the global default queue ).</para>
</section>
</chapter>
\ No newline at end of file
Modified: trunk/docs/userguide/en/src/main/docbook/included/queue.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/queue.xml 2008-12-08 16:45:58 UTC (rev 11645)
+++ trunk/docs/userguide/en/src/main/docbook/included/queue.xml 2008-12-08 16:46:17 UTC (rev 11646)
@@ -65,16 +65,13 @@
<itemizedlist>
<listitem>
<para>
- A user can set a queue globally in "web.xml". You don't need set the queue on the page itself. The global queue can be used by all components. Example you can see below:
+ A user can set a queue globally in "web.xml". You don't need set the queue on the page itself. The global queue can be used by all components. You can see the example below:
</para>
<programlisting role="XML"><![CDATA[<context-param>
<param-name>org.richfaces.queue.global.enabled</param-name>
<param-value>true</param-value>
</context-param>]]></programlisting>
<para>
- The global queue can be disabled for specifically view's application.
- </para>
- <para>
In order to enable/disable a global queue see the following examples:
</para>
<programlisting role="XML"><![CDATA[<a4j:queue name="org.richfaces.global_queue" disabled="false"... />]]></programlisting>
@@ -85,7 +82,7 @@
</listitem>
<listitem>
<para>
- A user can create separate queue for specific form with the help of the <emphasis role="bold"><property><a4j:form></property></emphasis> or <emphasis role="bold"><property><h:form></property></emphasis> tags.
+ A user can create a separate queue for specific form with the help of the <emphasis role="bold"><property><a4j:form></property></emphasis> or <emphasis role="bold"><property><h:form></property></emphasis> tags.
It will be the global queue only for this form.
</para>
<para>
@@ -111,7 +108,7 @@
<a4j:queue <a4j:queue name="fooQueue" ... />
...
</a4j:form>]]></programlisting>
- <para>If you use <emphasis role="bold"><property><a4j:form></property></emphasis> tag, you can reference a named queue as the form's default.</para>
+ <para>If you use the <emphasis role="bold"><property><a4j:form></property></emphasis> tag, you can reference a named queue as the form's default.</para>
<para>
<emphasis role="bold">
Example:
@@ -136,19 +133,49 @@
<a4j:commandButton eventsQueue="fooQueue" ... >]]></programlisting>
<para>
- As a result all requests generated through the onblur of the <emphasis><property><h:inputText></property></emphasis> component, and clicking of the <emphasis><property><h:commandButton></property></emphasis> will be funneled through the <code>"fooQueue"</code>.
+ As a result all requests generated through the onblur of the <emphasis role="bold"><property><h:inputText></property></emphasis> component, and clicking of the <emphasis role="bold"><property><h:commandButton></property></emphasis> will be funneled through the <code>"fooQueue"</code>.
</para>
<para>
- If you have a try to reference a nonexistent queue a new named queue will be created with all default settings.
+ If you try to refer to the nonexistent queue the new named queue will be created with all default settings.
</para>
</listitem>
</itemizedlist>
<para>
- The <emphasis><property>"size"</property></emphasis> attribute help you to set the number of items allowed in the queue at one time.
+ The <emphasis><property>"size"</property></emphasis> attribute helps you to set the number of requests allowed in the queue at one time.
</para>
<para>
-
+ The <emphasis><property>"sizeExceededBehavior"</property></emphasis> attribute defines four strategies of the queue's behavior if the number of the requests waiting in the queue is exceeded:
</para>
+ <itemizedlist>
+ <listitem>
+ <para>dropNext - this strategy is default. It drops next request that should be fired</para>
+ </listitem>
+ <listitem>
+ <para>dropNew - it drops the incoming request</para>
+ </listitem>
+ <listitem>
+ <para>fireNext - with the help of this strategy you can immediately fire the next request in line to be fired</para>
+ </listitem>
+ <listitem>
+ <para>fireNew - This type of the strategy immediately fires the incoming request.</para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The <emphasis><property>"requestDelay"</property></emphasis> attribute defines time delay for all the requests which fired using this queue.
+ </para>
+ <para>
+ <emphasis role="bold">
+ Example:
+ </emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:queue requestDelay="2000" ... />]]></programlisting>
+ <para>
+ As a result all the requests which were fired using this queue will have 2 sec delay.
+ </para>
+ <para>
+ The requests collect in the queue, combining similar ones, during request delay.
+ User should remember that such requests can combine, if they are raised sequentially, in order to not block the queue and not to change the requests order.
+ </para>
</section>
<section>
17 years, 5 months
JBoss Rich Faces SVN: r11645 - Reports/3.3.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-12-08 11:45:58 -0500 (Mon, 08 Dec 2008)
New Revision: 11645
Modified:
trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA2.xls
Log:
Modified: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA2.xls
===================================================================
(Binary files differ)
17 years, 5 months
JBoss Rich Faces SVN: r11644 - Reports/3.3.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-12-08 11:32:02 -0500 (Mon, 08 Dec 2008)
New Revision: 11644
Modified:
trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA2.xls
Log:
Modified: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA2.xls
===================================================================
(Binary files differ)
17 years, 5 months
JBoss Rich Faces SVN: r11643 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/calendar and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-12-08 11:25:49 -0500 (Mon, 08 Dec 2008)
New Revision: 11643
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/showAttributesTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5254 completed
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-08 15:47:24 UTC (rev 11642)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-08 16:25:49 UTC (rev 11643)
@@ -423,7 +423,7 @@
this.showWeeksBar = showWeeksBar;
}
- public void initShowAttributes() {
+ public void initShowAttributesTest() {
showApplyButton = true;
showHeader = true;
showFooter = true;
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/showAttributesTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-08 15:47:24 UTC (rev 11642)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-08 16:25:49 UTC (rev 11643)
@@ -39,7 +39,7 @@
static final String RESET_METHOD = "#{calendarBean.reset}";
- static final String INIT_SHOW_ATTRIBUTES = "#{calendarBean.initShowAttributes}";
+ static final String INIT_SHOW_ATTRIBUTES_TEST = "#{calendarBean.initShowAttributesTest}";
static final String FORM_ID = "_form:";
@@ -57,6 +57,8 @@
String calendarFooterId;
+ String weekDaysBarId;
+
String ajaxSubmitId;
String serverSubmitId;
@@ -101,6 +103,20 @@
String inputDateId;
+ String showApplyButtonId;
+
+ String showHeaderId;
+
+ String showFooterId;
+
+ String showInputId;
+
+ String showWeekDaysBarId;
+
+ String showWeeksBarId;
+
+ String showPopupId;
+
void initIds(String parentId) {
calendarId = parentId + FORM_ID + "calendar";
calendarHeaderId = calendarId + "Header";
@@ -127,6 +143,14 @@
currentDateHeaderXpath = "//td[@id='"+calendarHeaderId+"']/table/tbody/tr/td[3]/div";
popupButtonId = calendarId + "PopupButton";
inputDateId = calendarId + "InputDate";
+ showApplyButtonId = parentId + FORM_ID + "showApplyButton";
+ showHeaderId = parentId + FORM_ID + "showHeader";
+ showFooterId = parentId + FORM_ID + "showFooter";
+ showInputId = parentId + FORM_ID + "showInput";
+ showWeekDaysBarId = parentId + FORM_ID + "showWeekDaysBar";
+ showWeeksBarId = parentId + FORM_ID + "showWeeksBar";
+ showPopupId = parentId + FORM_ID + "showPopup";
+ weekDaysBarId = calendarId + "WeekDay";
}
String getStatus() {
@@ -628,15 +652,138 @@
@Test
public void testShowHeaderAttribute(Template template) {
- renderPage(SHOW_ATTRIBURES_TEST_URL, template, INIT_SHOW_ATTRIBUTES);
+ renderPage(SHOW_ATTRIBURES_TEST_URL, template, INIT_SHOW_ATTRIBUTES_TEST);
+ initIds(getParentId());
+ writeStatus("Check 'showHeader' attribute");
+
+ writeStatus("Non-popup mode");
+ check(showPopupId, false);
+
+ AssertPresent(calendarHeaderId, "Header is not present");
+ check(showHeaderId, false);
+ AssertNotPresent(calendarHeaderId, "Header is present");
+
+ writeStatus("Popup mode");
+ check(showPopupId, true);
+
+ showPopup();
+
+ AssertNotPresent(calendarHeaderId, "Header is present");
+ check(showHeaderId, true);
+ AssertPresent(calendarHeaderId, "Header is not present");
}
+ @Test
+ public void testShowFooterAttribute(Template template) {
+ renderPage(SHOW_ATTRIBURES_TEST_URL, template, INIT_SHOW_ATTRIBUTES_TEST);
+ initIds(getParentId());
+ writeStatus("Check 'showFooter' attribute");
+
+ writeStatus("Non-popup mode");
+ check(showPopupId, false);
+
+ AssertPresent(calendarFooterId, "Footer is not present");
+ check(showFooterId, false);
+ AssertNotPresent(calendarFooterId, "Footer is present");
+
+ writeStatus("Popup mode");
+ check(showPopupId, true);
+
+ showPopup();
+
+ AssertNotPresent(calendarFooterId, "Footer is present");
+ check(showFooterId, true);
+ AssertPresent(calendarFooterId, "Footer is not present");
+ }
+
+ @Test
+ public void testShowWeekDaysBar(Template template) {
+ renderPage(SHOW_ATTRIBURES_TEST_URL, template, INIT_SHOW_ATTRIBUTES_TEST);
+ initIds(getParentId());
+ writeStatus("Check 'showWeekDaysBar' attribute");
+
+ writeStatus("Non-popup mode");
+ check(showPopupId, false);
+
+ AssertPresent(weekDaysBarId, "Week days bar is not present");
+ check(showWeekDaysBarId, false);
+ AssertNotPresent(weekDaysBarId, "Week days bar is present");
+
+ writeStatus("Popup mode");
+ check(showPopupId, true);
+
+ showPopup();
+
+ AssertNotPresent(weekDaysBarId, "Week days bar is present");
+ check(showWeekDaysBarId, true);
+ AssertPresent(weekDaysBarId, "Week days bar is not present");
+ }
+
+ @Test
+ public void testShowWeeksBar(Template template) {
+ renderPage(SHOW_ATTRIBURES_TEST_URL, template, INIT_SHOW_ATTRIBUTES_TEST);
+ initIds(getParentId());
+ String weeksBarId = calendarId + "WeekNumCell1";
+ writeStatus("Check 'showWeeksBar' attribute");
+
+ writeStatus("Non-popup mode");
+ check(showPopupId, false);
+
+ AssertPresent(weeksBarId, "Weeks bar is not present");
+ check(showWeeksBarId, false);
+ AssertNotPresent(weeksBarId, "Weeks bar is present");
+
+ writeStatus("Popup mode");
+ check(showPopupId, true);
+
+ showPopup();
+
+ AssertNotPresent(weeksBarId, "Weeks bar is present");
+ check(showWeeksBarId, true);
+ AssertPresent(weeksBarId, "Weeks bar is not present");
+ }
+
+ @Test
+ public void testShowInput(Template template) {
+ renderPage(SHOW_ATTRIBURES_TEST_URL, template, INIT_SHOW_ATTRIBUTES_TEST);
+ initIds(getParentId());
+ writeStatus("Check 'showInput' attribute");
+
+ writeStatus("This attribute makes sense in popup mode only");
+ check(showPopupId, true);
+
+ AssertVisible(inputDateId, "Input is not visible");
+ check(showInputId, false);
+ AssertNotVisible(inputDateId, "Input is visible");
+ }
+
+ @Test
+ public void testShowApplyButton(Template template) {
+ renderPage(SHOW_ATTRIBURES_TEST_URL, template, INIT_SHOW_ATTRIBUTES_TEST);
+ initIds(getParentId());
+ String applyButtonXpath = "//td[@id='" + calendarFooterId + "']/table/tbody/tr/td[6]";
+ writeStatus("Check 'showApplyButton' attribute");
+
+ writeStatus("This attribute makes sense in popup mode only");
+ check(showPopupId, true);
+
+ showPopup();
+
+ Assert.assertTrue(isVisible(applyButtonXpath), "Apply button is not visible");
+ check(showApplyButtonId, false);
+ Assert.assertFalse(isVisible(applyButtonXpath), "Apply button is visible");
+ }
+
private void setPopup(boolean isPopup) {
- check(isPopupId, isPopup);
+ runScript("$('" + isPopupId + "').checked=" + isPopup);
}
- private void check(String checkBoxId, boolean isChecked) {
- runScript("$('" + checkBoxId + "').checked=" + isChecked);
+ private boolean check(String checkBoxId, boolean isChecked) {
+ boolean prevValue = Boolean.parseBoolean(runScript("$('" + checkBoxId + "').checked"));
+ if (prevValue != isChecked) {
+ clickAjaxCommandAndWait(checkBoxId);
+ }
+ return prevValue;
}
private void setup() {
17 years, 5 months
JBoss Rich Faces SVN: r11642 - in trunk/test-applications/realworld: ejb/src/main/java/org/richfaces/realworld/service and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2008-12-08 10:47:24 -0500 (Mon, 08 Dec 2008)
New Revision: 11642
Added:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/FriendHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImageLoader.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/SelectedImageIndex.java
Modified:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Comment.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/FriendshipRequest.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/Authenticator.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeRootItem.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationHelper.java
trunk/test-applications/realworld/web/src/main/webapp/fileUpload.xhtml
trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/menuShared.xhtml
trunk/test-applications/realworld/web/src/main/webapp/navigation.xhtml
trunk/test-applications/realworld/web/src/main/webapp/search.xhtml
trunk/test-applications/realworld/web/src/main/webapp/userPrefs.xhtml
Log:
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -30,6 +30,7 @@
import org.hibernate.validator.NotNull;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Role;
import org.jboss.seam.annotations.Scope;
/**
@@ -40,8 +41,8 @@
*/
@Entity
@Name("album")
-(a)Scope(ScopeType.PAGE)
@Table(name = "albums")
+@Role(name="selectedAlbum", scope = ScopeType.CONVERSATION)
public class Album implements Serializable {
private static final long serialVersionUID = -7042878411608396483L;
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Comment.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Comment.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Comment.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -24,7 +24,6 @@
@Entity
@Name("comment")
-(a)Scope(ScopeType.PAGE)
@Table(name = "comments")
public class Comment implements Serializable{
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/FriendshipRequest.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/FriendshipRequest.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/FriendshipRequest.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -1,5 +1,7 @@
package org.richfaces.realworld.domain;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
@@ -17,7 +19,7 @@
@Entity
@Name("friendshipRequest")
@Table(name = "friendship_requests")
-public class FriendshipRequest {
+public class FriendshipRequest implements Serializable{
@Id
@GeneratedValue
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -31,6 +31,7 @@
import org.hibernate.validator.NotNull;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Role;
import org.jboss.seam.annotations.Scope;
/**
@@ -41,8 +42,8 @@
*/
@Entity
@Name("image")
-(a)Scope(ScopeType.PAGE)
@Table(name = "Images")
+@Role(name="selectedImage", scope = ScopeType.CONVERSATION)
public class Image implements Serializable {
private static final long serialVersionUID = -7042878411608396483L;
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -24,7 +24,6 @@
@Entity
@Name("message")
@Table(name = "messages")
-(a)Scope(ScopeType.PAGE)
public class Message implements Serializable{
@Id
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -31,6 +31,7 @@
import org.hibernate.validator.Pattern;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Role;
import org.jboss.seam.annotations.Scope;
/*@NamedQueries({
@@ -41,8 +42,9 @@
})*/
@Entity
+(a)Scope(ScopeType.SESSION)
@Name("user")
-(a)Scope(ScopeType.SESSION)
+@Role(name="selectedUser", scope = ScopeType.CONVERSATION)
@Table(name = "Users")
public class User implements Serializable {
@@ -319,4 +321,26 @@
return null;
}
+ public Album getAlbumByName(String albumName){
+ for(Album a : this.getChildAlbums()){
+ if(a.getName().equals(albumName)){
+ return a;
+ }
+ }
+ return null;
+ }
+
+ public void removeFromSharedAlbums(Album album) {
+ sharedAlbums.remove(album);
+ }
+
+ public void addSharedAlbum(Album album) {
+ if (album == null) {
+ throw new IllegalArgumentException("Null album!");
+ }
+ if(sharedAlbums.contains(album)){
+ return;
+ }
+ sharedAlbums.add(album);
+ }
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -13,7 +13,6 @@
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.User;
-@Stateful
@Name("albumAction")
public class AlbumAction implements IAlbumAction {
//@PersistenceContext(unitName = "entityManager", type=PersistenceContextType.EXTENDED)
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -8,12 +8,13 @@
import javax.ejb.Remove;
import org.jboss.seam.annotations.Destroy;
+import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.FriendshipRequest;
import org.richfaces.realworld.domain.User;
@Local
public interface IUserAction {
- public boolean login(String username, String password);
+ public User login(String username, String password);
@Remove
public void remove();
@@ -30,4 +31,6 @@
public void removeFromFriends(User owner, User removed);
public boolean friendExist(User user, User friend);
public void addFriend(User user, User friend, FriendshipRequest request);
+ public void removeFromSharedAlbums(User user, Album album);
+ public void addSharedAlbum(Album album);
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -35,12 +35,11 @@
@In(create = true, required = true) @Out
private User user;
- public boolean login(String username, String password) {
- user = (User)em.createQuery("from User u where u.login = :username and u.password = :password")
+ public User login(String username, String password) {
+ return user = (User)em.createQuery("from User u where u.login = :username and u.password = :password")
.setParameter("username", username)
.setParameter("password", password)
.getSingleResult();
- return user != null;
}
@Remove
@@ -106,4 +105,14 @@
user.addFriend(friend);
friend.addFriend(user);
}
+
+ public void removeFromSharedAlbums(User user, Album album) {
+ user.removeFromSharedAlbums(album);
+ em.flush();
+ }
+
+ public void addSharedAlbum(Album album) {
+ user.addSharedAlbum(album);
+
+ }
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -20,7 +20,7 @@
import org.richfaces.realworld.domain.User;
@Name("avatarUpload")
-(a)Scope(ScopeType.PAGE)
+(a)Scope(ScopeType.CONVERSATION)
public class AvatarUpload implements Serializable{
@In(create=true)
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -36,6 +36,7 @@
import org.jboss.seam.faces.FacesMessages;
import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;
+import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.tree.TreeActionManager;
@@ -46,17 +47,20 @@
*
*/
@Name("fileUploadBean")
-(a)Scope(ScopeType.SESSION)
+(a)Scope(ScopeType.CONVERSATION)
@Synchronized(timeout=2000)
public class FileUploadBean implements Serializable{
@In @Out
private User user;
- @In
- TreeSelectionManager treeSelectionManager;
-
@In(create=true)
+ private Image selectedImage;
+
+ @In(create=true)
+ private Album selectedAlbum;
+
+ @In(create=true)
TreeActionManager treeActionManager;
@In(create=true)
@@ -90,8 +94,8 @@
image.setDescription("Sample Description");
image.setName("Sample Name");
image.setPath(item.getFileName());
- image.setAlbumName(treeSelectionManager.getSelectedAlbum().getName());
- image.setAlbum(treeSelectionManager.getSelectedAlbum());
+ image.setAlbumName(selectedAlbum.getName());
+ image.setAlbum(selectedAlbum);
file.setImage(image);
files.add(file);
}
@@ -112,7 +116,7 @@
for(FileItem file:files){
if(file.isSelected()){
//Save file to disk
- String fileName = user.getLogin() + fileManager.getFileSeparator() + treeSelectionManager.getSelectedAlbum().getName() + fileManager.getFileSeparator() + file.getImage().getPath();
+ String fileName = user.getLogin() + fileManager.getFileSeparator() + selectedAlbum.getName() + fileManager.getFileSeparator() + file.getImage().getPath();
try {
fileManager.addImage(fileName , file.getData());
} catch (IOException e) {
@@ -127,7 +131,7 @@
public void storeAll() {
for(FileItem file:files){
//Save file to disk
- String fileName = user.getLogin() + fileManager.getFileSeparator() + treeSelectionManager.getSelectedAlbum().getName() + fileManager.getFileSeparator() + file.getImage().getPath();
+ String fileName = user.getLogin() + fileManager.getFileSeparator() + selectedAlbum.getName() + fileManager.getFileSeparator() + file.getImage().getPath();
try {
fileManager.addImage(fileName , file.getData());
} catch (IOException e) {
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -26,6 +26,7 @@
import org.richfaces.realworld.service.ISearchService;
@Name("searchBean")
+(a)Scope(ScopeType.CONVERSATION)
public class SearchBean implements Serializable {
/**
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/Authenticator.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/Authenticator.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/Authenticator.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -6,26 +6,41 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
import org.jboss.seam.faces.FacesMessages;
import org.jboss.seam.log.Log;
import org.jboss.seam.security.Identity;
import org.jboss.seam.web.Session;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.fileupload.AvatarUpload;
import org.richfaces.realworld.fileupload.FileManager;
import org.richfaces.realworld.service.IUserAction;
@Name("authenticator")
+(a)Scope(ScopeType.CONVERSATION)
public class Authenticator
{
@Logger Log log;
@In Identity identity;
+ @Out
+ private Image selectedImage;
+
+ @Out(required=false)
+ private User selectedUser;
+
+ @Out
+ private Album selectedAlbum;
+
@In FacesMessages facesMessages;
@In(create = true)
@@ -45,11 +60,19 @@
{
log.info("authenticating #0", identity.getUsername());
try{
- if(userAction.login(identity.getUsername(), identity.getPassword())){
+ User user = userAction.login(identity.getUsername(), identity.getPassword());
+ if(user != null){
identity.addRole("admin");
if(!fileManager.isDirectoryPresent(identity.getUsername())){
fileManager.addDirectory(identity.getUsername());
}
+ if(user.getChildAlbums().size() > 0){
+ selectedAlbum = user.getChildAlbums().get(0);
+ if(selectedAlbum.getImages().size() > 0){
+ selectedImage = selectedAlbum.getImages().get(0);
+ }
+ selectedUser = user;
+ }
return true;
}
}catch(Exception nre){
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -8,6 +8,7 @@
import javax.faces.model.SelectItem;
import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
@@ -23,15 +24,20 @@
import org.richfaces.realworld.service.IImageAction;
import org.richfaces.realworld.service.IMessageAction;
import org.richfaces.realworld.service.IUserAction;
+import org.richfaces.realworld.util.NavigationEnum;
import org.richfaces.realworld.util.RatingHelper;
+import org.richfaces.realworld.util.SelectedImageIndex;
@Name("treeActionManager")
-(a)Scope(ScopeType.PAGE)
+(a)Scope(ScopeType.CONVERSATION)
public class TreeActionManager implements Serializable{
@In
private User user;
+ @Out(required=false)
+ private User selectedUser;
+
@In(create=true, required=true)
private IAlbumAction albumAction;
@@ -50,22 +56,40 @@
@In(create=true, required=true) @Out
private Album album;
+ @In(create=true) @Out
+ private SelectedImageIndex selectedImageIndex;
+
@In(create=true)
FileManager fileManager;
+ @In(create=true) @Out
+ private Image selectedImage;
+
+ @In(create=true) @Out
+ private Album selectedAlbum;
+
+ @In(create=true) TreeSelectionManager treeSelectionManager;
+
@In(create=true) TreeRootItem treeRoot;
- @In(create=true, required=true)
- TreeSelectionManager treeSelectionManager;
+ private String selectedAlbumName;
+ public String getSelectedAlbumName() {
+ return selectedAlbumName;
+ }
+
+ public void setSelectedAlbumName(String selectedAlbumName) {
+ this.selectedAlbumName = selectedAlbumName;
+ }
+
public void addAlbum(){
albumAction.addAlbum(album);
treeRoot.getAvailableAlbums().add(new SelectItem(album.getName()));
TreeAlbumItem albumItem = new TreeAlbumItem(album.getId(), treeRoot, album);
treeRoot.addAlbumToTree(albumItem);
fileManager.addDirectory(user.getLogin() + fileManager.getFileSeparator() + album.getName());
- treeSelectionManager.setSelectedImage(null);
- treeSelectionManager.setSelectedAlbum(albumItem.getAlbum());
+ selectedImage = null;
+ selectedAlbum = albumItem.getAlbum();
}
@@ -100,8 +124,8 @@
treeRoot.getAvailableAlbums().remove(item);
treeRoot.removeChild(album.getId());
fileManager.deleteDirectory(user.getLogin() + fileManager.getFileSeparator() + albumName);
- treeSelectionManager.setSelectedImage(null);
- treeSelectionManager.setSelectedAlbum(null);
+ selectedImage = null;
+ selectedAlbum = null;
}
public void deleteImage(Image image){
@@ -111,7 +135,7 @@
imageAction.deleteImage(image);
parent.removeChild(image.getId());
fileManager.deleteImage(user.getLogin() + fileManager.getFileSeparator() + albumName + fileManager.getFileSeparator() + imagePath);
- treeSelectionManager.setSelectedImage(null);
+ selectedImage = null;
}
public void editImage(Image image){
@@ -127,8 +151,8 @@
String fileNameOld = user.getLogin() + fileManager.getFileSeparator() + image.getAlbum().getName() + fileManager.getFileSeparator() + image.getPath();
String fileNameNew = user.getLogin() + fileManager.getFileSeparator() + image.getAlbumName() + fileManager.getFileSeparator() + image.getPath();
fileManager.renameImage(fileNameOld, fileNameNew);
- treeSelectionManager.setSelectedImage(imageItem.getImage());
- treeSelectionManager.setSelectedAlbum(albumItem.getAlbum());
+ selectedImage = imageItem.getImage();
+ selectedAlbum = albumItem.getAlbum();
}else{
TreeImageItem imageItem = (TreeImageItem)parent.getChild(image.getId());
imageItem.setImage(image);
@@ -140,8 +164,8 @@
TreeAlbumItem albumItem = treeRoot.getAlbumByName(image.getAlbumName());
TreeImageItem imageItem = new TreeImageItem(image.getId(),albumItem,image);
albumItem.addChild(image.getId(), imageItem);
- treeSelectionManager.setSelectedImage(imageItem.getImage());
- treeSelectionManager.setSelectedAlbum(albumItem.getAlbum());
+ selectedImage = imageItem.getImage();
+ selectedAlbum = albumItem.getAlbum();
}
public void editComment(Comment comment) {
@@ -152,7 +176,7 @@
imageAction.addComment(comment);
}
- public void addAutoComment(User user, Image image) {
+ public void addAutoComment(Image image) {
Comment comment = new Comment();
comment.setAuthor(user);
comment.setDate(new Date());
@@ -203,7 +227,32 @@
}*/
}
+ public void addToSharedAlbums(Image image){
+ userAction.addSharedAlbum(image.getAlbum());
+ }
+
+ @Begin(join=true)
+ public void removeFromSharedAlbums(Album album){
+ userAction.removeFromSharedAlbums(user, album);
+ }
+
public void vote(Image image){
imageAction.vote(image, (Long)Long.valueOf(ratingHelper.getInputSlider().getValue().toString()));
}
+
+ public void showSharedAlbum(Image image){
+ NavigationEnum mainArea = NavigationEnum.IMAGE_PREVIEW;
+ treeSelectionManager.setMainArea(mainArea);
+ selectedUser = image.getAlbum().getOwner();
+ selectedAlbum = image.getAlbum();
+ selectedImage = selectedAlbum.getImages().get(0);
+ selectedImageIndex.setSelectedImageIndex(1);
+ }
+
+ @Begin(join=true)
+ public void updateSelectedAlbum(){
+ selectedAlbum = user.getAlbumByName(this.getSelectedAlbumName());
+ selectedImage = selectedAlbum.getImages().get(0);
+ selectedImageIndex.setSelectedImageIndex(1);
+ }
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeRootItem.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeRootItem.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeRootItem.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -21,7 +21,7 @@
import org.richfaces.realworld.service.IImageAction;
@Name("treeRoot")
-(a)Scope(ScopeType.PAGE)
+(a)Scope(ScopeType.CONVERSATION)
public class TreeRootItem implements TreeNode {
@In @Out
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -17,17 +17,16 @@
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
-import javax.faces.model.SelectItemGroup;
import javax.imageio.ImageIO;
import org.ajax4jsf.context.AjaxContext;
import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Synchronized;
-import org.richfaces.component.UIDataTable;
import org.richfaces.component.UIDatascroller;
import org.richfaces.component.UIDragSupport;
import org.richfaces.component.UITree;
@@ -43,24 +42,26 @@
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.fileupload.FileManager;
import org.richfaces.realworld.util.NavigationEnum;
+import org.richfaces.realworld.util.SelectedImageIndex;
@Name("treeSelectionManager")
+(a)Scope(ScopeType.CONVERSATION)
@Synchronized(timeout=2000)
-(a)Scope(ScopeType.SESSION)
public class TreeSelectionManager implements Serializable{
- private static final FacesContext FacesContext = null;
-
@In
private User user;
private NavigationEnum mainArea = NavigationEnum.IMAGE_PREVIEW;
+ @In(required=false) @Out
private Image selectedImage;
+ @In(required=false) @Out
private Album selectedAlbum;
- private int selectedImageIndex = 1;
+ @In(create=true) @Out
+ private SelectedImageIndex selectedImageIndex;
@In(create=true)
FileManager fileManager;
@@ -70,127 +71,43 @@
private String nodeTitle;
- public Album getSelectedAlbum() {
- return selectedAlbum;
- }
-
public void showFileUpload(TreeAlbumItem item){
- this.setSelectedAlbum(item.getAlbum());
+ selectedAlbum = item.getAlbum();
if(item.isLeaf()){
- this.setSelectedImage(null);
+ selectedImage=null;
}else{
- this.setSelectedImage(((TreeImageItem)(item.getImages().get(0))).getImage());
+ selectedImage = ((TreeImageItem)(item.getImages().get(0))).getImage();
}
this.setMainArea(NavigationEnum.FILE_UPLOAD);
}
public void scrollerListener(DataScrollerEvent event) {
- List<Image> images = this.getSelectedAlbum().getImages();
+ List<Image> images = selectedAlbum.getImages();
if (event.getNewScrolVal().equals("previous")) {
for(int index = 0 ; index < images.size(); index++){
- if(images.get(index) == this.getSelectedImage()){
- this.setSelectedImage(images.get(index - 1));
- this.setSelectedImageIndex(index);
+ if(images.get(index) == selectedImage){
+ selectedImage = images.get(index - 1);
+ selectedImageIndex.setSelectedImageIndex(index);
}
}
} else if (event.getNewScrolVal().equals("last")) {
- this.setSelectedImage(images.get(images.size() - 1));
- this.setSelectedImageIndex(images.size());
+ selectedImage = images.get(images.size() - 1);
+ selectedImageIndex.setSelectedImageIndex(images.size());
} else if (event.getNewScrolVal().equals("next")) {
for(int index = 0 ; index < images.size(); index++){
- if(images.get(index) == this.getSelectedImage()){
- this.setSelectedImage(images.get(index + 1));
- this.setSelectedImageIndex(index + 2);
+ if(images.get(index) == selectedImage){
+ selectedImage = images.get(index + 1);
+ selectedImageIndex.setSelectedImageIndex(index + 2);
return;
}
}
} else if (event.getNewScrolVal().equals("first")) {
- this.setSelectedImage(images.get(0));
- this.setSelectedImageIndex(1);
+ selectedImage = images.get(0);
+ selectedImageIndex.setSelectedImageIndex(1);
}
}
- public synchronized void paint(OutputStream out, Object data) throws IOException{
- if (null == data) {
- return;
- }
- File imageResource = fileManager.getImage(user.getLogin() + fileManager.getFileSeparator() + this.getSelectedAlbum().getName() + fileManager.getFileSeparator() + data.toString());
- if (imageResource != null) {
- FileInputStream fileInputStream = new FileInputStream(imageResource);
- BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
- InputStream paintData = bufferedInputStream;
- if (null == paintData) {
- // throw new Exception("");
- // TODO
- }
- try{
- BufferedImage image = ImageIO.read(paintData);
- ImageIO.write(image, "jpeg", out);
- }catch(Exception e){
-
- }finally{
- fileInputStream.close();
- bufferedInputStream.close();
- paintData.close();
- }
- }
- }
-
- public synchronized void paintAvatar(OutputStream out, Object data) throws IOException{
- if (null == data) {
- return;
- }
- File imageResource = fileManager.getImage(user.getLogin() + fileManager.getFileSeparator() + "avatars" + fileManager.getFileSeparator() + data.toString());
- if (imageResource != null) {
- FileInputStream fileInputStream = new FileInputStream(imageResource);
- BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
- InputStream paintData = bufferedInputStream;
- if (null == paintData) {
- // throw new Exception("");
- // TODO
- }
- try{
- BufferedImage image = ImageIO.read(paintData);
- ImageIO.write(image, "jpeg", out);
- }catch(Exception e){
-
- }finally{
- fileInputStream.close();
- bufferedInputStream.close();
- paintData.close();
- }
- }
- }
-
- public synchronized void paintFriendAvatar(OutputStream out, Object data) throws IOException{
- if (null == data) {
- return;
- }
- String temp = data.toString();
- String[] array = temp.split(":");
- File imageResource = fileManager.getImage(array[0] + fileManager.getFileSeparator() + "avatars" + fileManager.getFileSeparator() + array[1]);
- if (imageResource != null) {
- FileInputStream fileInputStream = new FileInputStream(imageResource);
- BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
- InputStream paintData = bufferedInputStream;
- if (null == paintData) {
- // throw new Exception("");
- // TODO
- }
- try{
- BufferedImage image = ImageIO.read(paintData);
- ImageIO.write(image, "jpeg", out);
- }catch(Exception e){
-
- }finally{
- fileInputStream.close();
- bufferedInputStream.close();
- paintData.close();
- }
- }
- }
-
public void dropListener(DropEvent dropEvent) {
// resolve drag destination attributes
@@ -275,37 +192,14 @@
return index;
}
- public Image getSelectedImage() {
- return selectedImage;
- }
-
- public void setSelectedImage(Image selectedImage) {
- this.selectedImage = selectedImage;
- }
-
- public void setSelectedAlbum(Album selectedAlbum) {
- this.selectedAlbum = selectedAlbum;
- }
-
public Boolean adviseNodeSelected(UITree tree) {
TreeRowKey treeRowKey = (TreeRowKey) tree.getRowKey();
TreeNode treeNode = (TreeNode) tree.getRowData(treeRowKey);
-
- if(treeNode instanceof TreeAlbumItem){
- TreeAlbumItem currentNode = (TreeAlbumItem)treeNode;
- if(this.getSelectedAlbum() != null){
- return currentNode.getAlbum() == this.getSelectedAlbum() && null == this.getSelectedImage() ? Boolean.TRUE: Boolean.FALSE;
- }else{
- this.setSelectedAlbum(currentNode.getAlbum());
- if(currentNode.isLeaf()){
- return Boolean.TRUE ;
- }else{
- this.setSelectedImage(((TreeImageItem)(currentNode.getImages().get(0))).getImage());
- return Boolean.FALSE ;
- }
- }
- }else if(treeNode instanceof TreeImageItem){
- return ((TreeImageItem)treeNode).getImage() == this.getSelectedImage() ? Boolean.TRUE : Boolean.FALSE;
+ if (treeNode instanceof TreeAlbumItem) {
+ TreeAlbumItem currentNode = (TreeAlbumItem) treeNode;
+ return currentNode.getAlbum() == selectedAlbum;
+ } else if (treeNode instanceof TreeImageItem) {
+ return ((TreeImageItem) treeNode).getImage() == selectedImage;
}
return null;
}
@@ -313,17 +207,9 @@
public Boolean adviseNodeOpened(UITree tree) {
TreeRowKey treeRowKey = (TreeRowKey) tree.getRowKey();
TreeNode treeNode = (TreeNode) tree.getRowData(treeRowKey);
- if(treeNode instanceof TreeAlbumItem){
- TreeAlbumItem currentNode = (TreeAlbumItem)treeNode;
- if(this.getSelectedAlbum() != null){
- return currentNode.getAlbum() == this.getSelectedAlbum() ? Boolean.TRUE: Boolean.FALSE;
- }else{
- this.setSelectedAlbum(currentNode.getAlbum());
- if(!currentNode.isLeaf()){
- this.setSelectedImage(((TreeImageItem)currentNode.getImages().get(0)).getImage());
- }
- return Boolean.TRUE ;
- }
+ if (treeNode instanceof TreeAlbumItem) {
+ TreeAlbumItem currentNode = (TreeAlbumItem) treeNode;
+ return currentNode.getAlbum() == selectedAlbum;
}
return null;
}
@@ -340,10 +226,10 @@
TreeNode<String> currentNode = tree.getModelTreeNode(tree.getRowKey());
if(currentNode instanceof TreeImageItem){
Image image = ((TreeImageItem)currentNode).getImage();
- this.setSelectedImage(image);
+ selectedImage = image;
Album album = ((TreeAlbumItem)currentNode.getParent()).getAlbum();
- if(album != this.getSelectedAlbum()){
- this.setSelectedAlbum(album);
+ if(album != selectedAlbum){
+ selectedAlbum = album;
}
int index = album.getIndex(image);
setDataScrollerIndex(index);
@@ -352,29 +238,29 @@
TreeAlbumItem node = (TreeAlbumItem)currentNode;
setDataScrollerIndex(0);
if (node.isLeaf()) {
- this.setSelectedImage(null);
+ selectedImage = null;
Album album = node.getAlbum();
- this.setSelectedAlbum(album);
+ selectedAlbum = album;
}else{
- if(node.getAlbum() == this.getSelectedAlbum()){
+ if(node.getAlbum() == selectedAlbum){
return;
}else{
- setSelectedAlbum(node.getAlbum());
- this.setSelectedImage(node.getAlbum().getImages().get(0));
+ selectedAlbum = node.getAlbum();
+ selectedImage = node.getAlbum().getImages().get(0);
}
}
}
}
public void updateScroller(ActionEvent event){
- this.setDataScrollerIndex(this.selectedImageIndex - 1);
+ this.setDataScrollerIndex(selectedImageIndex.getSelectedImageIndex()- 1);
}
private void setDataScrollerIndex(int index) {
UIComponent component = FacesContext.getCurrentInstance().getViewRoot();
UIDatascroller scroller = (UIDatascroller)component.findComponent("mainform:sc1");
scroller.setPage(index+1);
- this.setSelectedImageIndex(index+1);
+ selectedImageIndex.setSelectedImageIndex(index+1);
}
public String getNodeTitle() {
@@ -392,20 +278,18 @@
public void setMainArea(NavigationEnum mainArea) {
this.mainArea = mainArea;
}
-
- public int getSelectedImageIndex() {
- return selectedImageIndex;
- }
-
- public void setSelectedImageIndex(int selectedImageIndex) {
- this.selectedImageIndex = selectedImageIndex;
- }
public SelectItem[] getAvailableIndexOfImages(){
- SelectItem[] group = new SelectItem[this.getSelectedAlbum().getImages().size()];
- for(int i = 0; i < this.getSelectedAlbum().getImages().size(); i++){
+ SelectItem[] group = new SelectItem[selectedAlbum.getImages().size()];
+ for(int i = 0; i < selectedAlbum.getImages().size(); i++){
group[i] = new SelectItem(i+1);
}
return group;
}
+
+ public void updateSelectedItems(Image image){
+ selectedImage = image;
+ Integer index = selectedAlbum.getIndex(selectedImage);
+ setDataScrollerIndex(index);
+ }
}
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/FriendHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/FriendHelper.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/FriendHelper.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -0,0 +1,65 @@
+package org.richfaces.realworld.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.User;
+
+@Name("friendHelper")
+(a)Scope(ScopeType.CONVERSATION)
+public class FriendHelper {
+
+ @Out(required=false)
+ private User selectedUser;
+
+ @In(required=false) @Out
+ private Image selectedImage;
+
+ @In(required=false) @Out
+ private Album selectedAlbum;
+
+ @In(create=true) @Out
+ private SelectedImageIndex selectedImageIndex;
+
+ private String albumName;
+
+ public String getAlbumName() {
+ return albumName;
+ }
+
+ public void setAlbumName(String albumName) {
+ this.albumName = albumName;
+ }
+
+ public List<String> getFriendAlbums(User friend){
+ List<String> albumNames = new ArrayList<String>();
+ for(Album album:friend.getChildAlbums()){
+ albumNames.add(album.getName());
+ }
+ return albumNames;
+ }
+
+ @Begin(join=true)
+ public void chooseAlbum(User friend){
+ selectedUser = friend;
+ selectedAlbum = selectedUser.getAlbumByName(this.getAlbumName());
+ selectedImage = selectedAlbum.getImages().get(0);
+ selectedImageIndex.setSelectedImageIndex(1);
+ }
+
+ @Begin(join=true)
+ public void chooseAlbum(Album album){
+ selectedUser = album.getOwner();
+ selectedAlbum = album;
+ selectedImage = selectedAlbum.getImages().get(0);
+ selectedImageIndex.setSelectedImageIndex(1);
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/FriendHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImageLoader.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImageLoader.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImageLoader.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -0,0 +1,112 @@
+package org.richfaces.realworld.util;
+
+import java.awt.image.BufferedImage;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.imageio.ImageIO;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.fileupload.FileManager;
+
+@Name("imageLoader")
+(a)Scope(ScopeType.CONVERSATION)
+public class ImageLoader {
+
+ @In(create=true)
+ FileManager fileManager;
+
+ @In
+ private User user;
+
+ public synchronized void paint(OutputStream out, Object data) throws IOException{
+ if (null == data) {
+ return;
+ }
+ Image image = (Image)data;
+ File imageResource = fileManager.getImage(image.getAlbum().getOwner().getLogin() + fileManager.getFileSeparator() + image.getAlbum().getName() + fileManager.getFileSeparator() + image.getPath());
+ if (imageResource != null) {
+ FileInputStream fileInputStream = new FileInputStream(imageResource);
+ BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
+ InputStream paintData = bufferedInputStream;
+ if (null == paintData) {
+ // throw new Exception("");
+ // TODO
+ }
+ try{
+ BufferedImage images = ImageIO.read(paintData);
+ ImageIO.write(images, "jpeg", out);
+ }catch(Exception e){
+
+ }finally{
+ fileInputStream.close();
+ bufferedInputStream.close();
+ paintData.close();
+ }
+ }
+ }
+
+ public synchronized void paintAvatar(OutputStream out, Object data) throws IOException{
+ if (null == data) {
+ return;
+ }
+ File imageResource = fileManager.getImage(user.getLogin() + fileManager.getFileSeparator() + "avatars" + fileManager.getFileSeparator() + data.toString());
+ if (imageResource != null) {
+ FileInputStream fileInputStream = new FileInputStream(imageResource);
+ BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
+ InputStream paintData = bufferedInputStream;
+ if (null == paintData) {
+ // throw new Exception("");
+ // TODO
+ }
+ try{
+ BufferedImage image = ImageIO.read(paintData);
+ ImageIO.write(image, "jpeg", out);
+ }catch(Exception e){
+
+ }finally{
+ fileInputStream.close();
+ bufferedInputStream.close();
+ paintData.close();
+ }
+ }
+ }
+
+ public synchronized void paintFriendAvatar(OutputStream out, Object data) throws IOException{
+ if (null == data) {
+ return;
+ }
+ String temp = data.toString();
+ String[] array = temp.split(":");
+ File imageResource = fileManager.getImage(array[0] + fileManager.getFileSeparator() + "avatars" + fileManager.getFileSeparator() + array[1]);
+ if (imageResource != null) {
+ FileInputStream fileInputStream = new FileInputStream(imageResource);
+ BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
+ InputStream paintData = bufferedInputStream;
+ if (null == paintData) {
+ // throw new Exception("");
+ // TODO
+ }
+ try{
+ BufferedImage image = ImageIO.read(paintData);
+ ImageIO.write(image, "jpeg", out);
+ }catch(Exception e){
+
+ }finally{
+ fileInputStream.close();
+ bufferedInputStream.close();
+ paintData.close();
+ }
+ }
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImageLoader.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -18,7 +18,7 @@
import org.richfaces.realworld.tree.TreeActionManager;
@Name("modalPanelHelper")
-(a)Scope(ScopeType.SESSION)
+(a)Scope(ScopeType.CONVERSATION)
public class ModalPanelHelper implements Serializable{
private String caption;
@@ -145,7 +145,7 @@
this.searchRequired = false;
}
- public void initModalPanelData( String actionName, String caption, Comment comment, User user, Image image){
+ public void initModalPanelData( String actionName, String caption, Comment comment, Image image){
this.caption = caption;
this.actionName = actionName;
if(null != comment){
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationHelper.java 2008-12-08 15:38:23 UTC (rev 11641)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationHelper.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -1,8 +1,11 @@
package org.richfaces.realworld.util;
+import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
@Name(value="navigationHelper")
+(a)Scope(ScopeType.CONVERSATION)
public class NavigationHelper {
private NavigationEnum navigationEnum;
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/SelectedImageIndex.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/SelectedImageIndex.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/SelectedImageIndex.java 2008-12-08 15:47:24 UTC (rev 11642)
@@ -0,0 +1,20 @@
+package org.richfaces.realworld.util;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("selectedImageIndex")
+(a)Scope(ScopeType.CONVERSATION)
+public class SelectedImageIndex {
+
+ private Integer selectedImageIndex = 1;
+
+ public Integer getSelectedImageIndex() {
+ return selectedImageIndex;
+ }
+
+ public void setSelectedImageIndex(Integer selectedImageIndex) {
+ this.selectedImageIndex = selectedImageIndex;
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/SelectedImageIndex.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/web/src/main/webapp/fileUpload.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/layout/menuShared.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/navigation.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/search.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/userPrefs.xhtml
===================================================================
(Binary files differ)
17 years, 5 months
JBoss Rich Faces SVN: r11641 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-08 10:38:23 -0500 (Mon, 08 Dec 2008)
New Revision: 11641
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-08 15:29:18 UTC (rev 11640)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-08 15:38:23 UTC (rev 11641)
@@ -157,8 +157,12 @@
System.out.println("------>firefoxDir#" + j + ": " + firefoxDirs[j].getPath());
File[] firefoxes = firefoxDirs[j].listFiles(new FileFilter() {
public boolean accept(File pathname) {
- return pathname != null&& pathname.getName().startsWith("firefox")
- && pathname.isFile();
+ boolean result = false;
+ if (pathname != null && pathname.isFile()) {
+ String name = pathname.getName();
+ result = "firefox".equals(name) || "firefox-bin".equals(name);
+ }
+ return result;
}
});
for (int k = firefoxes.length - 1; k >= 0 && "*firefox".equals(browser); k--) {
17 years, 5 months
JBoss Rich Faces SVN: r11640 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-08 10:29:18 -0500 (Mon, 08 Dec 2008)
New Revision: 11640
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-08 15:26:58 UTC (rev 11639)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-08 15:29:18 UTC (rev 11640)
@@ -23,8 +23,8 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
+import java.io.FileFilter;
import java.io.FileInputStream;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -141,25 +141,33 @@
@BeforeClass
@Parameters({"browser", "filterPrefix"})
public void startSelenium(String browser, String filterPrefix) {
- String[] paths = {"/usr/lib/firefox-1.0.4/firefox-bin",
- "/usr/lib/firefox-1.5.0.10/firefox-bin",
- "/usr/lib/firefox-1.5.0.12/firefox-bin",
- "/usr/lib64/firefox-1.5.0.12/firefox-bin",
- "/usr/lib/firefox-3.0b5/firefox-bin",
- "/usr/lib64/firefox-3.0b5/firefox-bin",
- "/usr/lib/firefox-3.0.1/firefox-bin",
- "/usr/lib64/firefox-3.0.1/firefox-bin",
- "/usr/lib/firefox/firefox-bin",
- "/usr/lib/firefox-1.5.0.9/firefox-bin"
- };
if ("*firefox".equals(browser)) {
- for (int i = 0; i < paths.length && "*firefox".equals(browser); i++) {
- String path = paths[i];
- File file = new File(path);
- if (file.isFile()) {
- browser += " " + path;
- }
- }
+ File[] libs = {new File("/usr/lib"), new File("/usr/lib64")};
+ for (int i = 0; i < libs.length && "*firefox".equals(browser); i++) {
+ File lib = libs[i];
+ if (lib.isDirectory()) {
+ System.out.println("---->lib#" + i + ": " + lib.getPath());
+ File[] firefoxDirs = lib.listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ return pathname != null&& pathname.getName().startsWith("firefox")
+ && pathname.isDirectory();
+ }
+ });
+ for (int j = firefoxDirs.length - 1; j >= 0 && "*firefox".equals(browser); j--) {
+ System.out.println("------>firefoxDir#" + j + ": " + firefoxDirs[j].getPath());
+ File[] firefoxes = firefoxDirs[j].listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ return pathname != null&& pathname.getName().startsWith("firefox")
+ && pathname.isFile();
+ }
+ });
+ for (int k = firefoxes.length - 1; k >= 0 && "*firefox".equals(browser); k--) {
+ System.out.println("-------->firefoxes#" + k + ": " + firefoxes[k].getPath());
+ browser += " " + firefoxes[k].getPath();
+ }
+ }
+ }
+ }
}
synchronized (MUTEX) {
this.filterPrefix = filterPrefix;
17 years, 5 months
JBoss Rich Faces SVN: r11639 - in trunk/samples/richfaces-demo/src/main: java/org/richfaces/demo/queue and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-12-08 10:26:58 -0500 (Mon, 08 Dec 2008)
New Revision: 11639
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/queue/
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/queue/MojarraBean.java
trunk/samples/richfaces-demo/src/main/webapp/css/queueStylesheet.css
trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/resources/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/resources/bgblack18.jpg
trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/resources/button2.gif
trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/resources/button3.gif
trunk/samples/richfaces-demo/src/main/webapp/scripts/queueUi.js
Modified:
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/usage.xhtml
Log:
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/queue/MojarraBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/queue/MojarraBean.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/queue/MojarraBean.java 2008-12-08 15:26:58 UTC (rev 11639)
@@ -0,0 +1,25 @@
+package org.richfaces.demo.queue;
+
+
+import java.util.Random;
+
+import javax.faces.event.ActionEvent;
+
+/**
+ * <p>This simple bean conains one <code>ActionEvent</code>
+ * handler to simulate random processing times for
+ * requests on the server.
+ * <p/>
+ *
+ */
+public class MojarraBean {
+
+ public void process(ActionEvent ae) {
+ Random generator2 = new Random(System.currentTimeMillis());
+ int delay = generator2.nextInt(6001) + 1;
+ try {
+ Thread.sleep(delay);
+ } catch (Exception e) {
+ }
+ }
+}
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-12-08 15:18:10 UTC (rev 11638)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-12-08 15:26:58 UTC (rev 11639)
@@ -413,6 +413,11 @@
<managed-bean-class>org.richfaces.demo.editor.EditorBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>mojarraBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.queue.MojarraBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
<navigation-rule>
<from-view-id>/richfaces/include/examples/wstep1.xhtml</from-view-id>
<navigation-case>
Added: trunk/samples/richfaces-demo/src/main/webapp/css/queueStylesheet.css
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/css/queueStylesheet.css (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/css/queueStylesheet.css 2008-12-08 15:26:58 UTC (rev 11639)
@@ -0,0 +1,90 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can obtain
+ * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath" exception
+ * as provided by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the License
+ * Header, with the fields enclosed by brackets [] replaced by your own
+ * identifying information: "Portions Copyrighted [year]
+ * [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+.title-panel {
+ background-image: url('bgblack18.jpg');
+ height: 80px;
+ width: 900px;
+}
+
+.title-panel-text {
+ color: white;
+ font-family: 'Georgia','Times New Roman','times',serif;
+ font-size: 24px;
+ font-weight: bold;
+}
+
+.title-panel-subtext {
+ color: white;
+ font-family: 'Georgia','Times New Roman','times',serif;
+ font-size: 14px;
+ font-style: italic
+}
+
+body {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+.panel-input-border {
+ border: 2px outset blue;
+ background-color: #e0eeee;
+}
+
+.panel-data-border {
+ border: 3px outset blue;
+ background-color: #e0eeee;
+}
+
+.keytitle {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 16px;
+ color: #330066;
+}
+
+.ticker {
+ position: relative;
+ visibility: hidden;
+ font-size: 16px;
+}
+
+.serialize-border {
+ border: 4px outset red;
+}
+
+.queueCell {
+ background-color: #00ffff;
+}
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml 2008-12-08 15:18:10 UTC (rev 11638)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml 2008-12-08 15:26:58 UTC (rev 11639)
@@ -3,22 +3,43 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich">
- <style>
- .link{
- width:40px;
- height:40px;
- }
- </style>
- <h:form>
- <rich:dataGrid value="#{queueBean.buttons}" var="button" columns="4">
- <rich:paint2D cacheable="false" paint="#{queueBean.paint}" data="#{button.color}">
- </rich:paint2D>
- <ui:remove>
- <h:panelGroup layout="block" style="background-color: #{button.color}" styleClass="link">
- <h:outputText value="#{button.name}"/>
- </h:panelGroup>
- </ui:remove>
- </rich:dataGrid>
- </h:form>
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:c="http://java.sun.com/jstl/core">
+ <a4j:loadScript src="/scripts/queueUi.js"/>
+ <a4j:loadStyle src="/css/queueStylesheet.js"/>
+ <h:form id="form1" prependId="false">
+ <a4j:queue />
+
+ <h:panelGrid columns="2" cellspacing="5">
+ <h:panelGrid id="board1" columns="6" border="1">
+ <f:facet name="header">
+ <h:outputText value="Ajax Requests" styleClass="keytitle" />
+ </f:facet>
+
+ <c:forEach begin="0" end="17" step="1" var="i">
+ <h:panelGrid>
+ <a4j:commandButton id="_#{i}" image="queue/examples/resources/button2.gif"
+ style="height:50px;width:50px;"
+ onclick="buttonpush('_#{i}');"
+ oncomplete="buttonpop('_#{i}');"
+ actionListener="#{mojarraBean.process}" />
+ <h:panelGrid cellpadding="5">
+ <h:outputText value="#{i}" style="font-weight:bold"/>
+ </h:panelGrid>
+ </h:panelGrid>
+ </c:forEach>
+ </h:panelGrid>
+ <h:panelGrid>
+ <f:facet name="header">
+ <h:outputText value="Request Queue" styleClass="keytitle" />
+ </f:facet>
+ <table id="queuetable" border="1">
+ <tr id="tr1">
+ </tr>
+ </table>
+ </h:panelGrid>
+ </h:panelGrid>
+
+ </h:form>
+
</ui:composition>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/resources/bgblack18.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/resources/bgblack18.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/resources/button2.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/resources/button2.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/resources/button3.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/resources/button3.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/usage.xhtml 2008-12-08 15:18:10 UTC (rev 11638)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/usage.xhtml 2008-12-08 15:26:58 UTC (rev 11639)
@@ -8,8 +8,16 @@
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
<p>
- DESCRIPTION
+ The <b>Ajax Requests</b> area represent individual Ajax requests that can be fired by clicking the green images (a4j:commandLink components).
+ A <i>JSF managed bean</i> on the server causes a random sleep time (4 seconds or less) to simulate
+ different processing times for each request. The <a4j:queue/> (defined as global
+ for the form where controls placed) handles all the requests and fires next one only after
+ the responce from previous returned.
</p>
+ <p>
+ The demo JavaScript on the client includes a function that subscribes to these queue events, so the UI is updated as queue events happen.<br />
+ Just click on any sequence of green images (any number, any order) and you will see that each request is handled in the order they were fired.
+ </p>
<fieldset class="demo_fieldset">
<legend class="demo_legend">Queue demo</legend>
Added: trunk/samples/richfaces-demo/src/main/webapp/scripts/queueUi.js
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/scripts/queueUi.js (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/scripts/queueUi.js 2008-12-08 15:26:58 UTC (rev 11639)
@@ -0,0 +1,50 @@
+var disabledImage = 'queue/examples/resources/button3.gif';
+var enabledImage = 'queue/examples/resources/button2.gif';
+
+function buttonpush(buttonName) {
+ var button = document.getElementById(buttonName);
+ if (!button.disabled) {
+ button.src = disabledImage;
+ button.disabled = true;
+ }
+ var txt = document.createTextNode(buttonName);
+ addCell(txt);
+}
+
+function buttonpop(buttonName) {
+ var txt = document.createTextNode(buttonName);
+ removeCell(txt);
+}
+
+function addCell(cellData) {
+ var cell = document.getElementById("tr1").insertCell(0);
+ cell.setAttribute("height", "50px");
+ cell.setAttribute("width", "50px");
+ cell.innerHTML = cellData.nodeValue;
+ cell.className = "queueCell";
+}
+
+function removeCell(cellData) {
+ var row = document.getElementById("tr1");
+ var cells = row.getElementsByTagName("td");
+ if (typeof cells != 'undefined' || cells != null) {
+ for (var i=0; i<cells.length; i++) {
+ if (cells[i].firstChild.nodeValue == cellData.nodeValue) {
+ row.deleteCell(i);
+ var button = document.getElementById(cellData.nodeValue);
+ button.disabled = false;
+ button.src = enabledImage;
+ break;
+ }
+ }
+ }
+}
+
+function errorMsg(eventName, data) {
+ alert("Name: "+eventName+" Error Status: "+data.statusMessage);
+}
+
+// Listen for all queue events
+//OpenAjax.hub.subscribe("javax.faces.Event.**",msg);
+// Listen for all error events
+//OpenAjax.hub.subscribe("javax.faces.Error.**",errorMsg);
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r11638 - trunk/ui/message/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-08 10:18:10 -0500 (Mon, 08 Dec 2008)
New Revision: 11638
Modified:
trunk/ui/message/src/main/config/component/message.xml
Log:
https://jira.jboss.org/jira/browse/RF-5094
Modified: trunk/ui/message/src/main/config/component/message.xml
===================================================================
--- trunk/ui/message/src/main/config/component/message.xml 2008-12-08 14:44:09 UTC (rev 11637)
+++ trunk/ui/message/src/main/config/component/message.xml 2008-12-08 15:18:10 UTC (rev 11638)
@@ -255,9 +255,13 @@
The attribute takes a value-binding expression for a component property of a backing bean
</description>
</property>
-
+
&ui_component_attributes;
&ajax_output_attributes;
+ <property hidden="true">
+ <name>keepTransient</name>
+ <classname>boolean</classname>
+ </property>
</component>
<component>
@@ -529,9 +533,13 @@
The attribute takes a value-binding expression for a component property of a backing bean
</description>
</property>
-
&ui_component_attributes;
&ajax_output_attributes;
+ <property hidden="true">
+ <name>keepTransient</name>
+ <classname>boolean</classname>
+ </property>
+
</component>
</components>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r11637 - trunk/ui/core/src/main/java/org/ajax4jsf/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-08 09:44:09 -0500 (Mon, 08 Dec 2008)
New Revision: 11637
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIQueue.java
Log:
TODO done
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIQueue.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIQueue.java 2008-12-08 14:43:40 UTC (rev 11636)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIQueue.java 2008-12-08 14:44:09 UTC (rev 11637)
@@ -33,7 +33,6 @@
*/
public abstract class UIQueue extends UIComponentBase {
- //TODO move to appropriate place
public static final String GLOBAL_QUEUE_NAME = "org.richfaces.queue.global";
public static final String COMPONENT_TYPE = "org.ajax4jsf.Queue";
17 years, 5 months
JBoss Rich Faces SVN: r11636 - trunk/framework/impl/src/main/javascript/ajaxjsf.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-08 09:43:40 -0500 (Mon, 08 Dec 2008)
New Revision: 11636
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/queue.js
Log:
Queue: clearing on window unload implemented
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/queue.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/queue.js 2008-12-08 14:43:06 UTC (rev 11635)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/queue.js 2008-12-08 14:43:40 UTC (rev 11636)
@@ -1,14 +1,5 @@
-//TODO observe unload
-//unload
-
A4J.AJAX._eventQueues = {};
-var extend = function(target, source) {
- for (var property in source) {
- target[property] = source[property];
- }
-};
-
//queue constructor
A4J.AJAX.EventQueue = function() {
var DROP_NEW = 'dropNew';
@@ -16,6 +7,12 @@
var FIRE_NEW = 'fireNew';
var FIRE_NEXT = 'fireNext';
+ var extend = function(target, source) {
+ for (var property in source) {
+ target[property] = source[property];
+ }
+ };
+
var extendOptions = function(options) {
var opts = {};
@@ -69,6 +66,9 @@
abort: function() {
if (this.request) {
+ //tell request not to notify queue after its processing finished
+ //request.queue = undefined
+ //is not ok for this case because user might want to obtain queue in any event handler
this.request.shouldNotifyQueue = false;
this.request.abort();
this.request = undefined;
@@ -107,6 +107,14 @@
}
},
+ clearEntry: function() {
+ this.stopTimer();
+ if (this.request) {
+ this.request.shouldNotifyQueue = false;
+ this.request = undefined;
+ }
+ },
+
getEventsCount: function() {
return this.eventsCount;
},
@@ -137,6 +145,8 @@
LOG.debug("Queue '" + this.name + "' will submit request NOW");
var req = firstItem.submit();
+
+ //see entry.abort() method for more details about this assignment
req.shouldNotifyQueue = true;
if (this.requestOptions.queueonsubmit) {
@@ -280,6 +290,15 @@
LOG.debug("There are " + this.items.length + " requests more in this queue");
this.submitFirst();
+ },
+
+ clear: function() {
+ var length = this.items.length;
+ for ( var i = 0; i < this.items.length; i++) {
+ this.items[i].clearEntry();
+ }
+
+ this.items.splice(0, length);
}
});
@@ -292,6 +311,10 @@
return A4J.AJAX._eventQueues[name];
};
+A4J.AJAX.EventQueue.getQueues = function() {
+ return A4J.AJAX._eventQueues;
+};
+
A4J.AJAX.EventQueue.addQueue = function(queue) {
var name = queue.name;
@@ -304,6 +327,12 @@
};
A4J.AJAX.EventQueue.removeQueue = function(name) {
+ var queue = A4J.AJAX._eventQueues[name];
+
+ if (queue) {
+ queue.clear();
+ }
+
delete A4J.AJAX._eventQueues[name];
};
@@ -373,4 +402,20 @@
return queue;
}
-}();
\ No newline at end of file
+}();
+
+(function () {
+ var observer = function() {
+ var queues = A4J.AJAX.EventQueue.getQueues();
+ for (var queueName in queues) {
+ var queue = queues[queueName];
+ queue.clear();
+ }
+ };
+
+ if (window.addEventListener) {
+ window.addEventListener("unload", observer, false);
+ } else {
+ window.attachEvent("onunload", observer);
+ }
+})();
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r11635 - trunk/framework/impl/src/main/javascript/ajaxjsf.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-08 09:43:06 -0500 (Mon, 08 Dec 2008)
New Revision: 11635
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
Fixed possible memory leaks in Ajax script
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-12-08 14:38:05 UTC (rev 11634)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-12-08 14:43:06 UTC (rev 11635)
@@ -55,9 +55,13 @@
if(window.document.documentElement != _this._documentElement){
LOG.warn("Page for current request have been unloaded - abort processing" );
_this.abort();
+ _this = undefined;
return;
};
- if(_this._aborted){return;};
+ if(_this._aborted){
+ _this = undefined;
+ return;
+ };
LOG.debug("Reqest state : "+_this._request.readyState );
if (_this._request.readyState == 4 ) {
LOG.debug("Reqest end with state 4");
17 years, 5 months
JBoss Rich Faces SVN: r11634 - trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-08 09:38:05 -0500 (Mon, 08 Dec 2008)
New Revision: 11634
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
Log:
fix setValue in save() method
Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-12-08 14:09:12 UTC (rev 11633)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-12-08 14:38:05 UTC (rev 11634)
@@ -298,8 +298,8 @@
save : function(e) {
if (this.invokeEvent(this.events.onviewactivation, this.inplaceInput, "rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
- var userValue = {value:this.tempValueKeeper.value};
- this.setValue(e,userValue);
+ var userValue = this.tempValueKeeper.value;
+ this.setValue(userValue);
if (this.events.onviewactivated) {
this.inplaceInput.fire("rich:onviewactivated", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value});
}
17 years, 5 months