JBoss Rich Faces SVN: r5966 - in trunk/ui/dataTable/src/main: java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-02-08 13:58:01 -0500 (Fri, 08 Feb 2008)
New Revision: 5966
Modified:
trunk/ui/dataTable/src/main/config/component/column.xml
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
Log:
RF-1741
Modified: trunk/ui/dataTable/src/main/config/component/column.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/column.xml 2008-02-08 18:52:58 UTC (rev 5965)
+++ trunk/ui/dataTable/src/main/config/component/column.xml 2008-02-08 18:58:01 UTC (rev 5966)
@@ -98,6 +98,16 @@
<returntype>boolean</returntype>
<description></description>
</property>
+ <property elonly="true">
+ <name>filterBy</name>
+ <classname>java.lang.Object</classname>
+ <description></description>
+ </property>
+ <property hidden="true">
+ <name>filterValue</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
<!--
<property>
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-02-08 18:52:58 UTC (rev 5965)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-02-08 18:58:01 UTC (rev 5966)
@@ -39,6 +39,7 @@
import org.apache.commons.collections.Predicate;
import org.apache.commons.collections.iterators.FilterIterator;
import org.apache.commons.collections.iterators.IteratorChain;
+import org.richfaces.model.ExtendedFilterField;
import org.richfaces.model.FilterField;
import org.richfaces.model.ModifiableModel;
import org.richfaces.model.Ordering;
@@ -182,6 +183,11 @@
if (filterMethod != null) {
filterFields.add(new FilterField(filterMethod));
}
+ ValueExpression filterBy = component.getValueExpression("filterBy");
+ String filterValue = (String)component.getAttributes().get("filterValue");
+ if (filterBy != null) {
+ filterFields.add(new ExtendedFilterField(filterBy, filterValue));
+ }
if (column.isSortable() && !Ordering.UNSORTED.equals(column.getSortOrder())) {
ValueExpression sortExpression = component.getValueExpression("sortExpression");
if (sortExpression != null) {
18 years, 2 months
JBoss Rich Faces SVN: r5965 - in trunk/framework: impl/src/main/java/org/richfaces/model/impl/expressive and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-02-08 13:52:58 -0500 (Fri, 08 Feb 2008)
New Revision: 5965
Added:
trunk/framework/api/src/main/java/org/richfaces/model/ExtendedFilterField.java
Modified:
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanFilter.java
Log:
RF-1741
Added: trunk/framework/api/src/main/java/org/richfaces/model/ExtendedFilterField.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/ExtendedFilterField.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/ExtendedFilterField.java 2008-02-08 18:52:58 UTC (rev 5965)
@@ -0,0 +1,33 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+import javax.el.Expression;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class ExtendedFilterField extends FilterField{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5443560922389498666L;
+
+ private String filterValue;
+
+ public ExtendedFilterField(Expression expression, String filterValue) {
+ super(expression);
+ this.filterValue = filterValue;
+ }
+
+ public ExtendedFilterField(Expression expression) {
+ this(expression, "");
+ }
+
+ public String getFilterValue() {
+ return filterValue;
+ }
+}
Modified: trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanFilter.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanFilter.java 2008-02-08 18:12:41 UTC (rev 5964)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanFilter.java 2008-02-08 18:52:58 UTC (rev 5965)
@@ -5,6 +5,7 @@
import java.util.List;
+import org.richfaces.model.ExtendedFilterField;
import org.richfaces.model.FilterField;
/**
@@ -21,9 +22,17 @@
public boolean accept(JavaBeanWrapper wrapper) {
for (FilterField filterField : filterFields) {
- Object property = wrapper.getProperty(filterField.getExpression().getExpressionString());
- if(!((Boolean)property).booleanValue()) {
- return false;
+ if (filterField instanceof ExtendedFilterField) {
+ Object property = wrapper.getProperty(filterField.getExpression().getExpressionString());
+ final String filterValue = ((ExtendedFilterField)filterField).getFilterValue();
+ if(!(filterValue == null) && !property.toString().startsWith(filterValue)) {
+ return false;
+ }
+ } else {
+ Object property = wrapper.getProperty(filterField.getExpression().getExpressionString());
+ if(!((Boolean)property).booleanValue()) {
+ return false;
+ }
}
}
return true;
18 years, 2 months
JBoss Rich Faces SVN: r5964 - in trunk: framework/impl/src/main/java/org/richfaces/model and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-02-08 13:12:41 -0500 (Fri, 08 Feb 2008)
New Revision: 5964
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
trunk/framework/impl/src/main/java/org/richfaces/model/DataModelCache.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable/examples/scrollableDataTable.xhtml
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
Log:
reviewed code related to sortOrder
Modified: trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-02-08 18:11:39 UTC (rev 5963)
+++ trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-02-08 18:12:41 UTC (rev 5964)
@@ -95,6 +95,7 @@
private SortOrder lastSortOrder;
+
/**
* Load range of data items from the source.
* Starting from startRow, and up to but excluding endRow
@@ -159,7 +160,7 @@
if (id instanceof SimpleRowKey) {
int i = ((SimpleRowKey) id).intValue();
- List l = loadData(i, i + 1, lastSortOrder);
+ List<?> l = loadData(i, i + 1, lastSortOrder);
return l.get(0);
@@ -237,6 +238,11 @@
}
return o;
}
-
-
+ /*
+ * FIXME: This method is most likely redundant
+ public void setSortOrder(SortOrder sortOrder) {
+ lastSortOrder = sortOrder;
+ }
+ */
+
}
Modified: trunk/framework/impl/src/main/java/org/richfaces/model/DataModelCache.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/DataModelCache.java 2008-02-08 18:11:39 UTC (rev 5963)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/DataModelCache.java 2008-02-08 18:12:41 UTC (rev 5964)
@@ -182,5 +182,11 @@
// TODO Auto-generated method stub
super.walk(context, visitor, range, argument);
}
-
+ /*
+ * FIXME: see superclass
+ @Override
+ public void setSortOrder(SortOrder sortOrder) {
+ scrollableTableDataModel.setSortOrder(sortOrder);
+ }
+ */
}
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2008-02-08 18:11:39 UTC (rev 5963)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2008-02-08 18:12:41 UTC (rev 5964)
@@ -10,6 +10,7 @@
import java.util.List;
import java.util.Random;
+import org.richfaces.component.UIScrollableDataTable;
import org.richfaces.demo.datafilterslider.DemoInventoryItem;
import org.richfaces.model.ScrollableTableDataModel.SimpleRowKey;
import org.richfaces.model.selection.SimpleSelection;
@@ -21,6 +22,9 @@
*/
public class DataTableScrollerBean {
private SimpleSelection selection = new SimpleSelection();
+
+ private UIScrollableDataTable table;
+
private ArrayList<DemoInventoryItem> selectedCars = new ArrayList<DemoInventoryItem>();
private static int DECIMALS = 1;
private static int ROUNDING_MODE = BigDecimal.ROUND_HALF_UP;
@@ -166,7 +170,10 @@
Iterator<SimpleRowKey> iterator = getSelection().getKeys();
while (iterator.hasNext()){
SimpleRowKey key = iterator.next();
- getSelectedCars().add(getAllCars().get(key.intValue()));
+ table.setRowKey(key);
+ if (table.isRowAvailable()) {
+ getSelectedCars().add((DemoInventoryItem) table.getRowData());
+ }
}
return null;
}
@@ -178,4 +185,12 @@
public void setSelectedCars(ArrayList<DemoInventoryItem> selectedCars) {
this.selectedCars = selectedCars;
}
+
+ public UIScrollableDataTable getTable() {
+ return table;
+ }
+
+ public void setTable(UIScrollableDataTable table) {
+ this.table = table;
+ }
}
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable/examples/scrollableDataTable.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable/examples/scrollableDataTable.xhtml 2008-02-08 18:11:39 UTC (rev 5963)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/scrollableDataTable/examples/scrollableDataTable.xhtml 2008-02-08 18:12:41 UTC (rev 5964)
@@ -10,7 +10,8 @@
<rich:spacer height="30" />
<rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="1" height="400px"
width="700px" id="carList" rows="40" columnClasses="col"
- value="#{dataTableScrollerBean.allCars}" var="category" sortMode="single"
+ value="#{dataTableScrollerBean.allCars}" var="category" sortMode="single"
+ binding="#{dataTableScrollerBean.table}"
selection="#{dataTableScrollerBean.selection}">
<rich:column id="make">
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2008-02-08 18:11:39 UTC (rev 5963)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2008-02-08 18:12:41 UTC (rev 5964)
@@ -189,7 +189,10 @@
model = new DataModelCache(model);
}
-
+ /*
+ * TODO: Verify - do we really need it
+ model.setSortOrder(getSortOrder());
+ */
return model;
}
18 years, 2 months
JBoss Rich Faces SVN: r5963 - trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-08 13:11:39 -0500 (Fri, 08 Feb 2008)
New Revision: 5963
Modified:
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.jsp
Log:
Modified: trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.jsp 2008-02-08 18:11:18 UTC (rev 5962)
+++ trunk/sandbox/samples/fileUploadDemo/src/main/webapp/pages/index.jsp 2008-02-08 18:11:39 UTC (rev 5963)
@@ -13,7 +13,7 @@
<h:form>
<fu:fileUpload data="#{bean.data}">
<f:facet name="progress">
- <progressBar:progressBar style="height: 10px; width: 300px;">
+ <progressBar:progressBar style="height: 10px; width: 300px;" maxValue="101" minValue="-1">
</progressBar:progressBar>
</f:facet>
</fu:fileUpload><br/><br/><br/>
18 years, 2 months
JBoss Rich Faces SVN: r5962 - trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/images.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-08 13:11:18 -0500 (Fri, 08 Feb 2008)
New Revision: 5962
Added:
trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/images/ico_add_dis.gif
trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/images/ico_clear_dis.gif
trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/images/ico_start_dis.gif
Log:
images for disabled buttons
Added: trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/images/ico_add_dis.gif
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/images/ico_add_dis.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/images/ico_clear_dis.gif
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/images/ico_clear_dis.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/images/ico_start_dis.gif
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/images/ico_start_dis.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
18 years, 2 months
JBoss Rich Faces SVN: r5961 - in trunk/sandbox/ui/fileUpload/src/main: java/org/richfaces/org/jboss/seam/ui/component and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-08 13:10:37 -0500 (Fri, 08 Feb 2008)
New Revision: 5961
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/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/fileUpload.jspx
Log:
palet version provided
Modified: trunk/sandbox/ui/fileUpload/src/main/config/component/fileUpload.xml
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/config/component/fileUpload.xml 2008-02-08 17:50:25 UTC (rev 5960)
+++ trunk/sandbox/ui/fileUpload/src/main/config/component/fileUpload.xml 2008-02-08 18:10:37 UTC (rev 5961)
@@ -66,7 +66,7 @@
<name>accept</name>
<classname>java.lang.String</classname>
<description>a comma-separated list of content types to accept, may not be supported by the browser. E.g. "images/png,images/jpg", "images/*".</description>
- </property>
+ </property>
<property elonly="true">
<name>data</name>
<classname>java.lang.Object</classname>
@@ -86,6 +86,46 @@
<name>fileSize</name>
<classname>java.lang.Integer</classname>
<description>this value binding receives the file size (optional).</description>
+ </property>
+ <property>
+ <name>addStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style for add button</description>
+ </property>
+ <property>
+ <name>addStyleDisabled</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style for add button disabled</description>
+ </property>
+ <property>
+ <name>uploadStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style for upload button</description>
+ </property>
+ <property>
+ <name>uploadStyleDisabled</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style for upload button disabled</description>
+ </property>
+ <property>
+ <name>cancelStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style for cancel button</description>
+ </property>
+ <property>
+ <name>cancelStyleDisabled</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style for cancel button disabled</description>
+ </property>
+ <property>
+ <name>cleanStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style for clean button</description>
+ </property>
+ <property>
+ <name>cleanStyleDisabled</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style for clean button disabled</description>
</property>
</component>
</components>
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-08 17:50:25 UTC (rev 5960)
+++ trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/UIFileUpload.java 2008-02-08 18:10:37 UTC (rev 5961)
@@ -21,10 +21,12 @@
*/
public abstract class UIFileUpload extends UIInput {
- public static final String READY = "ready";
+ public static final String READY = "1";
- public static final String UPLOADING = "uploading";
+ public static final String UNDER_UPLOAD = "2";
+ public static final String UPLOADING = "3";
+
private String uploadStatus = READY;
private String localContentType;
@@ -92,7 +94,20 @@
// }
// }
// }
+
+ public boolean isReady () {
+ return this.getUploadStatus() == READY;
+ }
+
+ public boolean isUploading () {
+ return (this.getUploadStatus() == UPLOADING || this.getUploadStatus() == UNDER_UPLOAD);
+ }
+
+ public boolean hasChildren () {
+ return this.getFileItems().size() > 0;
+ }
+
public String getLocalContentType() {
return localContentType;
}
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-08 17:50:25 UTC (rev 5960)
+++ trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java 2008-02-08 18:10:37 UTC (rev 5961)
@@ -17,6 +17,8 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.ajax4jsf.context.AjaxContext;
@@ -49,7 +51,7 @@
private static final String ACTION_UPLOAD_ALL = "uploadall";
/** Upload file action name */
- private static final String ACTION_UPLOAD = "upload";
+ private static final String ACTION_NEXT = "next";
/** Clear file action name */
private static final String ACTION_CLEAR_FILE = "clear";
@@ -59,12 +61,17 @@
/** Stop file uploading action name */
private static final String ACTION_STOP_FILE = "stop";
+
+ private static final String ACTION_STOP_ALL = "stopall";
/** 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$";
+
+
+ private static final String _reRenderAllFlag = "reRenderAll";
/* (non-Javadoc)
* @see org.ajax4jsf.renderkit.RendererBase#doDecode(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
@@ -108,6 +115,7 @@
fileUpload.setLocalFileSize(multipartRequest.getFileSize(clientId));
onUploadComplete(context, multipartRequest.getFileName(clientId),
fileUpload);
+
}
}
@@ -142,10 +150,10 @@
@Override
public void encodeBegin(FacesContext context, UIComponent component)
throws IOException {
- AjaxContext ajaxContext = AjaxContextImpl.getCurrentInstance();
- ajaxContext.removeRenderedArea(component.getClientId(context));
- ajaxContext.addRenderedArea(component.getClientId(context)
- + ":fileItems");
+ AjaxContext ajaxContext = AjaxContextImpl.getCurrentInstance();
+ ajaxContext.removeRenderedArea(component.getClientId(context));
+ ajaxContext.addRenderedArea(component.getClientId(context)
+ + ":fileItems");
}
public String encodeStatus(UIFileUpload fileUpload) {
@@ -164,6 +172,11 @@
}
fileUpload.setUploadStatus(UIFileUpload.READY);
storeData(context, fileUpload);
+ try {
+ context.responseComplete();
+ }catch (Exception e) {
+ e.getMessage();
+ }
}
private FileItem getFileByName(UIFileUpload fileUpload, String name) {
@@ -234,22 +247,27 @@
.getRequestParameterValuesMap();
UIFileUpload fileUpload = (UIFileUpload) component;
String action = params.get(getActionParameterName(clientId))[0];
+ boolean reRenderAll = false;
if (ACTION_ADD_FILE.equals(action)) {
processAddFileAction(context, fileUpload, params);
} else if (ACTION_UPLOAD_ALL.equals(action)) {
processUploadAllAction(context, fileUpload);
+ reRenderAll = true;
} else if (ACTION_CLEAR_ALL.equals(action)) {
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_NEXT.equals(action)) {
+ processNextAction(context, fileUpload);
} else if (ACTION_STOP_FILE.equals(action)) {
+ reRenderAll = true;
processStopFileAction(context, fileUpload, params);
+ } else if (ACTION_STOP_ALL.equals(action)) {
+ processStopAllAction(context, fileUpload, params);
+ reRenderAll = true;
}
-
}
-
+
private void processClearAction(FacesContext context,
UIFileUpload fileUpload, Map<String, String[]> params) {
if (params.containsKey(ACTION_CLEAR_FILE)) {
@@ -270,9 +288,21 @@
item.setStatus(FileItem.Status.CANCELLED);
}
}
- fileUpload.setUploadStatus(UIFileUpload.READY);
+ //fileUpload.setUploadStatus(UIFileUpload.READY);
+ processNextAction(context, fileUpload);
}
}
+
+
+ private void processStopAllAction(FacesContext context,
+ UIFileUpload fileUpload, Map<String, String[]> params) {
+ for (FileItem item : fileUpload.getFileItems()) {
+ if (item.getStatus() == FileItem.Status.IN_PROGRESS) {
+ item.setStatus(FileItem.Status.CANCELLED);
+ }
+ }
+ fileUpload.setUploadStatus(UIFileUpload.READY);
+ }
private void processClearAllAction(UIFileUpload fileUpload) {
List<FileItem> toDelete = new ArrayList<FileItem>();
@@ -298,18 +328,22 @@
}
}
- private void processUploadAction(FacesContext context,
+ private void processNextAction(FacesContext context,
UIFileUpload fileUpload) {
- if (UIFileUpload.READY.equals(fileUpload.getUploadStatus())) {
+ if (UIFileUpload.UPLOADING.equals(fileUpload.getUploadStatus())) {
Iterator<FileItem> it = fileUpload.getFileItems().iterator();
+ boolean found = false;
while (it.hasNext()) {
FileItem item = it.next();
if (item.getStatus() == FileItem.Status.MARKED_4_UPLOAD) {
item.setStatus(FileItem.Status.IN_PROGRESS);
+ fileUpload.setUploadStatus(UIFileUpload.UNDER_UPLOAD);
+ getSession(context).setAttribute(_percentBeanName, 0);
+ found = true;
break;
}
}
- getSession(context).setAttribute(_percentBeanName, 0);
+ if (!found) fileUpload.setUploadStatus(UIFileUpload.READY);
}
}
@@ -321,14 +355,17 @@
FileItem toUpload = null;
while (it.hasNext()) {
FileItem item = it.next();
- item.setStatus(FileItem.Status.MARKED_4_UPLOAD);
- if (toUpload == null) {
- toUpload = item;
+ if (item.getStatus() == FileItem.Status.ADDED) {
+ item.setStatus(FileItem.Status.MARKED_4_UPLOAD);
+ if (toUpload == null) {
+ toUpload = item;
+ }
}
}
if (toUpload != null) {
toUpload.setStatus(FileItem.Status.IN_PROGRESS);
+ fileUpload.setUploadStatus(UIFileUpload.UNDER_UPLOAD);
getSession(context).setAttribute(_percentBeanName, 0);
}
@@ -350,16 +387,6 @@
return clientId + "_action";
}
- private String getProgressBarParameterName(UIComponent fileUpload) {
- UIComponent form = AjaxRendererUtils.getNestingForm(fileUpload);
- String formId = null;
- if (form != null) {
- formId = form.getId();
- return formId + ":progressBar_percent";
- }
- return "progressBar_percent";
- }
-
private HttpSession getSession(FacesContext context) {
if (context.getExternalContext() != null) {
return (HttpSession) context.getExternalContext().getSession(false);
@@ -381,11 +408,10 @@
throws IOException {
Writer writer = context.getResponseWriter();
String clientId = component.getClientId(context);
- StringBuffer current = new StringBuffer();
StringBuffer script = new StringBuffer("\n");
- current.append("FileUpload.Uploaders['");
- current.append(clientId);
- current.append("']");
+ script.append("new FileUpload('");
+ script.append(clientId);
+ script.append("','");
UIComponent container = (UIComponent) AjaxRendererUtils
.findAjaxContainer(context, component);
@@ -396,20 +422,51 @@
String actionUrl = AjaxContextImpl.getCurrentInstance(context)
.getAjaxActionURL(context);
- script.append(current);
- script.append(" = {};\n");
- script.append(current).append("['containerId'] = '")
- .append(containerId).append("';\n");
- script.append(current).append("['formId'] = '").append(formId).append(
- "';\n");
- script.append(current).append("['actionUrl'] = '").append(actionUrl)
- .append("';\n");
- script.append("new FileUpload().init('");
- script.append(clientId);
- script.append("');\n");
+ script.append(containerId).append("','");
+ script.append(formId).append("','");
+ script.append(actionUrl).append("',");
+ script.append(getUploadAllClick(context, component));
+ script.append(",");
+ script.append(getStopAllClick(context, component));
+ script.append(",'");
+ script.append(component.getAttributes().get("addStyle"));
+ script.append("','");
+ script.append(component.getAttributes().get("addStyleDisabled"));
+ script.append("','");
+ script.append(component.getAttributes().get("uploadStyle"));
+ script.append("','");
+ script.append(component.getAttributes().get("uploadStyleDisabled"));
+ script.append("','");
+ script.append(component.getAttributes().get("cancelStyle"));
+ script.append("','");
+ script.append(component.getAttributes().get("cancelStyleDisabled"));
+ script.append("','");
+ script.append(component.getAttributes().get("cleanStyle"));
+ script.append("','");
+ script.append(component.getAttributes().get("cleanStyleDisabled"));
+ script.append("');");
+
writer.write(script.toString());
}
+
+ public void encodeUpdateButtonScript(FacesContext context, UIComponent component)
+ throws IOException {
+ UIFileUpload fileUpload = (UIFileUpload) component;
+ String cliendId = fileUpload.getClientId(context);
+ Writer writer = context.getResponseWriter();
+
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(getJSScriptStart(cliendId));
+ buffer.append(".updateUploadButton(").append(fileUpload.isUploading() ? "true," : "false,")
+ .append(fileUpload.hasChildren() ? "false" : "true").append(");\n");
+
+ buffer.append(getJSScriptStart(cliendId)).append(".updateAddButton(false);\n");
+
+ buffer.append(getJSScriptStart(cliendId)).append(".updateCleanButton(")
+ .append(fileUpload.hasChildren() ? "false" : "true").append(");\n");
+ writer.write(buffer.toString());
+ }
public void encodeUploadScript(FacesContext context, UIComponent component)
throws IOException {
@@ -427,19 +484,13 @@
StringBuffer buffer = getJSScriptStart(cliendId);
buffer.append(".upload('");
buffer.append(convertFileName(item.getFullFileName()));
- buffer.append("');");
+ buffer.append("');\n");
writer.write(buffer.toString());
fileUpload.setUploadStatus(UIFileUpload.UPLOADING);
return; // Only one file can be in progress status
}
}
- } else {
-// StringBuffer buffer = new StringBuffer();
-// buffer.append("A4J.AJAX.StopPoll(FileUpload.Uploaders['");
-// buffer.append(cliendId);
-// buffer.append("']['formId'] + ':progressBar');\n");
-// writer.write(buffer.toString());
- }
+ }
}
/**
@@ -503,7 +554,8 @@
public boolean isCanClear (FileItem item) {
return item.getStatus() != FileItem.Status.IN_PROGRESS;
}
-
+
+
private UIComponent findProgressBar(UIComponent fileUpload) {
UIComponent progressBar = null;
for (UIComponent child : fileUpload.getChildren()) {
@@ -550,16 +602,53 @@
}
private StringBuffer getJSScriptStart(String clientId) {
- StringBuffer buffer = new StringBuffer("new FileUpload('");
- buffer.append(clientId).append("')");
+ StringBuffer buffer = new StringBuffer("$('");
+ buffer.append(clientId).append("').component");
return buffer;
}
+
+ public String getControlLabel (FacesContext context, UIComponent component) {
+ UIFileUpload fileUpload = (UIFileUpload) component;
+ return (UIFileUpload.READY.equals(fileUpload.getUploadStatus()) ? "Upload" : "Cancel");
+ }
- public String getUploadAllClick(FacesContext context, UIComponent component) {
+ public JSFunctionDefinition getUploadAllClick(FacesContext context, UIComponent component) {
String clientId = component.getClientId(context);
+ JSFunctionDefinition definition = new JSFunctionDefinition();
+ StringBuffer script = new StringBuffer();
+ UIFileUpload fileUpload = (UIFileUpload) component;
+ if (UIFileUpload.READY.equals(fileUpload.getUploadStatus())) {
+ Map parameters = new HashMap();
+ parameters.put(getActionParameterName(clientId), ACTION_UPLOAD_ALL);
+ script.append(getOnClick(context, component, clientId, parameters,
+ null));
+ definition.addToBody(script);
+ }
+ return definition;
+ }
+
+ public String getUploadAllStyle(UIComponent component) {
+ UIFileUpload fileUpload = (UIFileUpload) component;
+ if (fileUpload.isReady()) {
+ return (String) component.getAttributes().get("uploadStyle");
+ }
+ return "";
+ }
+
+ public String getUploadAllDisabled (UIComponent component) {
+ UIFileUpload fileUpload = (UIFileUpload) component;
+ return fileUpload.hasChildren() ? "false" : "true";
+ }
+
+ public JSFunctionDefinition getStopAllClick(FacesContext context, UIComponent component) {
+ String clientId = component.getClientId(context);
+ JSFunctionDefinition definition = new JSFunctionDefinition();
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(
+ this, component);
Map parameters = new HashMap();
- parameters.put(getActionParameterName(clientId), ACTION_UPLOAD_ALL);
- return getOnClick(context, component, clientId, parameters, null);
+ parameters.put(getActionParameterName(clientId), ACTION_STOP_ALL);
+ definition.addToBody(getOnClick(context, component, clientId, parameters, null));
+ return definition;
}
public String getStopFileClick(FacesContext context, UIComponent component) {
@@ -610,7 +699,6 @@
StringBuffer body = getJSScriptStart(clientId)
.append(".addFile();");
-
Object oncomplete = getOnComplete(context, component, body);
Map parameters = new HashMap();
parameters.put(getActionParameterName(clientId), ACTION_ADD_FILE);
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-08 17:50:25 UTC (rev 5960)
+++ trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss 2008-02-08 18:10:37 UTC (rev 5961)
@@ -39,11 +39,12 @@
cursor : pointer;
padding : 1px;
}
+
.upload_button_dis{
- background : #C0C0C0; /*tableBorderColor*/
- border : 1px solid #C0C0C0; /*tableBorderColor*/
- margin-bottom : 3px;
- padding : 1px}
+ background :#f1f1f1 /*trimColor*/ repeat-x;
+ cursor : pointer;
+ padding : 2px;
+}
.upload_button_press{
background-repeat: repeat x top left #EAF0F8;
@@ -69,9 +70,12 @@
.upload_ico{background-position : 0px 50%; background-repeat : no-repeat; padding-left : 19px}
.upload_ico_add{}
+.upload_ico_add_dis{color:#C0C0C0; /*tableBorderColor*/}
.upload_ico_start{}
+.upload_ico_start_dis{color:#C0C0C0; /*tableBorderColor*/}
.upload_ico_stop{}
.upload_ico_clear{}
+.upload_ico_clear_dis{color:#C0C0C0; /*tableBorderColor*/}
input.hidden {
Z-INDEX: 2;
@@ -108,12 +112,24 @@
</u:style>
</u:selector>
+<u:selector name=".upload_ico_add_dis">
+ <u:style name="background-image">
+ <f:resource f:key="/org/richfaces/renderkit/html/images/ico_add_dis.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_start_dis">
+ <u:style name="background-image">
+ <f:resource f:key="/org/richfaces/renderkit/html/images/ico_start_dis.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" />
@@ -125,5 +141,11 @@
<f:resource f:key="/org/richfaces/renderkit/html/images/ico_clear.gif" />
</u:style>
</u:selector>
+
+<u:selector name=".upload_ico_clear_dis">
+ <u:style name="background-image">
+ <f:resource f:key="/org/richfaces/renderkit/html/images/ico_clear_dis.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-08 17:50:25 UTC (rev 5960)
+++ trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-02-08 18:10:37 UTC (rev 5961)
@@ -2,13 +2,26 @@
FileUpload = Class.create();
FileUpload.Uploaders = {};
Object.extend(FileUpload.prototype, {
- initialize: function() {
- if (arguments.length > 0) {
- var id = arguments[0];
- this.id = id;
- this.f = $(id + ":files");
- this.fm = $(id + ":f");
- }
+ initialize: function(id, containerId, formId, actionUrl, onUploadAllClick , onStopAllClick, addStyle, addStyleDisabled, uploadStyle, uploadStyleDisabled, cancelStyle, cancelStyleDisabled, cleanStyle, cleanStyleDisabled) {
+ this.id = id;
+ this.containerId = containerId;
+ this.formId = formId;
+ this.actionUrl = actionUrl;
+ this.createForm();
+ this.f = $(id + ":files");
+ this.fm = $(id + ":f");
+ this.fr = $(id + ":fr");
+ this.onUploadAllClick = function () { onUploadAllClick(); }
+ this.onStopAllClick = function () { onStopAllClick(); }
+ this.addStyle = addStyle;
+ this.addStyleDisabled = addStyleDisabled;
+ this.uploadStyle = uploadStyle;
+ this.uploadStyleDisabled = uploadStyleDisabled;
+ this.cancelStyle = cancelStyle;
+ this.cancelStyleDisabled = cancelStyleDisabled;
+ this.cleanStyle = cleanStyle;
+ this.cleanStyleDisabled = cleanStyleDisabled;
+ $(this.id).component = this;
},
renderControl: function (template, context) {
if (!template) {
@@ -17,11 +30,46 @@
var html = template.invoke('getContent', context).join('');
$(this.id + ":header").innerHTML = html;
},
+ setClassName: function (o , className) {
+ o.className = className;
+ },
+ updateCleanButton: function(disabled) {
+ this.updateButton($(this.id+":clean1"),$(this.id+":clean2"),this.cleanStyle,this.cleanStyleDisabled,"clear",disabled);
+ },
+ updateAddButton: function(disabled) {
+ this.updateButton($(this.id+":add1"),$(this.id+":add2"),this.addStyle,this.addStyleDisabled,"add",disabled);
+ },
+ updateUploadButton: function (isCancel, disabled) {
+ var d = $(this.id + ":upload1");
+ var l = $(this.id + ":upload2");
+ if (d && l) {
+ var label = (isCancel) ? "<b>Cancel</b>" : "<b>Upload</b>";
+ if (isCancel) {
+ l.innerHTML = label;
+ this.updateButton(d,l,this.cancelStyle,this.cancelStyleDisabled,"start",disabled);
+ d.onclick = function () { if (this.getFilesCount() > 0) { event = null; this.stopAll(); this.onStopAllClick(); } }.bind(this);
+ }else {
+ l.innerHTML = label;
+ this.updateButton(d,l,this.uploadStyle,this.uploadStyleDisabled,"start",disabled);
+ d.onclick = function () { if (this.getFilesCount() > 0) { event = null; this.onUploadAllClick(); } }.bind(this);
+ }
+
+ }
+ },
+ updateButton: function (o1,o2, style, styleDis, prefix ,disabled) {
+ if (disabled) {
+ this.setClassName(o1, "upload_button_dis upload_font "+ styleDis);
+ this.setClassName(o2, "upload_button_content upload_font upload_ico upload_ico_"+prefix+"_dis "+styleDis);
+ }else {
+ this.setClassName(o1, "upload_button upload_font "+ style);
+ this.setClassName(o2, "upload_button_content upload_font upload_ico upload_ico_"+prefix+" "+style);
+ }
+ },
init: function (id) {
this.id = id;
this.createForm();
},
- addFile: function (){
+ addFile: function (disabled){
var o = $(this.id + ":file");
var parent = o.parentNode;
@@ -50,6 +98,7 @@
upload: function (name) {
var v = this.findFileByName(name);
this.addViewState();
+ this.prepareUpload();
if (v) {
v.disabled = false;
v.name = this.id + ":1";
@@ -57,22 +106,34 @@
this.fm.submit();
}
},
+ next: function (ev) {
+ var f = {};
+ f[this.id] = this.id;
+ f[this.id + "_action"] = "next";
+ A4J.AJAX.Submit(this.containerId,this.formId,ev,{'parameters':f ,'actionUrl':this.actionUrl} );
+ },
onFileUploaded: function (ev) {
- var o = $(this.id + ":1");
- if (o) {
- o.disabled = true;
- o.name = "done";
- o.id = o.name;
+ var d = $(this.id).component;
+ if (d.canceled == true) {
+ d.canceled = false;
+ return;
}
- var formId = FileUpload.Uploaders[this.id]['formId'];
- var containerId = FileUpload.Uploaders[this.id]['containerId'];
- var actionUrl = FileUpload.Uploaders[this.id]['actionUrl'];
- var f = {};
- f[this.id] = this.id;
- f[this.id + "_action"] = "upload";
- new ProgressBar(formId + ":progressBar").disable();
- A4J.AJAX.Submit(containerId,formId,ev,{'parameters':f ,'actionUrl':actionUrl} );
+ var i = $(this.id + ":1");
+ if (i) {
+ this.finishProgressBar();
+ i.disabled = true;
+ i.id = "";
+ i.name = "";
+ this.next(ev);
+ }
},
+ finishProgressBar: function () {
+ var prBar = $(this.formId + ":progressBar");
+ if (prBar) {
+ prBar.component.disable();
+ prBar.component.setValue(100);
+ }
+ },
createForm: function () {
if ($(this.id + ":fr")) return;
var fr = document.createElement("iframe");
@@ -80,13 +141,17 @@
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; f.onFileUploaded(event);");
+ fr.onload = function(request, event, data) {
+ this.onFileUploaded(event);
+ }.bind(this);
+
+ //new Function ("event"," var f = new FileUpload('"+this.id+"'); if (f.getFilesCount() == 0) return; f.onFileUploaded(event);");
document.body.appendChild(fr);
var f = document.createElement("form");
f.enctype = "multipart/form-data";
- f.action = FileUpload.Uploaders[this.id]['actionUrl'];
+ f.action = this.actionUrl;
f.method = "post";
f.id = this.id + ":f";
f.target = this.id + ":fr";
@@ -99,7 +164,7 @@
//--
d = document.createElement("input");
d.type="hidden";
- d.name = FileUpload.Uploaders[this.id]['formId'];
+ d.name = this.formId;
d.value = d.name;
f.appendChild(d);
@@ -115,14 +180,25 @@
this.removeChilds(this.f);
},
stop: function () {
- new ProgressBar(FileUpload.Uploaders[this.id]['formId']+":progressBar").disable();
+ this.canceled = true;
+ $(this.formId+":progressBar").component.disable();
var fr = $(this.id + ":fr");
fr.src = "about:blank";
var f = $(this.id + ":1");
if (f) {
- f.disable = true;
+ f.disabled = true;
f.id = "add";
f.name = f.id;
+ }
+ },
+ stopAll: function () {
+ this.stop();
+ },
+ prepareUpload: function () {
+ for (var i = 0; i < this.f.childNodes.length; i++) {
+ this.f.childNodes[i].disabled = true;
+ this.f.childNodes[i].name="";
+ this.f.childNodes[i].id="";
}
},
removeChilds: function (f) {
@@ -132,42 +208,21 @@
}
}
},
- reduceTimeout: function (id, label, style) {
- var o = $(id);
- if (o) {
- this.reduce(o, o.onclick, label, style );
- }
+ reduce: function (confirmId, id) {
+ var confirm = $(confirmId);
+ var d = $(id);
+ if (confirm)
+ Element.hide(confirm);
+ if (d)
+ Element.show(d);
+ return false;
},
- 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 (confirmId, id) {
+ Element.show($(confirmId));
+ Element.hide($(id));
+ window.setTimeout("$('"+this.id+"').component.reduce('"+confirmId+"','"+id+"');", 3000);
+ return false;
},
- 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];
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-08 17:50:25 UTC (rev 5960)
+++ trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-02-08 18:10:37 UTC (rev 5961)
@@ -24,13 +24,21 @@
<div class="upload_list_width upload_list_decor" id="#{clientId}">
+<span style="display: none">
+ <script type="text/javascript">
+ <f:call name="encodeInitialScript" />
+ </script>
+</span>
+
<table class="upload_toolbar_decor">
<tr>
<td>
<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" style="">Add...</div>
+ <div class="upload_button upload_font #{component.attributes['addStyle']}" 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"
+ id="#{clientId}:add1">
+ <div class="upload_button_content upload_font upload_ico upload_ico_add #{component.attributes['addStyle']}"
+ id="#{clientId}:add2">Add...</div>
<input type="file" style="cursor: pointer; z-index: 3; width: 0px; height: 22px; left: 0px; top: 0px; position: absolute"
class="hidden"
id="#{clientId}:file"
@@ -39,21 +47,25 @@
</div>
</div>
<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'"
+ <div class="upload_button_dis upload_font #{component.attributes['uploadStyleDisabled']}" 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="javascript: if ((new FileUpload('#{clientId}').getFilesCount()) > 0) { #{this:getUploadAllClick(context, component)} }">
+ id="#{clientId}:upload1">
<a href="#" class="upload_button_selection">
- <div class="upload_button_content upload_font upload_ico upload_ico_start"><b>Upload</b>
+ <div class="upload_button_content upload_font upload_ico upload_ico_start_dis #{component.attributes['uploadStyleDisabled']}"
+ id="#{clientId}:upload2">
+ <b>Upload</b>
</div>
</a>
</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'"
+ <div class="upload_button_dis upload_font #{component.attributes['cleanStyleDisabled']}" 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)}">
+ onclick="if ($('#{clientId}').component.getFilesCount() > 0) { #{this:getClearAllClick(context, component)} }"
+ id="#{clientId}:clean1">
<a href="#" class="upload_button_selection">
- <div class="upload_button_content upload_font upload_ico upload_ico_clear">Clear All</div>
+ <div class="upload_button_content upload_font upload_ico upload_ico_clear_dis #{component.attributes['cleanStyleDisabled']}"
+ id="#{clientId}:clean2">Clean All</div>
</a>
</div>
</div>
@@ -89,8 +101,8 @@
renderProgress(context, component, item);
]]>
</jsp:scriptlet>
- <br/>
+
<div class="upload_name_padding">
<b>
<jsp:scriptlet>
@@ -110,10 +122,13 @@
]]>
</jsp:scriptlet>
<div class="upload_font upload_del">
- <a href="#" class="upload_anc"
- onmousedown="return new FileUpload().confirm(this,'Clear','text-decoration:none; color:black','#{clientId}:clear#{n}');"
- onclick="#{this:getClearFileClick(context, component)}"
- style="text-decoration: none; color:black">Clear</a>
+ <a href="#" class="upload_anc" id="#{clientId}:clear#{n}"
+ onclick="return $('#{clientId}').component.confirm('#{clientId}:cconfirm#{n}','#{clientId}:clear#{n}');"
+ style="text-decoration: none; color:black">Clear</a>
+ <span id="#{clientId}:cconfirm#{n}" style="display:none">
+ <a href="#" onclick="#{this:getClearFileClick(context, component)}" style="text-decoration: none; color:black">Yes</a>
+ <a href="#" onclick="$('#{clientId}').component.reduce('#{clientId}:cconfirm#{n}','#{clientId}:clear#{n}');" style="text-decoration: none; padding-left: 10px; color:black">No</a>
+ </span>
</div>
<jsp:scriptlet>
<![CDATA[
@@ -121,10 +136,13 @@
]]>
</jsp:scriptlet>
<div class="upload_font upload_del">
- <a href="#" class="upload_anc"
- onmousedown="return new FileUpload().confirm(this,'Stop','text-decoration:none; color:black','#{clientId}:stop#{n}');"
- onclick="new FileUpload('#{clientId}').stop(); #{this:getStopFileClick(context, component)}"
+ <a href="#" class="upload_anc" id="#{clientId}:stop#{n}"
+ onclick="return $('#{clientId}').component.confirm('#{clientId}:sconfirm#{n}','#{clientId}:stop#{n}');"
style="text-decoration: none; color:black">Stop</a>
+ <span id="#{clientId}:sconfirm#{n}" style="display:none">
+ <a href="#" onclick="$('#{clientId}').component.stop(); #{this:getStopFileClick(context, component)}" style="text-decoration: none; color:black">Yes</a>
+ <a href="#" onclick="$('#{clientId}').component.reduce('#{clientId}:sconfirm#{n}','#{clientId}:stop#{n}');" style="text-decoration: none; padding-left: 10px; color:black">No</a>
+ </span>
</div>
<jsp:scriptlet>
@@ -148,17 +166,13 @@
<span>
<script type="text/javascript">
+ <f:call name="encodeUpdateButtonScript" />
<f:call name="encodeUploadScript" />
</script>
</span>
</div>
- <span>
- <script type="text/javascript">
- <f:call name="encodeInitialScript" />
- </script>
- </span>
</div>
18 years, 2 months
JBoss Rich Faces SVN: r5960 - in trunk/sandbox/ui/inplaceInput/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-08 12:50:25 -0500 (Fri, 08 Feb 2008)
New Revision: 5960
Modified:
trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
component's attributes are added
Modified: trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-02-08 17:11:17 UTC (rev 5959)
+++ trunk/sandbox/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-02-08 17:50:25 UTC (rev 5960)
@@ -16,13 +16,21 @@
},
initHandlers : function() {
- this.inplaceInput.observe(this.attributes['editEvent'], function(e){this.switchingStatesHandler(e);}.bindAsEventListener(this));
+ this.inplaceInput.observe(this.attributes.editEvent, function(e){this.switchingStatesHandler(e);}.bindAsEventListener(this));
},
switchingStatesHandler : function() {
+ this.endViewState();
+ this.tempValueKeeper.show();
this.currentState = Richfaces.InplaceInput.STATES[1];
+ },
+
+ endViewState : function() {
+ var viewValue = (this.inplaceInput.textContent) ? this.inplaceInput.textContent : this.inplaceInput.textNode;
+ this.inplaceInput.removeNode(viewValue);
}
+
};
Richfaces.InplaceInput.STATES = [0, 1, 2];// 0 - view, 1- editable, 2 - changed
\ No newline at end of file
Modified: trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-08 17:11:17 UTC (rev 5959)
+++ trunk/sandbox/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-02-08 17:50:25 UTC (rev 5960)
@@ -31,15 +31,15 @@
<input id='#{clientId}value' type='hidden' value='#{component.attributes["value"]}'/>
</span>
<script type="text/javascript">
- var attributes = [defaultLabel = '#{component.attributes["defaultLabel"]}',
- showControls = '#{component.attributes["showControls"]}',
- apllyFromControlsOnly = '{component.attributes["apllyFromControlsOnly"]}',
- editEvent = '#{component.attributes["editEvent"]}'];
+ var attributes = {defaultLabel : '#{component.attributes["defaultLabel"]}',
+ showControls : '#{component.attributes["showControls"]}',
+ apllyFromControlsOnly : '#{component.attributes["apllyFromControlsOnly"]}',
+ editEvent : '#{component.attributes["editEvent"]}'};
- var events = [oneditactivation = '#{component.attributes["oneditactivation"]}',
- onviewactivation = '#{component.attributes["defaultLabel"]}',
- oneditactivated = '#{component.attributes["onviewactivation"]}',
- onviewactivated = '#{component.attributes["onviewactivated"]}'];
+ var events = {oneditactivation : '#{component.attributes["oneditactivation"]}',
+ onviewactivation : '#{component.attributes["onviewactivation"]}',
+ oneditactivated : '#{component.attributes["onviewactivation"]}',
+ onviewactivated : '#{component.attributes["onviewactivated"]}'};
var inplaceInput = new Richfaces.InplaceInput('#{clientId}', '#{clientId}tempValue', '#{clientId}value', attributes, events);
</script>
18 years, 2 months
JBoss Rich Faces SVN: r5959 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vsukhov
Date: 2008-02-08 12:11:17 -0500 (Fri, 08 Feb 2008)
New Revision: 5959
Modified:
trunk/docs/userguide/en/src/main/docbook/included/comboBox.xml
Log:
RF-1216 Skin Parameters Redefinition and Definition of Custom Style Classes --done.
Modified: trunk/docs/userguide/en/src/main/docbook/included/comboBox.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/comboBox.xml 2008-02-08 17:05:47 UTC (rev 5958)
+++ trunk/docs/userguide/en/src/main/docbook/included/comboBox.xml 2008-02-08 17:11:17 UTC (rev 5959)
@@ -208,7 +208,7 @@
<title>Skin Parameters Redefinition</title>
<table>
- <title>Skin parameters redefinition for </title>
+ <title>Skin parameters redefinition for a shadow</title>
<tgroup cols="2">
<thead>
<row>
@@ -218,16 +218,147 @@
</thead>
<tbody>
<row>
- <entry></entry>
- <entry></entry>
+ <entry>generalBackgroundColor</entry>
+ <entry>background-color</entry>
</row>
<row>
- <entry></entry>
- <entry></entry>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background</entry>
</row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a button</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>buttonBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>buttonBorderColor</entry>
+ <entry>border-top-color</entry>
+ </row>
+ <row>
+ <entry>buttonBorderColor</entry>
+ <entry>border-left-color</entry>
+ </row>
+ <row>
+ <entry>buttonBorderColor</entry>
+ <entry>border-bottom-color</entry>
+ </row>
+ <row>
+ <entry>buttonBorderColor</entry>
+ <entry>border-right-color</entry>
+ </row>
</tbody>
</tgroup>
</table>
+ <table>
+ <title>Skin parameters redefinition for a popup list</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>itemSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>itemFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>itemTextColor</entry>
+ <entry>color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for a default message</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background</entry>
+ </row>
+ <row>
+ <entry>itemTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>itemSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>itemFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for a popup list</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background</entry>
+ </row>
+ <row>
+ <entry>itemTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>itemSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>itemFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
</section>
<section>
<title>Definition of Custom Style Classes</title>
@@ -244,7 +375,7 @@
</figure-->
<table>
- <title>Classes names that define </title>
+ <title>Classes names that define shadow representation</title>
<tgroup cols="2">
<thead>
<row>
@@ -254,13 +385,113 @@
</thead>
<tbody>
<row>
- <entry></entry>
- <entry></entry>
+ <entry>rich-combobox-shadow-tl</entry>
+ <entry>Defines styles for a top-left shadow</entry>
</row>
+ <row>
+ <entry>rich-combobox-shadow-tr</entry>
+ <entry>Defines styles for a top-right shadow</entry>
+ </row>
+ <row>
+ <entry>rich-combobox-shadow-bl</entry>
+ <entry>Defines styles for a bottom-left shadow</entry>
+ </row>
+ <row>
+ <entry>rich-combobox-shadow-br</entry>
+ <entry>Defines styles for a bottom-right shadow</entry>
+ </row>
</tbody>
</tgroup>
</table>
- <para>In order to redefine styles for all <emphasis role="bold"><property><rich:comboBox></property></emphasis> components on a page using CSS,
+ <table>
+ <title>Classes names that define button representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-combobox-button-background</entry>
+ <entry>Defines styles for a button background</entry>
+ </row>
+ <row>
+ <entry>rich-combobox-button-inactive</entry>
+ <entry>Defines styles for an inactive button</entry>
+ </row>
+ <row>
+ <entry>rich-combobox-button-icon-inactive</entry>
+ <entry>Defines styles for an inactive button icon</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Classes names that define font representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-combobox-font</entry>
+ <entry>Defines styles for a font</entry>
+ </row>
+ <row>
+ <entry>rich-combobox-font-inactive</entry>
+ <entry>Defines styles for an inactive font</entry>
+ </row>
+ <row>
+ <entry>rich-combobox-font-disabled</entry>
+ <entry>Defines styles for a disabled font</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Classes names that define default message representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-combobox-input-inactive</entry>
+ <entry>Defines styles for an inactive input</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Classes names that define popup list representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-combobox-item</entry>
+ <entry>Defines styles for an item</entry>
+ </row>
+ <row>
+ <entry>rich-combobox-list-decoration</entry>
+ <entry>Defines styles for a list</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>In order to redefine styles for all <emphasis role="bold"><property><rich:comboBox></property></emphasis> components on a page using CSS,
it's enough to create classes with the same names and define necessary properties in them.
</para>
<para>To change styles of particular <emphasis role="bold"><property><rich:comboBox></property></emphasis> components,
18 years, 2 months
JBoss Rich Faces SVN: r5958 - in trunk/sandbox/samples/inplaceInput-sample/src/main/webapp: WEB-INF and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-02-08 12:05:47 -0500 (Fri, 08 Feb 2008)
New Revision: 5958
Added:
trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/index.jsp
Modified:
trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.jsp
trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.xhtml
Log:
inplaceInput demo
Modified: trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/WEB-INF/web.xml 2008-02-08 16:51:08 UTC (rev 5957)
+++ trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/WEB-INF/web.xml 2008-02-08 17:05:47 UTC (rev 5958)
@@ -2,37 +2,31 @@
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Archetype Created Web Application</display-name>
+
+ <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</param-value>
+ </context-param>
<context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+ <context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
- <!-- Use Documents Saved as *.xhtml -->
- <context-param>
- <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
- <param-value>.jsp</param-value>
- </context-param>
-
- <!-- Facelets pages will use the .xhtml extension -->
<context-param>
- <param-name>facelets.VIEW_MAPPINGS</param-name>
- <param-value>*xhtml</param-value>
- </context-param>
-
- <context-param>
- <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
- <param-value>com.sun.facelets.FaceletViewHandler</param-value>
- </context-param>
-
- <context-param>
- <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
- <param-value>false</param-value>
- </context-param>
- <!--
- -->
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+</context-param>
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
@@ -44,21 +38,20 @@
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
- <dispatcher>ERROR</dispatcher>
</filter-mapping>
- <!-- Faces Servlet -->
- <servlet>
- <servlet-name>Faces Servlet</servlet-name>
- <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
- </servlet>
-
- <!-- Use prefix mapping for Facelets pages, e.g. http://localhost:8080/webapp/faces/mypage.xhtml -->
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>/faces/*</url-pattern>
- </servlet-mapping>
-
-
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
Copied: trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/index.jsp (from rev 5860, trunk/samples/listShuttleDemo/src/main/webapp/index.jsp)
===================================================================
--- trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/index.jsp (rev 0)
+++ trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/index.jsp 2008-02-08 17:05:47 UTC (rev 5958)
@@ -0,0 +1,11 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
+<html>
+
+<head></head>
+
+ <body>
+ <jsp:forward page="/pages/index.jsf" />
+ </body>
+
+</html>
\ No newline at end of file
Modified: trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.jsp 2008-02-08 16:51:08 UTC (rev 5957)
+++ trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.jsp 2008-02-08 17:05:47 UTC (rev 5958)
@@ -0,0 +1,27 @@
+<%@ 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/inplaceInput" prefix="ii"%>
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+
+ <h:form>
+ <h:selectOneRadio binding="#{skinBean.component}" />
+ <h:commandLink action="#{skinBean.change}" value="set skin" />
+ <h:outputText value="Current skin: #{skinBean.skin}"/><br />
+ </h:form>
+
+ <h:form>
+
+ <ii:inplaceInput value="Perec"/>
+ <br/>
+ <h:commandButton action="none" value="submit"></h:commandButton>
+ <br>
+ </h:form>
+ </f:view>
+ </body>
+</html>
Modified: trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.xhtml 2008-02-08 16:51:08 UTC (rev 5957)
+++ trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.xhtml 2008-02-08 17:05:47 UTC (rev 5958)
@@ -0,0 +1,29 @@
+<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -->
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:ii="http://labs.jboss.com/jbossrichfaces/ui/ui/inplaceInput">
+
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+
+ <h:form>
+ <h:selectOneRadio binding="#{skinBean.component}" />
+ <h:commandLink action="#{skinBean.change}" value="set skin" />
+ <h:outputText value="Current skin: #{skinBean.skin}"/><br />
+ </h:form>
+
+ <h:form>
+
+ <ii:inplaceInput value="Perec"/>
+ <br/>
+ <h:commandButton action="none" value="submit"></h:commandButton>
+ </h:form>
+ </f:view>
+ </body>
+</html>
\ No newline at end of file
18 years, 2 months
JBoss Rich Faces SVN: r5957 - trunk/ui/combobox/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-08 11:51:08 -0500 (Fri, 08 Feb 2008)
New Revision: 5957
Modified:
trunk/ui/combobox/src/main/templates/combobox.jspx
Log:
RF-2212
Modified: trunk/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/ui/combobox/src/main/templates/combobox.jspx 2008-02-08 16:30:26 UTC (rev 5956)
+++ trunk/ui/combobox/src/main/templates/combobox.jspx 2008-02-08 16:51:08 UTC (rev 5957)
@@ -206,6 +206,7 @@
onchange="#{component.attributes['onchange']}"
onselect="#{component.attributes['onselect']}"
onblur="#{component.attributes['onblur']}"
+ maxlength="#{component.attributes['maxlength']}"
style="width:#{correction}; #{inputStyle}"
autocomplete="off"
/>
18 years, 2 months