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()" />
16 years, 1 month
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;
}
16 years, 1 month
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;
16 years, 1 month
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>
16 years, 1 month
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;">
16 years, 1 month
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>
16 years, 1 month
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>
16 years, 1 month
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;
16 years, 1 month
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;
}
16 years, 1 month