JBoss Rich Faces SVN: r5816 - trunk/test-applications/facelets/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: viktor_volkov
Date: 2008-02-05 07:56:29 -0500 (Tue, 05 Feb 2008)
New Revision: 5816
Modified:
trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml
Log:
default locale is set to en
Modified: trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml 2008-02-05 12:45:46 UTC (rev 5815)
+++ trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml 2008-02-05 12:56:29 UTC (rev 5816)
@@ -2,6 +2,11 @@
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
+<application>
+ <locale-config>
+ <default-locale>en</default-locale>
+ </locale-config>
+</application>
<navigation-rule>
<from-view-id>/pages/main.xhtml</from-view-id>
<navigation-case>
16 years, 3 months
JBoss Rich Faces SVN: r5815 - in trunk/sandbox/samples/fileUploadDemo: src/main/webapp and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-05 07:45:46 -0500 (Tue, 05 Feb 2008)
New Revision: 5815
Added:
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index2.jsp
Modified:
trunk/sandbox/samples/fileUploadDemo/pom.xml
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/index.jsp
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.jsp
Log:
Modified: trunk/sandbox/samples/fileUploadDemo/pom.xml
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/pom.xml 2008-02-05 12:45:27 UTC (rev 5814)
+++ trunk/sandbox/samples/fileUploadDemo/pom.xml 2008-02-05 12:45:46 UTC (rev 5815)
@@ -12,7 +12,7 @@
<version>3.2.0-SNAPSHOT</version>
<dependencies>
<dependency>
- <groupId>org.richfaces.ui</groupId>
+ <groupId>org.richfaces.sandbox.ui</groupId>
<artifactId>fileUpload</artifactId>
<version>3.2.0-SNAPSHOT</version>
</dependency>
@@ -20,7 +20,12 @@
<groupId>org.richfaces.ui</groupId>
<artifactId>core</artifactId>
<version>3.2.0-SNAPSHOT</version>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>progressBar</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
<build>
<finalName>fileUploadDemo</finalName>
Modified: trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/web.xml 2008-02-05 12:45:27 UTC (rev 5814)
+++ trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/web.xml 2008-02-05 12:45:46 UTC (rev 5815)
@@ -10,18 +10,33 @@
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
- <!--
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_STYLE</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <!--
-->
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
+
<filter>
<display-name>FileUpload Filter</display-name>
<filter-name>fileUpload</filter-name>
<filter-class>org.richfaces.org.jboss.seam.web.MultipartFilter</filter-class>
+ <init-param>
+ <param-name>createTempFiles</param-name>
+ <param-value>true</param-value>
+ </init-param>
</filter>
+
<filter-mapping>
<filter-name>fileUpload</filter-name>
<servlet-name>Faces Servlet</servlet-name>
@@ -30,6 +45,7 @@
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
+
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
<servlet-name>Faces Servlet</servlet-name>
Modified: trunk/sandbox/samples/fileUploadDemo/src/main/webapp/index.jsp
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/src/main/webapp/index.jsp 2008-02-05 12:45:27 UTC (rev 5814)
+++ trunk/sandbox/samples/fileUploadDemo/src/main/webapp/index.jsp 2008-02-05 12:45:46 UTC (rev 5815)
@@ -5,7 +5,7 @@
<head></head>
<body>
- <jsp:forward page="/pages/index.jsf" />
+ <jsp:forward page="/pages/index2.jsf" />
</body>
</html>
\ No newline at end of file
Modified: trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.jsp 2008-02-05 12:45:27 UTC (rev 5814)
+++ trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.jsp 2008-02-05 12:45:46 UTC (rev 5815)
@@ -1,16 +1,30 @@
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/ui/fileUpload" prefix="fu"%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/ui/fileUpload"
+ prefix="fu"%>
<html>
- <head>
- <title></title>
- </head>
- <body>
- <f:view>
- <h:form enctype="multipart/form-data" >
- <fu:fileUpload binding="#{bean.fileUpload}" onclick="window.status=this.value"/>
- <h:commandButton type="submit" action="#{bean.printFile}"></h:commandButton>
- </h:form>
- </f:view>
- </body>
-</html>
+<head>
+<title></title>
+</head>
+<body>
+<script language="javascript"><!--
+function loader_end() {
+alert("lll");
+}
+//-->
+</script>
+<div style="display: none;"><iframe name="loader"
+ onload="loader_end()"></iframe></div>
+
+<f:view>
+ <h:form target="loader" enctype="multipart/form-data">
+ <fu:fileUpload binding="#{bean.fileUpload}"
+ onclick="window.status=this.value" />
+ <br />
+ <h:commandButton action="#{bean.printFile}" value="Submit"></h:commandButton>
+ <a4j:commandButton action="#{bean.printFile}" value="Submit"></a4j:commandButton>
+ </h:form>
+</f:view>
+</body>
+</html>
Added: trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index2.jsp
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index2.jsp (rev 0)
+++ trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index2.jsp 2008-02-05 12:45:46 UTC (rev 5815)
@@ -0,0 +1,24 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/ui/fileUpload"
+ prefix="fu"%>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/ui/progressBar" prefix="progressBar" %>
+<html>
+<head>
+<title></title>
+</head>
+<body>
+<f:view>
+<h:form>
+<fu:fileUpload>
+ <f:facet name="progress">
+ <progressBar:progressBar style="height: 10px; width: 300px;">
+ </progressBar:progressBar>
+ </f:facet>
+</fu:fileUpload><br/>
+<h:commandButton value="Submit"></h:commandButton>
+</h:form>
+</f:view>
+</body>
+</html>
16 years, 3 months
JBoss Rich Faces SVN: r5814 - in trunk/sandbox/ui/fileUpload/src/main: java/org/richfaces/org/jboss/seam/ui/renderkit and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-05 07:45:27 -0500 (Tue, 05 Feb 2008)
New Revision: 5814
Modified:
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/FileItem.java
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/UIFileUpload.java
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java
trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss
trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload3.jspx
Log:
Modified: trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/FileItem.java
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/FileItem.java 2008-02-05 12:38:47 UTC (rev 5813)
+++ trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/FileItem.java 2008-02-05 12:45:27 UTC (rev 5814)
@@ -17,7 +17,7 @@
public class FileItem {
/** Defines list of statuses available */
- public static enum Status {ADDED, MARKED_4_UPLOAD, IN_PROGRESS, UPLOADED};
+ public static enum Status {ADDED, MARKED_4_UPLOAD, IN_PROGRESS, UPLOADED, CANCELLED};
/** Pattern to search file name in full file name string */
private static final Pattern pattern = Pattern.compile
Modified: trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/UIFileUpload.java
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/UIFileUpload.java 2008-02-05 12:38:47 UTC (rev 5813)
+++ trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/UIFileUpload.java 2008-02-05 12:45:27 UTC (rev 5814)
@@ -181,12 +181,12 @@
@Override
public Object saveState(FacesContext context) {
if (values == null) {
- values = new Object[4];
+ values = new Object[3];
}
values[0] = super.saveState(context);
values[1] = fileItems;
values[2] = uploadStatus;
- values[3] = progressBar;
+ //values[3] = this.getFacet("progress");
return values;
}
@@ -202,10 +202,9 @@
super.restoreState(context, values[0]);
fileItems = (List<FileItem>) values[1];
uploadStatus = (String) values[2];
- if (values[3] != null) {
- progressBar = (UIComponent)values[3];
- }
-
+// if (values[3] != null) {
+// this.getFacets().put("progress", (UIComponent)values[3]);
+// }
}
/**
Modified: trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java 2008-02-05 12:38:47 UTC (rev 5813)
+++ trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java 2008-02-05 12:45:27 UTC (rev 5814)
@@ -4,6 +4,7 @@
import java.io.Writer;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
@@ -32,23 +33,41 @@
import org.richfaces.org.jboss.seam.web.MultipartRequest;
import org.richfaces.renderkit.TemplateEncoderRendererBase;
+/**
+ * Class provides base renderer for upload file component
+ * @author "Andrey Markavtsov"
+ *
+ */
public abstract class FileUploadRendererBase extends
TemplateEncoderRendererBase {
+ /** Add file action name */
private static final String ACTION_ADD_FILE = "add";
+ /** Upload all files action name */
private static final String ACTION_UPLOAD_ALL = "uploadall";
+ /** Upload file action name */
private static final String ACTION_UPLOAD = "upload";
+ /** Clear file action name */
private static final String ACTION_CLEAR_FILE = "clear";
+ /** Clear all files action name */
private static final String ACTION_CLEAR_ALL = "clearall";
+
+ /** Stop file uploading action name */
+ private static final String ACTION_STOP_FILE = "stop";
+ /** File name parameter name */
private static final String FILE_NAME_PARAMETER = "fileName";
+ /** Session bean name to store the percent value of uploading process */
public static final String _percentBeanName = "__percentValue$";
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.renderkit.RendererBase#doDecode(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
@Override
protected void doDecode(FacesContext context, UIComponent component) {
UIFileUpload fileUpload = (UIFileUpload) component;
@@ -59,9 +78,8 @@
Map<String, String[]> params = context.getExternalContext()
.getRequestParameterValuesMap();
- if (params.containsKey(getProgressBarParameterName(fileUpload))) {
- new AjaxEvent(fileUpload.getProgressBar());
- }
+ new AjaxEvent(component).queue();
+
if (params.containsKey(getActionParameterName(clientId))) {
processEvents(context, component, clientId);
AjaxContext ajaxContext = AjaxContextImpl
@@ -104,42 +122,10 @@
@Override
public void encodeBegin(FacesContext context, UIComponent component)
throws IOException {
- // Map<String, String[]> params = context.getExternalContext()
- // .getRequestParameterValuesMap();
- // ServletRequest request = (ServletRequest)
- // context.getExternalContext()
- // .getRequest();
- //
- // if (!params.containsKey("action")
- // && !(request instanceof MultipartRequest)) {
- // return;
- // }
- //
- // super.encodeBegin(context, component);
- // UIFileUpload fileUpload = (UIFileUpload) component;
- // String status = fileUpload.getUploadStatus();
- // boolean isAll2reRender = true;
- // if ("ADD".equals(action)) {
- // isAll2reRender = false;
- // } else if ("CLEARALL".equals(action)) {
- // if (UIFileUpload.UPLOADING.equals(status)) {
- // isAll2reRender = true;
- // } else {
- // isAll2reRender = false;
- // }
- // } else if ("UPLOAD".equals(action)) {
- // isAll2reRender = false;
- // } else if ("CLEAR".equals(action)) {
- // isAll2reRender = false;
- // } else if ("UPDATE".equals(action)) {
- // isAll2reRender = false;
- // }
- //
AjaxContext ajaxContext = AjaxContextImpl.getCurrentInstance();
ajaxContext.removeRenderedArea(component.getClientId(context));
ajaxContext.addRenderedArea(component.getClientId(context)
+ ":fileItems");
-
}
public String encodeStatus(UIFileUpload fileUpload) {
@@ -163,28 +149,14 @@
Iterator<FileItem> it = fileUpload.getFileItems().iterator();
while (it.hasNext()) {
FileItem item = it.next();
- if (item.getFileName().equals(name)) {
+ if (item.getFullFileName().equals(name)) {
return item;
}
}
return null;
}
- // public String getFile2Upload(FacesContext context, UIComponent component)
- // {
- // UIFileUpload fileUpload = (UIFileUpload) component;
- // if (UIFileUpload.UPLOADING.equals(fileUpload.getUploadStatus())) {
- // Iterator<FileItem> it = fileUpload.getFileItems().iterator();
- // while (it.hasNext()) {
- // FileItem item = it.next();
- // if (item.getStatus() == FileItem.Status.IN_PROGRESS) {
- // return item.getFullFileName();
- // }
- // }
- // }
- // return "";
- // }
-
+
public String getActionUrl(FacesContext context) {
AjaxContext ajaxContext = AjaxContextImpl.getCurrentInstance(context);
return ajaxContext.getAjaxActionURL(context);
@@ -246,11 +218,13 @@
} else if (ACTION_UPLOAD_ALL.equals(action)) {
processUploadAllAction(context, fileUpload);
} else if (ACTION_CLEAR_ALL.equals(action)) {
- fileUpload.getFileItems().clear();
+ processClearAllAction(fileUpload);
} else if (ACTION_CLEAR_FILE.equals(action)) {
processClearAction(context, fileUpload, params);
} else if (ACTION_UPLOAD.equals(action)) {
processUploadAction(context, fileUpload);
+ } else if (ACTION_STOP_FILE.equals(action)) {
+ processStopFileAction(context, fileUpload, params);
}
}
@@ -264,22 +238,33 @@
}
}
}
+
+ private void processStopFileAction(FacesContext context,
+ UIFileUpload fileUpload, Map<String, String[]> params) {
+ if (params.containsKey(ACTION_STOP_FILE)) {
+ String[] fileNames = params.get(ACTION_STOP_FILE);
+ for (String name : fileNames) {
+ FileItem item = getFileByName(fileUpload, name);
+ if (item != null) {
+ item.setStatus(FileItem.Status.CANCELLED);
+ }
+ }
+ }
+ }
- // private UIComponent getProgressBar(FacesContext context,
- // UIComponent fileUpload) {
- // // return fileUpload.getFacet("progress");
- // UIComponent progressBar = fileUpload.getFacet("progress");
- // if (progressBar != null) {
- // String exprStr = "#{" + _percentBeanName + "}";
- // ValueExpression ex = context.getApplication()
- // .getExpressionFactory().createValueExpression(
- // context.getELContext(), exprStr, Integer.class);
- // progressBar.setValueExpression("value", ex);
- // progressBar.setId("progressBar");
- // }
- // return progressBar;
- // }
+ private void processClearAllAction(UIFileUpload fileUpload) {
+ List<FileItem> toDelete = new ArrayList<FileItem>();
+ for (FileItem item : fileUpload.getFileItems()) {
+ if (item.getStatus() != FileItem.Status.IN_PROGRESS) {
+ toDelete.add(item);
+ }
+ }
+ for (FileItem item : toDelete) {
+ fileUpload.getFileItems().remove(item);
+ }
+ }
+
private void removeFileItem(String name, UIFileUpload fileUpload) {
Iterator<FileItem> it = fileUpload.getFileItems().iterator();
while (it.hasNext()) {
@@ -303,7 +288,6 @@
}
}
getSession(context).setAttribute(_percentBeanName, 0);
- fileUpload.setUploadStatus(UIFileUpload.UPLOADING);
}
}
@@ -418,10 +402,8 @@
FileItem item = it.next();
if (item.getStatus() == FileItem.Status.IN_PROGRESS) {
found = true;
- StringBuffer buffer = new StringBuffer();
- buffer.append("new FileUpload('");
- buffer.append(cliendId);
- buffer.append("').upload('");
+ StringBuffer buffer = getJSScriptStart(cliendId);
+ buffer.append(".upload('");
buffer.append(convertFileName(item.getFullFileName()));
buffer.append("');");
writer.write(buffer.toString());
@@ -430,11 +412,11 @@
}
}
} else {
- StringBuffer buffer = new StringBuffer();
- buffer.append("A4J.AJAX.StopPoll(FileUpload.Uploaders['");
- buffer.append(cliendId);
- buffer.append("']['formId'] + ':progressBar');\n");
- writer.write(buffer.toString());
+// StringBuffer buffer = new StringBuffer();
+// buffer.append("A4J.AJAX.StopPoll(FileUpload.Uploaders['");
+// buffer.append(cliendId);
+// buffer.append("']['formId'] + ':progressBar');\n");
+// writer.write(buffer.toString());
}
}
@@ -483,6 +465,8 @@
writer.write("Done");
} else if (item.getStatus() == FileItem.Status.IN_PROGRESS) {
writer.write("In progress....");
+ } else if (item.getStatus() == FileItem.Status.CANCELLED) {
+ writer.write("Cancelled");
}
}
@@ -493,8 +477,12 @@
renderChild(context, progressBar);
}
}
+
+ public boolean isCanClear (FileItem item) {
+ return item.getStatus() != FileItem.Status.IN_PROGRESS;
+ }
- private UIComponent findProgressBar(UIFileUpload fileUpload) {
+ private UIComponent findProgressBar(UIComponent fileUpload) {
UIComponent progressBar = null;
for (UIComponent child : fileUpload.getChildren()) {
if (child instanceof UIFileUpload) {
@@ -504,73 +492,102 @@
}
return progressBar;
}
-
- private void addComponentToReRender(FacesContext context, UIComponent component) {
+
+ private void addComponentToReRender(FacesContext context,
+ UIComponent component) {
AjaxContext ajaxContext = AjaxContextImpl.getCurrentInstance(context);
ajaxContext.addComponentToAjaxRender(component);
}
+
+ private UIComponent createProgressBar(FacesContext context,
+ UIComponent fileUpload) {
+ UIComponent progressBar = fileUpload.getFacet("progress");
+ if (null == progressBar) {
+ progressBar = context.getApplication().createComponent(
+ UIProgressBar.COMPONENT_TYPE);
+ }
+ fileUpload.getFacets().put("progress", progressBar);
+ return progressBar;
+ }
private UIComponent getProgressBar(FacesContext context,
UIComponent component) {
- UIFileUpload fileUpload = (UIFileUpload) component;
- UIComponent progressBar = fileUpload.getProgressBar();
- if (progressBar == null) {
- progressBar = context.getApplication().createComponent(
- UIProgressBar.COMPONENT_TYPE);
- String exprStr = "#{" + _percentBeanName + "}";
- ValueExpression ex = context.getApplication()
- .getExpressionFactory().createValueExpression(
- context.getELContext(), exprStr, Integer.class);
- progressBar.setValueExpression("value", ex);
- progressBar.setId("progressBar");
- progressBar.setParent(fileUpload);
- fileUpload.setProgressBar(progressBar);
- /*fileUpload.getChildren().add(progressBar);
- addComponentToReRender(context, progressBar);*/
+ UIComponent progressBar = component.getFacet("progress");
+ if (null == progressBar) {
+ progressBar = createProgressBar(context, component);
}
+ String exprStr = "#{" + _percentBeanName + "}";
+ ValueExpression ex = context.getApplication().getExpressionFactory()
+ .createValueExpression(context.getELContext(), exprStr,
+ Integer.class);
+ progressBar.setValueExpression("value", ex);
+ progressBar.setId("progressBar");
+ progressBar.setTransient(false);
+
return progressBar;
}
+
+ private StringBuffer getJSScriptStart(String clientId) {
+ StringBuffer buffer = new StringBuffer("new FileUpload('");
+ buffer.append(clientId).append("')");
+ return buffer;
+ }
public String getUploadAllClick(FacesContext context, UIComponent component) {
String clientId = component.getClientId(context);
-
Map parameters = new HashMap();
parameters.put(getActionParameterName(clientId), ACTION_UPLOAD_ALL);
-
return getOnClick(context, component, clientId, parameters, null);
-
}
+
+ public String getStopFileClick(FacesContext context, UIComponent component) {
+ String clientId = component.getClientId(context);
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(
+ this, component);
+ String fileName = (String) variables.getVariable("fullFileName");
+ Map parameters = new HashMap();
+ parameters.put(getActionParameterName(clientId), ACTION_STOP_FILE);
+ parameters.put(ACTION_STOP_FILE, fileName);
+ return getOnClick(context, component, clientId, parameters, null);
+ }
public String getClearFileClick(FacesContext context, UIComponent component) {
String clientId = component.getClientId(context);
-
+ StringBuffer buffer = new StringBuffer();
ComponentVariables variables = ComponentsVariableResolver.getVariables(
this, component);
String fileName = (String) variables.getVariable("fullFileName");
- StringBuffer body = new StringBuffer();
- body.append("new FileUpload('");
- body.append(clientId);
- body.append("').clear('");
- body.append(convertFileName(fileName));
- body.append("');");
+ StringBuffer body = getJSScriptStart(clientId)
+ .append(".clear('")
+ .append(convertFileName(fileName))
+ .append("');");
Object oncomplete = getOnComplete(context, component, body);
Map parameters = new HashMap();
parameters.put(getActionParameterName(clientId), ACTION_CLEAR_FILE);
parameters.put(ACTION_CLEAR_FILE, fileName);
-
+
return getOnClick(context, component, clientId, parameters, oncomplete);
}
+
+ public String getClearAllClick(FacesContext context, UIComponent component) {
+ String clientId = component.getClientId(context);
+ StringBuffer body = getJSScriptStart(clientId)
+ .append(".clearAll();");
+ Object oncomplete = getOnComplete(context, component, body);
+ Map parameters = new HashMap();
+ parameters.put(getActionParameterName(clientId), ACTION_CLEAR_ALL);
+ return getOnClick(context, component, clientId, parameters, oncomplete);
+ }
+
public String getAddFileClick(FacesContext context, UIComponent component) {
String clientId = component.getClientId(context);
- StringBuffer body = new StringBuffer();
- body.append("new FileUpload('");
- body.append(clientId);
- body.append("').addFile();");
+ StringBuffer body = getJSScriptStart(clientId)
+ .append(".addFile();");
Object oncomplete = getOnComplete(context, component, body);
Map parameters = new HashMap();
@@ -599,7 +616,7 @@
return script.toString();
}
- public JSFunctionDefinition getOnComplete(FacesContext context,
+ private JSFunctionDefinition getOnComplete(FacesContext context,
UIComponent component, Object body) {
JSFunctionDefinition oncomplete = new JSFunctionDefinition();
oncomplete.addParameter("request");
@@ -609,80 +626,6 @@
return oncomplete;
}
- // public void encodeAddControl(FacesContext context, UIComponent component)
- // throws IOException {
- // ResponseWriter writer = context.getResponseWriter();
- // StringBuffer buffer = new StringBuffer();
- // buffer.append("<div class='upload_button_border' style=' float:left'><div
- // class='upload_button upload_font'
- // onmouseover=\\\"this.className='upload_button_light upload_font'\\\"
- // onmousedown=\\\"this.className='upload_button_press upload_font'\\\"
- // onmouseup=\\\"this.className='upload_button upload_font'\\\"
- // onmouseout=\\\"this.className='upload_button upload_font'\\\"
- // style='position: relative; overflow: hidden; direction: rtl;
- // width:70px'><div class='upload_button_content upload_font upload_ico
- // upload_ico_add'>Add...</div><input type='file' ");
- // buffer.append("onchange=\\\"");
- // buffer.append(getActionOnClick(context, component, "ADD", "false"));
- // buffer.append("\\\"");
- // buffer.append(" style='cursor: pointer; z-index: 3; width: 0px; height:
- // 22px; left: 0px; top: 0px; position: absolute'
- // class='hidden'/></div></div>");
- // writer.write(buffer.toString());
- // }
- //
- // public void encodeUploadControl(FacesContext context, UIComponent
- // component)
- // throws IOException {
- // ResponseWriter writer = context.getResponseWriter();
- // StringBuffer buffer = new StringBuffer();
- // String clientId = component.getClientId(context);
- // buffer.append("<div class='upload_button_border' style='
- // float:left;'><div class='upload_button upload_font'
- // onmouseover=\\\"this.className='upload_button_light upload_font'\\\"
- // onmousedown=\\\"this.className='upload_button_press upload_font'\\\"
- // onmouseup=\\\"this.className='upload_button upload_font'\\\"
- // onmouseout=\\\"this.className='upload_button upload_font'\\\"><a href='#'
- // class='upload_button_selection'><div class='upload_button_content
- // upload_font upload_ico
- // upload_ico_start'><b>Upload</b></div></a></div></div>");
- // writer.write(buffer.toString());
- // }
- //
- // public void encodeCleanControl(FacesContext context, UIComponent
- // component)
- // throws IOException {
- // ResponseWriter writer = context.getResponseWriter();
- // StringBuffer buffer = new StringBuffer();
- // String clientId = component.getClientId(context);
- // buffer.append("<div class='upload_button_border' style='
- // float:right'><div class='upload_button upload_font'
- // onmouseover=\\\"this.className='upload_button_light upload_font'\\\"
- // onmousedown=\\\"this.className='upload_button_press upload_font'\\\"
- // onmouseup=\\\"this.className='upload_button upload_font'\\\"
- // onmouseout=\\\"this.className='upload_button upload_font'\\\"><a href='#'
- // class='upload_button_selection'><div class='upload_button_content
- // upload_font upload_ico upload_ico_clear'>Clear
- // All</div></a></div></div>");
- // writer.write(buffer.toString());
- // }
-
- // private String convertToString(Object obj) {
- // return (obj == null ? "" : obj.toString());
- // }
- //
- // private String convertToString(boolean b) {
- // return String.valueOf(b);
- // }
- //
- // private String convertToString(int b) {
- // return b != Integer.MIN_VALUE ? String.valueOf(b) : "";
- // }
- //
- // private String convertToString(long b) {
- // return b != Long.MIN_VALUE ? String.valueOf(b) : "";
- // }
-
/*
* (non-Javadoc)
*
Modified: trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss 2008-02-05 12:38:47 UTC (rev 5813)
+++ trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss 2008-02-05 12:45:27 UTC (rev 5814)
@@ -11,7 +11,7 @@
.upload_font{font-family : verdana /*generalFamilyFont*/ ; font-size : 11px/*generalSizeFont*/;}
table{width : 100%}
-#upload_table td{border-bottom:1px solid #c0c0c0 /*tableBorderColor*/;white-space : nowrap;}
+.upload_table_td{border-bottom:1px solid #c0c0c0 /*tableBorderColor*/;white-space : nowrap;}
.upload_list_width{ width:400px;}
.upload_list_decor{ border:1px solid #c0c0c0 /*tableBorderColor*/; background : #FFFFFF /*tableBackgroundColor*/;}
@@ -24,23 +24,17 @@
.upload_toolbar_decor{ background : #EAF0F8 /*additionalBackgroundColor*/;border-bottom:1px solid #c0c0c0 /*tableBorderColor*/;border-top:1px solid #FFFFFF /*tableBackgroundColor*/;border-left:1px solid #FFFFFF /*tableBackgroundColor*/;padding : 2px}
-.upload_bar_exterior{height : 7px; border : 1px solid #c0c0c0 /*panelBorderColor*/;}
-.upload_bar_uploaded{height : 7px; width : 70%; height : 100%; background : #FF9409 /**/; background-image : url(images/bg_ProgressBar_perm.gif);background-repeat : repeat-x; font-size : 0px;}
-.upload_bar_deleted{height : 7px; width : 40%; height : 100%; background : #FF9409 /**/; background-image : url(images/bg_RegressBar_perm.gif);background-repeat : repeat-x; font-size : 0px;}
-.upload_bar_shell{height : 7px; width : 100%; height : 8; background : #F1F1F1/*tableSubfooterBackgroundColor*/;}
-
-
.upload_button_border{
border : 1px solid #C0C0C0; /*tableBorderColor*/
margin : 2px;
}
.upload_button{
- background : url(images/bg_header.png) /*from additionalBackgroundColor to trimColor*/ top left #C6D6EA /*trimColor*/ repeat-x;
+ background-repeat: repeat x top left #C6D6EA;
cursor : pointer;
padding : 2px;
}
.upload_button_light{
- background : url(images/bg_header.png) /*from additionalBackgroundColor to headerGradientColor*/ top left #C6D6EA /*trimColor*/ repeat-x;
+ background-repeat: repeat x top left #C6D6EA;
border : 1px solid #E79A00; /*selectControlColor*/
cursor : pointer;
padding : 1px;
@@ -50,8 +44,9 @@
border : 1px solid #C0C0C0; /*tableBorderColor*/
margin-bottom : 3px;
padding : 1px}
+
.upload_button_press{
- background : url(images/bg_press.png) /*from additionalBackgroundColor to trimColor*/ top left repeat-x #EAF0F8; /* additionalBackgroundColor*/
+ background-repeat: repeat x top left #EAF0F8;
border : 1px solid #E79A00; /*selectControlColor*/
padding : 2px 0px 0px 2px;
}
@@ -73,10 +68,10 @@
.upload_name_padding{padding : 2px 0px 2px 0px;}
.upload_ico{background-position : 0px 50%; background-repeat : no-repeat; padding-left : 19px}
-.upload_ico_add{background-image : url(images/ico_add.gif)}
-.upload_ico_start{background-image : url(images/ico_start.gif)}
-.upload_ico_stop{background-image : url(images/ico_stop.gif)}
-.upload_ico_clear{background-image : url(images/ico_clear.gif)}
+.upload_ico_add{}
+.upload_ico_start{}
+.upload_ico_stop{}
+.upload_ico_clear{}
input.hidden {
Z-INDEX: 2;
@@ -89,5 +84,46 @@
]]>
</f:verbatim>
+<u:selector name=".upload_button">
+ <u:style name="background-image">
+ <f:resource f:key="/org/richfaces/renderkit/html/images/bg_header.png" />
+ </u:style>
+</u:selector>
+
+<u:selector name=".upload_button_light">
+ <u:style name="background-image">
+ <f:resource f:key="/org/richfaces/renderkit/html/images/bg_header.png" />
+ </u:style>
+</u:selector>
+
+<u:selector name=".upload_button_press">
+ <u:style name="background-image">
+ <f:resource f:key="/org/richfaces/renderkit/html/images/bg_press.png" />
+ </u:style>
+</u:selector>
+
+<u:selector name=".upload_ico_add">
+ <u:style name="background-image">
+ <f:resource f:key="/org/richfaces/renderkit/html/images/ico_add.gif" />
+ </u:style>
+</u:selector>
+
+<u:selector name=".upload_ico_start">
+ <u:style name="background-image">
+ <f:resource f:key="/org/richfaces/renderkit/html/images/ico_start.gif" />
+ </u:style>
+</u:selector>
+
+<u:selector name=".upload_ico_stop">
+ <u:style name="background-image">
+ <f:resource f:key="/org/richfaces/renderkit/html/images/ico_stop.gif" />
+ </u:style>
+</u:selector>
+
+<u:selector name=".upload_ico_clear">
+ <u:style name="background-image">
+ <f:resource f:key="/org/richfaces/renderkit/html/images/ico_clear.gif" />
+ </u:style>
+</u:selector>
</f:template>
Modified: trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-02-05 12:38:47 UTC (rev 5813)
+++ trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-02-05 12:45:27 UTC (rev 5814)
@@ -11,9 +11,9 @@
}
},
renderControl: function (template, context) {
- if (!template) {
- return;
- }
+ if (!template) {
+ return;
+ }
var html = template.invoke('getContent', context).join('');
$(this.id + ":header").innerHTML = html;
},
@@ -21,15 +21,7 @@
this.id = id;
this.createForm();
},
- test: function (ev) {
- alert('Done;');
- },
- isUploading: function () {
- if ($(this.id + ":status").value == "uploading") return true;
- return false;
- },
addFile: function (){
- alert($(this.id + ":file"));
var o = $(this.id + ":file");
var parent = o.parentNode;
@@ -45,26 +37,16 @@
this.f.appendChild(o);
parent.appendChild(clon);
-
- $(this.id + ":fileName").value = o.value;
},
addViewState: function () {
- if (!this.fm['javax.faces.ViewState']) {
+ if (!this.fm['javax.faces.ViewState']) {
var d = document.createElement("input");
d.type="hidden";
d.name = "javax.faces.ViewState";
d.value = $("javax.faces.ViewState").value;
this.fm.appendChild(d);
- }
+ }
},
- beforeUploadFile: function(name) {
- $(this.id + ":fileName").value = name;
- },
- beforeUploadAll: function() {
- if (this.getFilesCount() > 0) {
- $(this.id + ":fileName").value = this.f.childNodes[0].value;
- }
- },
upload: function (name) {
var v = this.findFileByName(name);
this.addViewState();
@@ -75,39 +57,6 @@
this.fm.submit();
}
},
- uploadFile: function (name) {
- if (!this.isUploading()) {
- this.addViewState();
- var v = this.findFileByName(name);
- if (v) {
- v.disabled = false;
- v.name = this.id + ":1";
- v.id = v.name;
- this.fm.submit();
- }
- }
- },
- uploadAll: function (name) {
- if (!this.isUploading()) {
- this.addViewState();
- if (!$(this.id + ":1")) {
- this.mark4upload();
- if (name) {
- this.uploadFile(name);
- }
-
- }
- }else {
- this.mark4upload();
- }
- },
- findFileToUpload: function () {
- for (var i = 0; i < this.getFilesCount(); i++) {
- var v = this.f.childNodes[i];
- if (v.name == "4upload") return v;
- }
- return null;
- },
onFileUploaded: function (ev) {
var formId = FileUpload.Uploaders[this.id]['formId'];
var containerId = FileUpload.Uploaders[this.id]['containerId'];
@@ -116,29 +65,17 @@
f[this.id] = this.id;
f[this.id + "_action"] = "upload";
A4J.AJAX.StopPoll(formId + ":progressBar");
- new ProgressBar(this.id + ":progressBar").setValue(100);
+ //new ProgressBar(formId + ":progressBar").setValue(100);
A4J.AJAX.Submit(containerId,formId,ev,{'parameters':f ,'actionUrl':actionUrl} );
},
- getForm: function () {
- var p = $(this.id).parentNode;
- while (p) {
- if (p) {
- if (p.tagName.toUpperCase() == "FORM") {
- return p;
- }
- }
- p = p.parentNode;
- }
- return null;
- },
- createForm: function (){
- if ($(this.id + ":fr")) return;
+ createForm: function () {
+ if ($(this.id + ":fr")) return;
var fr = document.createElement("iframe");
fr.id = this.id + ":fr";
fr.name = fr.id;
fr.style.display="none";
fr.src = "about:blank";
- fr.onload = new Function ("event"," var f = new FileUpload('"+this.id+"'); if (f.getFilesCount() == 0) return; alert('in onload'); f.onFileUploaded(event);");
+ fr.onload = new Function ("event"," var f = new FileUpload('"+this.id+"'); if (f.getFilesCount() == 0) return; f.onFileUploaded(event);");
document.body.appendChild(fr);
@@ -162,7 +99,6 @@
f.appendChild(d);
//--
-
},
getFilesCount: function () {
if (this.f.hasChildNodes()) {
@@ -171,12 +107,61 @@
return 0;
},
clearAll: function() {
- if (this.f && this.f.hasChildNodes && this.f.removeChild) {
- while (this.f.hasChildNodes()) {
- this.f.removeChild(this.f.firstChild);
+ this.removeChilds(this.f);
+ },
+ stop: function () {
+ new ProgressBar(FileUpload.Uploaders[this.id]['formId']+":progressBar").disable();
+ this.fm.reset();
+ var f = $(this.id + ":1");
+ if (f) {
+ f.disable = true;
+ f.id = "add";
+ f.name = f.id;
+ }
+ },
+ removeChilds: function (f) {
+ if (f && f.hasChildNodes && f.removeChild) {
+ while (f.hasChildNodes()) {
+ f.removeChild(f.firstChild);
}
}
},
+ reduceTimeout: function (id, label, style) {
+ var o = $(id);
+ if (o) {
+ this.reduce(o, o.onclick, label, style );
+ }
+ },
+ reduce: function (o, onclick, label , style) {
+ var d = document.createElement("a");
+ d.href = "#";
+ d.innerHTML = label;
+ d.style.cssText = style;
+ d.onclick= onclick;
+ d.onmousedown = function () { return new FileUpload().confirm(this, label, style); }
+ var p = o.parentNode;
+ this.removeChilds(p);
+ p.appendChild(d);
+ },
+ confirm: function (o, label, style, id) {
+ var y = document.createElement("a");
+ y.href = "#";
+ y.innerHTML = "Yes";
+ y.style.cssText = style;
+ y.onclick= o.onclick;
+ y.id = id;
+ var n = document.createElement("a");
+ n.href = "#";
+ n.innerHTML = "No";
+ n.style.cssText = style + "; padding-left: 10px;";
+ n.onclick= function () { new FileUpload().reduce(this, o.onclick, label, style); } ;
+ var p = o.parentNode;
+ this.removeChilds(p);
+ p.appendChild(y);
+ p.appendChild(n);
+ window.setTimeout("new FileUpload().reduceTimeout('"+id+"','"+label+"','"+style+"');",3000);
+ return false;
+ },
findFileByName: function(name) {
for (var i = 0; i < this.getFilesCount(); i++) {
var d = this.f.childNodes[i];
@@ -192,17 +177,5 @@
if (v) {
this.f.removeChild(v);
}
- $(this.id + ":fileName").value = name;
- },
- mark4upload: function() {
- if (this.f && this.f.hasChildNodes && this.f.removeChild) {
- for (var i = 0; i < this.getFilesCount(); i++) {
- var v = this.f.childNodes[i];
- if ((v.name != (this.id + ":1")) && (v.name != "done")) {
- v.name = "4upload";
- v.id = "4upload";
- }
- }
- }
}
});
Modified: trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload3.jspx
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload3.jspx 2008-02-05 12:38:47 UTC (rev 5813)
+++ trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload3.jspx 2008-02-05 12:45:27 UTC (rev 5814)
@@ -49,7 +49,9 @@
</div>
</div>
<div class="upload_button_border" style=" float:right">
- <div class="upload_button upload_font" onmouseover="this.className='upload_button_light upload_font'" onmousedown="this.className='upload_button_press upload_font'" onmouseup="this.className='upload_button upload_font'" onmouseout="this.className='upload_button upload_font'">
+ <div class="upload_button upload_font" onmouseover="this.className='upload_button_light upload_font'" onmousedown="this.className='upload_button_press upload_font'" onmouseup="this.className='upload_button upload_font'"
+ onmouseout="this.className='upload_button upload_font'"
+ onclick="#{this:getClearAllClick(context, component)}">
<a href="#" class="upload_button_selection">
<div class="upload_button_content upload_font upload_ico upload_ico_clear">Clear All</div>
</a>
@@ -64,18 +66,20 @@
<jsp:scriptlet>
<![CDATA[
Iterator<org.richfaces.org.jboss.seam.ui.component.FileItem> it = component.getFileItems().iterator();
+ Integer i = 0;
while (it.hasNext()) {
org.richfaces.org.jboss.seam.ui.component.FileItem item = it.next();
String fullFileName = item.getFullFileName();
String fileName = item.getFileName();
variables.setVariable("fileName",fileName);
variables.setVariable("fullFileName",fullFileName);
+ variables.setVariable("n",i);
]]>
</jsp:scriptlet>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
- <td class="upload_font upload_name">
+ <td class="upload_font upload_name upload_table_td">
<div class="upload_name_padding">
#{fileName}
</div>
@@ -85,8 +89,8 @@
renderProgress(context, component, item);
]]>
</jsp:scriptlet>
+ <br/>
-
<div class="upload_name_padding">
<b>
<jsp:scriptlet>
@@ -99,30 +103,54 @@
</td>
- <td>
- <div class="upload_font upload_del">
- <a href="#" class="upload_anc" onclick="#{this:getClearFileClick(context, component)}">Clear</a>
- </div>
+ <td class="upload_table_td">
+ <jsp:scriptlet>
+ <![CDATA[
+ if (isCanClear(item)) {
+ ]]>
+ </jsp:scriptlet>
+ <div class="upload_font upload_del">
+ <a href="#" class="upload_anc"
+ onmousedown="return new FileUpload().confirm(this,'Clear','text-decoration:none; color:#EAF0F8','#{clientId}:clear#{n}');"
+ onclick="#{this:getClearFileClick(context, component)}"
+ style="text-decoration: none; color:#EAF0F8">Clear</a>
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[
+ } else {
+ ]]>
+ </jsp:scriptlet>
+ <div class="upload_font upload_del">
+ <a href="#" class="upload_anc"
+ onclick="new FileUpload('#{clientId}').stop(); #{this:getStopFileClick(context, component)}">Stop</a>
+ </div>
+
+ <jsp:scriptlet>
+ <![CDATA[
+ }
+ ]]>
+ </jsp:scriptlet>
<div class="upload_font upload_del"><br /></div>
</td>
- <td>
+ <td class="upload_table_td">
<div class="upload_font upload_scroll"></div>
</td>
</tr>
</table>
+ <jsp:scriptlet>
+ <![CDATA[
+ i++;
+ }
+ ]]>
+ </jsp:scriptlet>
+
<span>
<script type="text/javascript">
<f:call name="encodeUploadScript" />
</script>
</span>
- <jsp:scriptlet>
- <![CDATA[
- }
- ]]>
- </jsp:scriptlet>
-
</div>
<span>
16 years, 3 months
JBoss Rich Faces SVN: r5813 - in trunk/sandbox/ui/combobox/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-05 07:38:47 -0500 (Tue, 05 Feb 2008)
New Revision: 5813
Modified:
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
horizontal scrolling is deleted
Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-02-05 11:40:45 UTC (rev 5812)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-02-05 12:38:47 UTC (rev 5813)
@@ -67,7 +67,7 @@
.rich-combobox-list-scroll {
overflow : auto;
- /*overflow-x : hidden;*/
+ overflow-x : hidden;
}
.rich-combobox-list-cord {
Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-02-05 11:40:45 UTC (rev 5812)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-02-05 12:38:47 UTC (rev 5813)
@@ -392,7 +392,6 @@
this.listParent.style.visibility = "hidden";
this.listParent.show();
- this.LAYOUT_WIDTH = this.list.parentNode.scrollWidth;
var el = this.listParent.childNodes[1].firstChild;
this.LAYOUT_BORDER_V = Richfaces.getBorderWidth(el, "tb");
this.LAYOUT_BORDER_H = Richfaces.getBorderWidth(el, "lr");
@@ -504,7 +503,7 @@
if (Prototype.Browser.IE) {
height = parseInt(height) + this.LAYOUT_BORDER_V + this.LAYOUT_PADDING_V;
}
- this.list.parentNode.style.height = height;
+ this.list.style.height = height;
if (this.iframe) {
this.iframe.style.height = height;
}
@@ -522,7 +521,7 @@
this.setWidth(this.width);
},
- setWidth : function(width) {
+ /*setWidth : function(width) {
var positionElem = this.listParent.childNodes[1];
var combobox = this.listParent.parentNode;
combobox.style.width = width;
@@ -548,6 +547,18 @@
this.list.style.width = correction + "px";
+ },*/
+
+ setWidth : function(width) {
+ var positionElem = this.listParent.childNodes[1];
+ var combobox = this.listParent.parentNode;
+ //positionElem.style.width = width;
+ var correction = parseInt(width) - Richfaces.getBorderWidth(positionElem.firstChild, "lr") - Richfaces.getPaddingWidth(positionElem.firstChild, "lr") + "px";
+ this.list.style.width = correction;
+ combobox.style.width = correction;
+ if (this.iframe) {
+ this.iframe.style.width = correction;
+ }
},
setPosition : function(fieldTop, fieldLeft, fieldHeight) {
@@ -578,7 +589,7 @@
scrolling : function(event) {
var increment;
- var scrollElem = this.list.parentNode;
+ var scrollElem = this.list;
var listTop = Richfaces.ComboBoxList.getElemXY(scrollElem).top;
var scrollTop = scrollElem.scrollTop;
var itemTop = Richfaces.ComboBoxList.getElemXY(this.activeItem).top;
@@ -599,7 +610,7 @@
},
scrollingUpToItem : function(item) {
- var scrollElem = this.list.parentNode;
+ var scrollElem = this.list;
var increment = (Richfaces.ComboBoxList.getElemXY(item).top - scrollElem.scrollTop) - Richfaces.ComboBoxList.getElemXY(scrollElem).top;
scrollElem.scrollTop += increment;
},
@@ -612,7 +623,6 @@
this.activeItem = item;
- //this.activeItem.style.width = this.LAYOUT_WIDTH + "px"; //FIXME
this.changeItem(item, this.classes.ITEM.SELECTED);
},
@@ -710,7 +720,7 @@
},
createItem : function(text, className) {
- return "<span class=\"" + className+ "\" style=\"width:" + this.LAYOUT_WIDTH + "px;\">" + text + "</span>";
+ return "<span class=\"" + className+ "\">" + text + "</span>";
},
createIframe : function(parentElem, width, comboboxId, classes) {
Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-02-05 11:40:45 UTC (rev 5812)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-02-05 12:38:47 UTC (rev 5813)
@@ -248,8 +248,8 @@
</table>
</div>
<div id="listPosition#{clientId}" class="rich-combobox-list-position">
- <div id="listDecoration#{clientId}" class="rich-combobox-list-decoration rich-combobox-list-scroll">
- <div id="list#{clientId}">
+ <div id="listDecoration#{clientId}" class="rich-combobox-list-decoration">
+ <div id="list#{clientId}" class="rich-combobox-list-scroll">
<f:call name="encodeItems"/>
</div>
</div>
16 years, 3 months
JBoss Rich Faces SVN: r5812 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-05 06:40:45 -0500 (Tue, 05 Feb 2008)
New Revision: 5812
Modified:
trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml
Log:
http://jira.jboss.com/jira/browse/RF-2158 - done for datascroller
Modified: trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml 2008-02-05 11:40:26 UTC (rev 5811)
+++ trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml 2008-02-05 11:40:45 UTC (rev 5812)
@@ -127,7 +127,7 @@
...
]]></programlisting>
<figure>
- <title><rich:datascroller> controls</title>
+ <title><emphasis role="bold"><property><rich:datascroller></property></emphasis> controls</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/datascroller2.png"/>
@@ -442,7 +442,7 @@
<para>Also it’s possible to change styles of particular <emphasis role="bold"
><property><rich:datascroller></property></emphasis> component. In this case you should create own style classes and use them in corresponding <emphasis role="bold"
- ><property><rich:datascroller></property></emphasis> <emphasis><property>styleClass</property></emphasis> attributes. An example is placed below:</para>
+ ><property><rich:datascroller></property></emphasis> <emphasis role="italic"><property>styleClass</property></emphasis> attributes. An example is placed below:</para>
<para>
<emphasis role="bold">Example:</emphasis>
@@ -452,7 +452,7 @@
background-color: #C6E2FF;
}
...]]></programlisting>
- <para>The <emphasis><property>"styleClass"</property></emphasis> attribute for <emphasis role="bold"
+ <para>The <emphasis role="italic"><property>"styleClass"</property></emphasis> attribute for <emphasis role="bold"
><property><rich:datascroller> </property></emphasis> is defined as it’s shown in the example below:</para>
<para>
@@ -464,7 +464,7 @@
<para>This is a result:</para>
<figure>
- <title>Redefinition styles with own classes and styleClass attributes</title>
+ <title>Redefinition styles with own classes and <emphasis><property>styleClass</property></emphasis> attributes</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/datascroller_CS2.png"/>
16 years, 3 months
JBoss Rich Faces SVN: r5811 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-05 06:40:26 -0500 (Tue, 05 Feb 2008)
New Revision: 5811
Modified:
trunk/docs/userguide/en/src/main/docbook/included/datascroller.desc.xml
Log:
http://jira.jboss.com/jira/browse/RF-2158 - done for datascroller
Modified: trunk/docs/userguide/en/src/main/docbook/included/datascroller.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/datascroller.desc.xml 2008-02-05 11:40:01 UTC (rev 5810)
+++ trunk/docs/userguide/en/src/main/docbook/included/datascroller.desc.xml 2008-02-05 11:40:26 UTC (rev 5811)
@@ -10,7 +10,7 @@
<para>The component designed for providing the functionality of tables scrolling using Ajax
requests.</para>
<figure>
- <title><rich:datascroller> component</title>
+ <title><emphasis role="bold"><property><rich:datascroller></property></emphasis> component</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/datascroller1.png"/>
16 years, 3 months
JBoss Rich Faces SVN: r5810 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-05 06:40:01 -0500 (Tue, 05 Feb 2008)
New Revision: 5810
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dataGrid.xml
Log:
http://jira.jboss.com/jira/browse/RF-2158 - done for datagrid
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataGrid.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataGrid.xml 2008-02-05 11:39:20 UTC (rev 5809)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataGrid.xml 2008-02-05 11:40:01 UTC (rev 5810)
@@ -267,7 +267,7 @@
<para>This is a result:</para>
<figure>
- <title>Redefinition styles with own classes and styleClass attributes</title>
+ <title>Redefinition styles with own classes and <emphasis><property>styleClass</property></emphasis> attributes</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/dataGridStyle.png"/>
@@ -275,7 +275,7 @@
</mediaobject>
</figure>
- <para>As it could be seen on the picture above, the font style for colums was changed.</para>
+ <para>As it could be seen on the picture above, the font style for columns was changed.</para>
</section>
<section>
<title>Relevant Resources Links</title>
16 years, 3 months
JBoss Rich Faces SVN: r5809 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-05 06:39:20 -0500 (Tue, 05 Feb 2008)
New Revision: 5809
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dataGrid.desc.xml
Log:
http://jira.jboss.com/jira/browse/RF-2158 - done for datagrid
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataGrid.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataGrid.desc.xml 2008-02-05 11:38:49 UTC (rev 5808)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataGrid.desc.xml 2008-02-05 11:39:20 UTC (rev 5809)
@@ -10,7 +10,7 @@
<para>The component to render data as a grid that allows choosing data from a model
and obtains built-in support of Ajax updates.</para>
<figure>
- <title><rich:dataGrid> component</title>
+ <title><emphasis role="bold"><property><rich:dataGrid></property></emphasis> component</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/datagrid1.png"/>
16 years, 3 months
JBoss Rich Faces SVN: r5808 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-05 06:38:49 -0500 (Tue, 05 Feb 2008)
New Revision: 5808
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dataFilterSlider.desc.xml
Log:
http://jira.jboss.com/jira/browse/RF-2158 - done for datafilterslider
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataFilterSlider.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataFilterSlider.desc.xml 2008-02-05 11:38:02 UTC (rev 5807)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataFilterSlider.desc.xml 2008-02-05 11:38:49 UTC (rev 5808)
@@ -9,7 +9,7 @@
<title>Description</title>
<para>A slider-based action component is used for filtering table data.</para>
<figure>
- <title><rich:dataFilterSlider> component</title>
+ <title><emphasis role="bold"><property><rich:dataFilterSlider></property></emphasis> component</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/dataFilterSlider.png"/>
16 years, 3 months
JBoss Rich Faces SVN: r5807 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-05 06:38:02 -0500 (Tue, 05 Feb 2008)
New Revision: 5807
Modified:
trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml
Log:
http://jira.jboss.com/jira/browse/RF-2158 - done for contextmenu
Modified: trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml 2008-02-05 11:37:25 UTC (rev 5806)
+++ trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml 2008-02-05 11:38:02 UTC (rev 5807)
@@ -593,7 +593,7 @@
<para>This is a result:</para>
<figure>
- <title>Redefinition styles with own classes and styleClass attributes</title>
+ <title>Redefinition styles with own classes and <emphasis><property>styleClass</property></emphasis> attributes</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/contextMenuStyle.png"/>
16 years, 3 months