JBoss Rich Faces SVN: r6287 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-02-22 08:58:59 -0500 (Fri, 22 Feb 2008)
New Revision: 6287
Modified:
trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml
Log:
http://jira.jboss.com/jira/browse/RF-2300
Modified: trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml 2008-02-22 13:24:29 UTC (rev 6286)
+++ trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml 2008-02-22 13:58:59 UTC (rev 6287)
@@ -54,9 +54,9 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlContextMenu;
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.ContextMenu;
...
-HtmlContextMenu myContextMenu = new HtmlContextMenu();
+html.ContextMenu myContextMenu = new html.ContextMenu();
...]]></programlisting>
</section>
<section>
16 years, 11 months
JBoss Rich Faces SVN: r6286 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-02-22 08:24:29 -0500 (Fri, 22 Feb 2008)
New Revision: 6286
Modified:
trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml
Log:
http://jira.jboss.com/jira/browse/RF-2043
Modified: trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml 2008-02-22 13:09:42 UTC (rev 6285)
+++ trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml 2008-02-22 13:24:29 UTC (rev 6286)
@@ -38,11 +38,6 @@
<entry>org.richfaces.OrderingListRenderer</entry>
</row>
- <row>
- <entry>tag-class</entry>
-
- <entry>org.richfaces.taglib.OrderingListTagHandler</entry>
- </row>
</tbody>
</tgroup>
</table>
16 years, 11 months
JBoss Rich Faces SVN: r6285 - in trunk/sandbox/ui/fileUpload/src/main: java/org/richfaces/org/jboss/seam/ui/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-22 08:09:42 -0500 (Fri, 22 Feb 2008)
New Revision: 6285
Removed:
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/ProgressData.java
Modified:
trunk/sandbox/ui/fileUpload/src/main/config/component/fileUpload.xml
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/js/FileUpload.js
trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
Log:
accepted file types added & refactoring
Modified: trunk/sandbox/ui/fileUpload/src/main/config/component/fileUpload.xml
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/config/component/fileUpload.xml 2008-02-22 13:03:36 UTC (rev 6284)
+++ trunk/sandbox/ui/fileUpload/src/main/config/component/fileUpload.xml 2008-02-22 13:09:42 UTC (rev 6285)
@@ -204,6 +204,13 @@
<defaultvalue>false</defaultvalue>
</property>
<property>
+ <name>acceptedTypes</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Files types allowed to upload
+ </description>
+ </property>
+ <property>
<name>onupload</name>
<classname>java.lang.String</classname>
</property>
Deleted: trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/ProgressData.java
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/ProgressData.java 2008-02-22 13:03:36 UTC (rev 6284)
+++ trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/ProgressData.java 2008-02-22 13:09:42 UTC (rev 6285)
@@ -1,228 +0,0 @@
-/*
- * ProgressData.java Date created: 09.02.2008
- * Last modified by: $Author$
- * $Revision$ $Date$
- */
-
-package org.richfaces.org.jboss.seam.ui.component;
-
-import java.math.BigDecimal;
-
-/**
- * Provides progress data during file uploading progress
- *
- * @author "Andrey Markavtsov"
- *
- */
-public class ProgressData {
-
- private Integer SCALE = 2;
-
- /** Actual file size */
- private Long size = 0L;
-
- /** Seconds after process started */
- private Long time = 0L;
-
- /** Uploaded bytes count */
- private Long uploaded = 0L;
-
- /** Percent completed */
- private Double percent = 0.0;
-
- private Object scaleNumber(Double d) {
- if (d != null) {
- BigDecimal decimal = new BigDecimal(d);
- decimal = decimal.setScale(SCALE, 0);
- return decimal;
- }
- return null;
- }
-
- /**
- * Gets minutes of process
- *
- * @return
- */
- public String getMm() {
- Long mm = time / 60;
- if (mm != null)
- return String.valueOf(mm.intValue());
- return null;
- }
-
- /**
- * Gets seconds of process
- *
- * @return
- */
- public String getSs() {
- Long ss = time % 60;
- if (ss != null)
- return String.valueOf(ss.intValue());
- return null;
- }
-
- /**
- * Gets hours of process
- *
- * @return
- */
- public String getHh() {
- Long ss = time / 3600;
- if (ss != null)
- return String.valueOf(ss.intValue());
- return null;
- }
-
- /**
- * Gets days of process
- *
- * @return
- */
- public String getDd() {
- Long ss = time / 3600 * 24;
- if (ss != null)
- return String.valueOf(ss.intValue());
- return null;
- }
-
- /**
- * Gets uploaded bytes count
- *
- * @return
- */
- public Object getUploadedB() {
- return getUploaded();
- }
-
- /**
- * Gets uploaded kilo bytes count
- *
- * @return
- */
- public Object getUploadedKB() {
- Double kb = getUploaded() / 1024.0;
- return scaleNumber(kb);
- }
-
- /**
- * Gets uploaded mega bytes count
- *
- * @return
- */
- public Object getUploadedMB() {
- Double mb = getUploaded() / (1024.0 * 1024.0);
- return scaleNumber(mb);
- }
-
- /**
- * Gets uploaded giga bytes count
- *
- * @return
- */
- public Object getUploadedGB() {
- Double gb = getUploaded() / (1024.0 * 1024.0 * 1024.0);
- return scaleNumber(gb);
- }
-
- /**
- * Gets file size in bytes
- *
- * @return
- */
- public Object getB() {
- return size;
- }
-
- /**
- * Gets file size in kilo bytes
- *
- * @return
- */
- public Object getKB() {
- Double kb = size / 1024.0;
- return scaleNumber(kb);
- }
-
- /**
- * Gets file size in mega bytes
- *
- * @return
- */
- public Object getMB() {
- Double mb = size / (1024.0 * 1024.0);
- return scaleNumber(mb);
- }
-
- /**
- * Gets file size in giga bytes
- *
- * @return
- */
- public Object getGB() {
- Double gb = size / (1024.0 * 1024.0 * 1024.0);
- return scaleNumber(gb);
- }
-
- /**
- * @return the size
- */
- public Long getSize() {
- return size;
- }
-
- /**
- * @param size
- * the size to set
- */
- public void setSize(Long size) {
- this.size = size;
- }
-
- /**
- * @return the time
- */
- public Long getTime() {
- return time;
- }
-
- /**
- * @param time
- * the time to set
- */
- public void setTime(Long time) {
- this.time = time;
- }
-
- /**
- * @return the uploaded
- */
- public Long getUploaded() {
- return uploaded;
- }
-
- /**
- * @param uploaded
- * the uploaded to set
- */
- public void setUploaded(Long uploaded) {
- this.uploaded = uploaded;
- }
-
- /**
- * @return the percent
- */
- public Object getPercent() {
- return scaleNumber(percent);
- }
-
- /**
- * @param percent
- * the percent to set
- */
- public void setPercent(Double percent) {
- this.percent = percent;
- }
-
-}
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-22 13:03:36 UTC (rev 6284)
+++ trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/UIFileUpload.java 2008-02-22 13:09:42 UTC (rev 6285)
@@ -1,16 +1,23 @@
package org.richfaces.org.jboss.seam.ui.component;
import java.io.InputStream;
+import java.util.Map;
import javax.el.MethodExpression;
import javax.faces.component.UIInput;
+import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
import javax.faces.event.FacesEvent;
+import javax.servlet.http.HttpServletRequest;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.context.AjaxContextImpl;
import org.richfaces.event.FileUploadListener;
import org.richfaces.event.UploadEvent;
+import org.richfaces.org.jboss.seam.web.MultipartFilter;
+import org.richfaces.org.jboss.seam.web.MultipartRequest;
/**
* JSF component class
@@ -152,7 +159,27 @@
binding.invoke(facesContext.getELContext(), new Object[] { e });
}
- }
+ }else {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ExternalContext externalContext = facesContext.getExternalContext();
+ HttpServletRequest request = (HttpServletRequest)externalContext.getRequest();
+ if ("progress".equals(request.getParameter("action"))) {
+ AjaxContext ajaxContext = AjaxContextImpl
+ .getCurrentInstance(facesContext);
+ String uid = request.getParameter("uid");
+ Map<String, Object> sessionMap = externalContext.getSessionMap();
+
+ Map<String, MultipartRequest> sessions = (Map<String, MultipartRequest>) sessionMap
+ .get(MultipartFilter.REQUESTS_SESSIONS_BEAN_NAME);
+ if (sessions != null) {
+ MultipartRequest multipartRequest = sessions.get(uid);
+ if (multipartRequest != null) {
+ ajaxContext.setResponseData(multipartRequest.getSize());
+ }
+ }
+ }
+ }
+
}
}
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-22 13:03:36 UTC (rev 6284)
+++ trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java 2008-02-22 13:09:42 UTC (rev 6285)
@@ -4,25 +4,24 @@
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.util.HashMap;
import java.util.Map;
import javax.el.ValueExpression;
import javax.faces.FactoryFinder;
import javax.faces.component.UIComponent;
-import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.RenderKit;
import javax.faces.render.RenderKitFactory;
import javax.servlet.ServletRequest;
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.context.AjaxContextImpl;
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.javascript.JSLiteral;
import org.ajax4jsf.javascript.JSReference;
+import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererUtils;
import org.ajax4jsf.resource.CountingOutputWriter;
@@ -54,33 +53,9 @@
ServletRequest request = (ServletRequest) context.getExternalContext()
.getRequest();
-
String clientId = component.getClientId(context);
- Map<String, String[]> params = context.getExternalContext()
- .getRequestParameterValuesMap();
-
- if ("progress".equals(request.getParameter("action"))) {
- AjaxContext ajaxContext = AjaxContextImpl
- .getCurrentInstance(context);
- String uid = request.getParameter("uid");
- ExternalContext externalContext = context.getExternalContext();
- Map<String, Object> sessionMap = externalContext.getSessionMap();
-
- Map<String, MultipartRequest> sessions = (Map<String, MultipartRequest>) sessionMap
- .get(MultipartFilter.REQUESTS_SESSIONS_BEAN_NAME);
- if (sessions != null) {
- MultipartRequest multipartRequest = sessions.get(uid);
- if (multipartRequest != null) {
- ajaxContext.setResponseData(multipartRequest.getSize());
- }
- }
- } else {
- new AjaxEvent(component).queue();
- }
- if (!(request instanceof MultipartRequest)) {
- request = unwrapMultipartRequest(request);
- }
+ new AjaxEvent(component).queue();
if (request instanceof MultipartRequest) {
MultipartRequest multipartRequest = (MultipartRequest) request;
@@ -91,7 +66,7 @@
.getFileContentType(clientId));
fileUpload.setLocalFileName(multipartRequest.getFileName(clientId));
fileUpload.setLocalFileSize(multipartRequest.getFileSize(clientId));
- new UploadEvent(component, multipartRequest.getFile(clientId)).queue();
+ new UploadEvent(component, multipartRequest.getFile(clientId), multipartRequest.getFileName(clientId)).queue();
onUploadComplete(context, multipartRequest.getFile(clientId),
fileUpload);
}
@@ -169,6 +144,27 @@
return function.toScript();
}
+
+ /**
+ * Return accepted types map
+ * @param context
+ * @param component
+ * @return
+ */
+ public Object getAcceptedTypes(FacesContext context, UIComponent component) {
+ String acceptedTypes = (String)component.getAttributes().get("acceptedTypes");
+ if (acceptedTypes != null) {
+ Map<String, Boolean> accepted = new HashMap<String, Boolean>();
+ String [] types = acceptedTypes.split("[,;]");
+ if (types != null) {
+ for (String type : types) {
+ accepted.put(type.toLowerCase(), true);
+ }
+ return ScriptUtils.toScript(accepted);
+ }
+ }
+ return JSReference.NULL;
+ }
/**
* Generates JS script for stopping uploading process
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-22 13:03:36 UTC (rev 6284)
+++ trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-02-22 13:09:42 UTC (rev 6285)
@@ -301,10 +301,10 @@
if (error) {
this.stop();
- this.onload();
+ this.onerror();
} else if (loaded) {
this.stop();
- this.onerror();
+ this.onload();
}
}
}.bind(this), 200);
@@ -371,7 +371,7 @@
maxFileBatchSize: null,
- initialize: function(id, stopScript, getFileSizeScript, progressBarId, classes, label, maxFiles, events, disabled, options) {
+ initialize: function(id, stopScript, getFileSizeScript, progressBarId, classes, label, maxFiles, events, disabled, acceptedTypes, options) {
this.id = id;
this.element = $(this.id);
this._progressBar = $(progressBarId);
@@ -381,6 +381,7 @@
this.disabled = disabled;
this.element.component = this;
+ this.acceptedTypes = acceptedTypes;
this.stopScript = stopScript;
this.getFileSizeScript = getFileSizeScript;
@@ -434,9 +435,22 @@
setupAutoUpload: function() {
this.runUpload = this.options.autoUpload;
},
+
+ checkFileType: function (fileName) {
+ if (!this.acceptedTypes || this.acceptedTypes['*']) { return true; }
+ if (/(?:\S+)\.(\S+)$/.test(fileName)) {
+ var type = RegExp.$1;
+ type = type.toLowerCase();
+ if (this.acceptedTypes[type]) {
+ return true;
+ }
+ }
+ return false;
+ },
add: function(elt) {
if (this.disabled) return;
+ if (!this.checkFileType(elt.value)) return;
var newEntry = new FileUploadEntry(elt, this);
this.entries.push(newEntry);
Modified: trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-02-22 13:03:36 UTC (rev 6284)
+++ trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-02-22 13:09:42 UTC (rev 6285)
@@ -158,7 +158,7 @@
onerror : #{this:getAsEventHandler(context, component, "onerror")}
};
- new FileUpload('#{clientId}', #{this:getStopScript(context, component)}, #{this:getFileSizeScript(context, component)} ,'#{this:getProgressBarId(context, component)}', FileUpload.CLASSES, #{this:getLabelMarkup(context, component)}, '#{component.attributes["maxFilesQuantity"]}', events, #{component.attributes["disabled"]});
+ new FileUpload('#{clientId}', #{this:getStopScript(context, component)}, #{this:getFileSizeScript(context, component)} ,'#{this:getProgressBarId(context, component)}', FileUpload.CLASSES, #{this:getLabelMarkup(context, component)}, '#{component.attributes["maxFilesQuantity"]}', events, #{component.attributes["disabled"]}, #{this:getAcceptedTypes(context, component)});
</script>
</span>
16 years, 11 months
JBoss Rich Faces SVN: r6284 - trunk/framework/api/src/main/java/org/richfaces/event.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-22 08:03:36 -0500 (Fri, 22 Feb 2008)
New Revision: 6284
Modified:
trunk/framework/api/src/main/java/org/richfaces/event/UploadEvent.java
Log:
Add fileName property to UploadEvent
Modified: trunk/framework/api/src/main/java/org/richfaces/event/UploadEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/UploadEvent.java 2008-02-22 12:41:04 UTC (rev 6283)
+++ trunk/framework/api/src/main/java/org/richfaces/event/UploadEvent.java 2008-02-22 13:03:36 UTC (rev 6284)
@@ -21,7 +21,7 @@
package org.richfaces.event;
import java.io.File;
-import java.io.InputStream;
+
import javax.faces.component.UIComponent;
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
@@ -31,10 +31,12 @@
private static final long serialVersionUID = -7645197191376210068L;
private File file = null;
+ private String fileName = null;
- public UploadEvent(UIComponent component, File file) {
+ public UploadEvent(UIComponent component, File file, String fileName) {
super(component);
this.file = file;
+ this.fileName = fileName;
}
@@ -51,5 +53,9 @@
public File getFile() {
return file;
}
+
+ public String getFileName() {
+ return fileName;
+ }
}
16 years, 11 months
JBoss Rich Faces SVN: r6283 - in trunk: ui/dataTable and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-02-22 07:41:04 -0500 (Fri, 22 Feb 2008)
New Revision: 6283
Modified:
trunk/samples/dataTableDemo/pom.xml
trunk/ui/dataTable/pom.xml
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
Added inplace inputs to headers with filter.
Modified: trunk/samples/dataTableDemo/pom.xml
===================================================================
--- trunk/samples/dataTableDemo/pom.xml 2008-02-22 11:30:39 UTC (rev 6282)
+++ trunk/samples/dataTableDemo/pom.xml 2008-02-22 12:41:04 UTC (rev 6283)
@@ -25,5 +25,10 @@
<artifactId>skins</artifactId>
<version>3.2.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>inplaceInput</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
Modified: trunk/ui/dataTable/pom.xml
===================================================================
--- trunk/ui/dataTable/pom.xml 2008-02-22 11:30:39 UTC (rev 6282)
+++ trunk/ui/dataTable/pom.xml 2008-02-22 12:41:04 UTC (rev 6283)
@@ -48,10 +48,5 @@
<version>3.2.0-SNAPSHOT</version>
</dependency>
-->
- <dependency>
- <groupId>org.richfaces.sandbox.ui</groupId>
- <artifactId>inplaceInput</artifactId>
- <version>3.2.0-SNAPSHOT</version>
- </dependency>
</dependencies>
</project>
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-02-22 11:30:39 UTC (rev 6282)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-02-22 12:41:04 UTC (rev 6283)
@@ -27,6 +27,7 @@
import java.util.List;
import java.util.Map;
+import javax.faces.FacesException;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
@@ -37,13 +38,11 @@
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.ajax4jsf.resource.InternetResource;
import org.apache.commons.collections.Predicate;
import org.apache.commons.collections.iterators.FilterIterator;
import org.richfaces.component.Column;
import org.richfaces.component.Row;
import org.richfaces.component.UIDataTable;
-import org.richfaces.component.UIInplaceInput;
import org.richfaces.model.Ordering;
/**
@@ -526,7 +525,10 @@
}
}
String filterValue = map.get(children.getClientId(context) + SORT_FILTER_PARAMETER +
- UIInplaceInput.VALUE_SUFFIX);
+ "value");
+ if (filterValue == null) {
+ filterValue = map.get(children.getClientId(context) + SORT_FILTER_PARAMETER);
+ }
if (filterValue != null) {
column.setFilterValue(filterValue);
}
@@ -541,17 +543,20 @@
protected void encodeInplaceInput(FacesContext context, UIComponent column, StringBuffer buffer)
throws IOException {
UIInput filterValueInput = (UIInput)column.getFacet(FILTER_INPUT_FACET_NAME);
+ String event = "onviewactivated";
if (null == filterValueInput) {
- filterValueInput = (UIInput) context.getApplication().createComponent(UIInplaceInput.COMPONENT_TYPE);
- if (null == filterValueInput) {
+ try {
+ filterValueInput = (UIInput) context.getApplication().createComponent("org.richfaces.InplaceInput");
+ } catch (FacesException e) {
filterValueInput = (UIInput) context.getApplication().createComponent(UIInput.COMPONENT_TYPE);
+ event = "onchange";
}
filterValueInput.setId(column.getId() + SORT_FILTER_PARAMETER);
filterValueInput.setImmediate(true);
filterValueInput.getAttributes().put("onclick", "Event.stop(event);");
column.getFacets().put(FILTER_INPUT_FACET_NAME, filterValueInput);
}
- filterValueInput.getAttributes().put("onviewactivated", buffer.toString());
+ filterValueInput.getAttributes().put(event, buffer.toString());
filterValueInput.setValue(column.getAttributes().get("filterValue"));
getUtils().encodeBeginFormIfNessesary(context, column);
16 years, 11 months
JBoss Rich Faces SVN: r6282 - in trunk: ui/dataTable/src/main/java/org/richfaces/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-02-22 06:30:39 -0500 (Fri, 22 Feb 2008)
New Revision: 6282
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss
Log:
Added inplace inputs to headers with filter.
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2008-02-22 11:03:02 UTC (rev 6281)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2008-02-22 11:30:39 UTC (rev 6282)
@@ -731,7 +731,7 @@
writer.writeAttribute(HTML.id_ATTRIBUTE, clientId, null);
writer.writeAttribute(HTML.NAME_ATTRIBUTE, clientId, null);
writer.writeAttribute(HTML.METHOD_ATTRIBUTE, "post", null);
- writer.writeAttribute(HTML.style_ATTRIBUTE, "margin:0; padding:0;",
+ writer.writeAttribute(HTML.style_ATTRIBUTE, "margin:0; padding:0; display: inline;",
null);
writer.writeURIAttribute(HTML.ACTION_ATTRIBUTE, encodeActionURL,
"action");
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-02-22 11:03:02 UTC (rev 6281)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-02-22 11:30:39 UTC (rev 6282)
@@ -29,6 +29,7 @@
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -53,7 +54,7 @@
private static final String SORT_FILTER_PARAMETER = "fsp";
- private UIInplaceInput filterValueInput = null;
+ private static final String FILTER_INPUT_FACET_NAME = "filterValueInput";
/**
* Encode all table structure - colgroups definitions, caption, header,
@@ -539,13 +540,22 @@
protected void encodeInplaceInput(FacesContext context, UIComponent column, StringBuffer buffer)
throws IOException {
+ UIInput filterValueInput = (UIInput)column.getFacet(FILTER_INPUT_FACET_NAME);
if (null == filterValueInput) {
- filterValueInput = (UIInplaceInput) context.getApplication().createComponent(UIInplaceInput.COMPONENT_TYPE);
+ filterValueInput = (UIInput) context.getApplication().createComponent(UIInplaceInput.COMPONENT_TYPE);
+ if (null == filterValueInput) {
+ filterValueInput = (UIInput) context.getApplication().createComponent(UIInput.COMPONENT_TYPE);
+ }
filterValueInput.setId(column.getId() + SORT_FILTER_PARAMETER);
- column.getParent().getChildren().add(filterValueInput);
+ filterValueInput.setImmediate(true);
+ filterValueInput.getAttributes().put("onclick", "Event.stop(event);");
+ column.getFacets().put(FILTER_INPUT_FACET_NAME, filterValueInput);
}
filterValueInput.getAttributes().put("onviewactivated", buffer.toString());
filterValueInput.setValue(column.getAttributes().get("filterValue"));
+
+ getUtils().encodeBeginFormIfNessesary(context, column);
renderChild(context, filterValueInput);
+ getUtils().encodeEndFormIfNessesary(context, column);
}
}
\ No newline at end of file
Modified: trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss
===================================================================
--- trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss 2008-02-22 11:03:02 UTC (rev 6281)
+++ trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss 2008-02-22 11:30:39 UTC (rev 6282)
@@ -95,6 +95,7 @@
<u:style name="font-size" skin="generalSizeFont"/> <!--generalSizeFont-->
<u:style name="color" skin="generalTextColor"/> <!--generalTextColor-->
<u:style name="font-family" skin="generalFamilyFont"/> <!--generalFamilyFont-->
+ <u:style name="white-space" value="nowrap"/>
</u:selector>
<f:verbatim>
16 years, 11 months
JBoss Rich Faces SVN: r6281 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-22 06:03:02 -0500 (Fri, 22 Feb 2008)
New Revision: 6281
Modified:
trunk/docs/userguide/en/src/main/docbook/included/support.xml
Log:
http://jira.jboss.com/jira/browse/RF-2099 - added the information in section "Key attributes and ways of usage"
Modified: trunk/docs/userguide/en/src/main/docbook/included/support.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/support.xml 2008-02-22 11:02:25 UTC (rev 6280)
+++ trunk/docs/userguide/en/src/main/docbook/included/support.xml 2008-02-22 11:03:02 UTC (rev 6281)
@@ -63,9 +63,21 @@
</para>
<para><emphasis role="bold">Example:</emphasis></para>
<programlisting role="XML"><![CDATA[<h:inputText value="#{bean.text}">
- <a4j:support event="onkeyup" reRender="repeater"/>
+ <a4j:support event="onkeyup" reRender="output" action="#{bean.action}"/>
</h:inputText>
]]></programlisting>
+
+ <para> Below you can see example Java code where support was added as facelets, not children:</para>
+ <para><emphasis role="bold">Example:</emphasis></para>
+ <programlisting role="JAVA"><![CDATA[
+HtmlInputText inputText = new HtmlInputText();
+...
+HtmlAjaxSupport ajaxSupport = new HtmlAjaxSupport();
+ ajaxSupport.setActionExpression(FacesContext.getCurrentInstance().getApplication().getExpressionFactory().createMethodExpression(FacesContext.getCurrentInstance().getELContext(), "#{bean.action}", String.class, new Class[] {}));
+ ajaxSupport.setEvent("onkeyup");
+ ajaxSupport.setReRender("output");
+ inputText.getFacets().put("a4jsupport", ajaxSupport);
+]]></programlisting>
<para>Is decoded on a page as:</para>
<para>
@@ -149,7 +161,7 @@
Moreover, if the next request is already sent, the rerendering after the previous request is banned, and
it helps to avoid unnecessary processing on the client.</para>
</listitem>
- </itemizedlist>
+ </itemizedlist>
</section>
<section>
16 years, 11 months
JBoss Rich Faces SVN: r6280 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-22 06:02:25 -0500 (Fri, 22 Feb 2008)
New Revision: 6280
Modified:
trunk/docs/userguide/en/src/main/docbook/included/columns.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/columns.xml
Log:
http://jira.jboss.com/jira/browse/RF-1199 - updated titles for screenshots
Modified: trunk/docs/userguide/en/src/main/docbook/included/columns.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/columns.desc.xml 2008-02-22 11:01:17 UTC (rev 6279)
+++ trunk/docs/userguide/en/src/main/docbook/included/columns.desc.xml 2008-02-22 11:02:25 UTC (rev 6280)
@@ -12,7 +12,7 @@
</emphasis> is a component, that allows you to create a <property>dynamic</property> set of columns from your model.</para>
<figure>
- <title><emphasis role="bold"><property><rich:dataTable></property></emphasis> component</title>
+ <title><emphasis role="bold"><property><rich:columns></property></emphasis> component</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/columns1.png"/>
Modified: trunk/docs/userguide/en/src/main/docbook/included/columns.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/columns.xml 2008-02-22 11:01:17 UTC (rev 6279)
+++ trunk/docs/userguide/en/src/main/docbook/included/columns.xml 2008-02-22 11:02:25 UTC (rev 6280)
@@ -131,7 +131,7 @@
The result is:
</para>
<figure>
- <title>Generated <emphasis role="bold"><property><rich:dataTable></property></emphasis></title>
+ <title>Generated <emphasis role="bold"><property><rich:columns></property></emphasis></title>
<mediaobject>
<imageobject>
<imagedata fileref="images/columns2.png"/>
16 years, 11 months
JBoss Rich Faces SVN: r6279 - trunk/docs/faq/en/src/main/docbook/module.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-22 06:01:17 -0500 (Fri, 22 Feb 2008)
New Revision: 6279
Modified:
trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
Log:
http://jira.jboss.com/jira/browse/RF-2147 - corrected names attributes for 'How to highlight rows in a dataTable when the mouse is over?' section
Modified: trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
===================================================================
--- trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-02-22 10:51:35 UTC (rev 6278)
+++ trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-02-22 11:01:17 UTC (rev 6279)
@@ -1650,7 +1650,7 @@
<title>How to highlight rows in a dataTable when the mouse is over?</title>
<para>
In order to highlight rows in a dataTable when the mouse is over you should use
- <emphasis><property>"onmouseover"</property></emphasis> and <emphasis><property>"onmouseout"</property></emphasis> attributes.
+ <emphasis><property>"onRowMouseOver"</property></emphasis> and <emphasis><property>"onRowMouseOut"</property></emphasis> attributes.
</para>
<para>
<emphasis role="bold">Example:</emphasis>
16 years, 11 months
JBoss Rich Faces SVN: r6278 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-02-22 05:51:35 -0500 (Fri, 22 Feb 2008)
New Revision: 6278
Modified:
trunk/docs/userguide/en/src/main/docbook/included/tree.xml
Log:
The text revision is done.
http://jira.jboss.com/jira/browse/RF-1137
Modified: trunk/docs/userguide/en/src/main/docbook/included/tree.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2008-02-21 18:41:10 UTC (rev 6277)
+++ trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2008-02-22 10:51:35 UTC (rev 6278)
@@ -618,7 +618,7 @@
<tbody>
<row>
<entry>dragValue</entry>
- <entry>Element value drag passing into processing after a Drop event</entry>
+ <entry>Element value drag passed into processing after a Drop event</entry>
</row>
@@ -660,17 +660,17 @@
</row>
<row>
<entry>acceptedTypes</entry>
- <entry>Drag zone names are allowed to be processed with a Drop zone.</entry>
+ <entry>Drag zone names are allowed to be processed with a Drop zone</entry>
</row>
<row>
<entry>typeMapping</entry>
- <entry>Drag zones names mapping on the corresponding drop zone parameters.</entry>
+ <entry>Drag zones names mapping on the corresponding drop zone parameters</entry>
</row>
</tbody>
</tgroup>
</table>
- <para>An example of usage is placed below.</para>
+ <para>Please see an example below.</para>
<para>
<emphasis role="bold">Example:</emphasis>
@@ -692,20 +692,21 @@
</rich:treeNode>
</rich:tree>
</h:form>
-...]]></programlisting>
+...]]>
+</programlisting>
- <para>In the example a song from one album can be dragged into other because for the second
- <property>treeNode</property> with <emphasis>
- <property>"type"</property>
- </emphasis>="album" was defined attribute <emphasis>
- <property>"acceptedTypes"</property>
- </emphasis>="song". Its value is equal to the value of the<emphasis>
- <property>"type"</property>
- </emphasis>attribute defined for the third treeNode (see picture below). Also an album can be
+ <para>
+
+In the shown example a song from one album can be dragged into another because attribute
+ <emphasis><property>"acceptedTypes"</property> </emphasis>="song" defined in the second <property>treeNode</property>
+ with <emphasis><property>"type"</property></emphasis>="album". Its value is equal to the value of the<emphasis>
+ <property>"type"</property></emphasis>attribute defined in the third <property>treeNode</property> (see picture below). An album can be also
dragged into <property>treeNode</property> with <emphasis>
<property>"type"</property>
- </emphasis>="artist".</para>
+ </emphasis>="artist" property.
+</para>
+
<figure>
<title>DnD operations</title>
<mediaobject>
@@ -733,20 +734,20 @@
<listitem>onexpand is a script expression to invoke when a node is expanded</listitem>
<listitem>oncollapse is a script expression to invoke when a node is collapsed</listitem>
<listitem>ondragexit is a script expression to invoke when an element passing out from a tree zone</listitem>
- <listitem>ondragstart is a script expression to invoke when drag starts</listitem>
- <listitem>ondragend is a script expression to invoke when drag ends (a drop event)</listitem>
+ <listitem>ondragstart is a script expression to invoke when dragging starts</listitem>
+ <listitem>ondragend is a script expression to invoke when dragging ends (a drop event)</listitem>
<listitem>ondragenter is a script expression to invoke when a dragged element appears on a tree</listitem>
</itemizedlist>
<para>They can be used to add some JavaScript effects.</para>
- <para> Also standart HTML event attributes like<emphasis>
+ <para> Standart HTML event attributes like<emphasis>
<property>"onclick"</property>
</emphasis>, <emphasis>
<property>"onmousedown"</property>
</emphasis>, <emphasis>
<property>"onmouseover"</property>
- </emphasis> and etc. could be used. Event handlers of a <emphasis role="bold">
+ </emphasis> etc. can be also used. Event handlers of a <emphasis role="bold">
<property><rich:tree></property>
</emphasis> component capture events occured on any <property>tree</property> part. But event
handlers of <property>treeNode</property> capture events occured on
@@ -854,7 +855,7 @@
</figure>
<para>In the example a tree font weight was changed to bold.</para>
- <para>Also it’s possible to change styles of particular <emphasis role="bold"
+ <para>Also it's possible to change styles of a particular <emphasis role="bold"
><property><rich:tree></property></emphasis> component. In this case you should create own style classes and use them in corresponding <emphasis role="bold"
><property><rich:tree></property></emphasis> <property>styleClass</property> attributes. An example is placed below:</para>
@@ -886,7 +887,7 @@
</mediaobject>
</figure>
- <para>As it could be seen on the picture above, font weight of highlighted text node of a tree was changed to bold.</para>
+ <para>As it's shown on the picture above, font weight of highlighted text node of a tree was changed to bold.</para>
</section>
<section>
16 years, 11 months