JBoss Rich Faces SVN: r6688 - trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-03-11 09:52:24 -0400 (Tue, 11 Mar 2008)
New Revision: 6688
Modified:
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
RF-1774
Correct values insertion was added when tokens are used (draft)
Modified: trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2008-03-11 13:39:50 UTC (rev 6687)
+++ trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2008-03-11 13:52:24 UTC (rev 6688)
@@ -585,7 +585,7 @@
} else
value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
- var lastTokenPos = this.findLastToken();
+ /*var lastTokenPos = this.findLastToken();
if (lastTokenPos != -1) {
var newValue = this.element.value.substr(0, lastTokenPos + 1);
var whitespace = this.element.value.substr(lastTokenPos
@@ -595,14 +595,15 @@
this.element.value = newValue + value;
} else {
this.element.value = value;
- }
+ }*/
+ this.insertValue(value);
this.oldValue = this.element.value;
this.element.focus();
if (this.options.afterUpdateElement)
this.options.afterUpdateElement(this.element, selectedElement);
},
-
+
updateChoices: function(choices) {
if (!this.changed && this.hasFocus) {
if (choices) {
@@ -663,6 +664,24 @@
LOG.debug("Observer event occurs");
this.changed = false;
var oldValue = this.element.value;
+
+ if (this.oldValue!=oldValue)
+ {
+ this.endPosition = 0;
+ this.startPosition = 0;
+ var tokens = this.options.tokens.join('');
+ while (this.oldValue[this.endPosition]==oldValue[this.endPosition])
+ {
+ if (tokens.indexOf(oldValue[this.endPosition])!=-1) this.startPosition = this.endPosition+1;
+ this.endPosition++;
+ }
+ if (oldValue.length>this.oldValue.length && this.startPosition!=this.endPosition && tokens.indexOf(oldValue[this.endPosition])!=-1) this.startPosition = ++this.endPosition;
+
+ while (oldValue[this.startPosition]==' ') this.startPosition++;
+ while (this.endPosition<oldValue.length && tokens.indexOf(oldValue[this.endPosition])==-1) this.endPosition++;
+ //alert(this.startPosition + ","+ this.endPosition+": "+oldValue.substring(this.startPosition, this.endPosition));
+ }
+
if (this.getToken().length >= this.options.minChars) {
LOG.debug("Call data for update choices");
if ((event.keyCode == Event.KEY_DOWN || this.oldValue != oldValue) && oldValue.length > 0) {
@@ -677,7 +696,7 @@
this.observerHandle = null;
},
- getToken: function() {
+ /*getToken: function() {
var tokenPos = this.findLastToken();
if (tokenPos != -1)
var ret = this.element.value.substr(tokenPos
@@ -686,8 +705,34 @@
var ret = this.element.value;
return /\n/.test(ret) ? '' : ret;
+ },*/
+
+ insertValue: function(value)
+ {
+ //if (this.startPosition && this.endPosition)
+ //{
+ var startStr = this.element.value.substr(0,this.startPosition);
+ var endStr = this.element.value.substr(this.endPosition);
+ var whitespace = this.element.value.substring(this.startPosition, this.endPosition).match(/\s+$/);
+ if (whitespace)
+ endStr = whitespace[0] + endStr;
+ this.element.value = startStr + value + endStr;
+ //}
+ /*else
+ {
+ this.element.value = value;
+ }*/
},
+ getToken: function() {
+ //if (this.startPosition && this.endPosition)
+ var ret = this.element.value.substring(this.startPosition, this.endPosition).replace(/^\s+/, '').replace(/\s+$/, '');
+ /*else
+ var ret = this.element.value;*/
+
+ return /\n/.test(ret) ? '' : ret;
+ }/*,
+
findLastToken: function() {
var lastTokenPos = -1;
@@ -697,7 +742,7 @@
lastTokenPos = thisTokenPos;
}
return lastTokenPos;
- }
+ }*/
}
16 years, 10 months
JBoss Rich Faces SVN: r6687 - in management/design: panelBar and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-03-11 09:39:50 -0400 (Tue, 11 Mar 2008)
New Revision: 6687
Added:
management/design/panelBar/
management/design/panelBar/icon.gif
management/design/panelBar/panelBar1.html
management/design/panelBar/pbar_bg.gif
management/design/panelBar/spacer.gif
management/design/panelMenu/
management/design/panelMenu/icon.gif
management/design/panelMenu/panel_menu.html
management/design/panelMenu/pmenu_bg.gif
management/design/panelMenu/spacer.gif
Log:
Added: management/design/panelBar/icon.gif
===================================================================
(Binary files differ)
Property changes on: management/design/panelBar/icon.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/panelBar/panelBar1.html
===================================================================
--- management/design/panelBar/panelBar1.html (rev 0)
+++ management/design/panelBar/panelBar1.html 2008-03-11 13:39:50 UTC (rev 6687)
@@ -0,0 +1,97 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+<title>coll_panel</title>
+<style>
+.pbar_size{
+ width : 300px;
+}
+
+.pbar_item{
+ border-top : 1px solid #BED6F8; /*panelBorderColor*/
+ border-left : 1px solid #BED6F8; /*panelBorderColor*/
+ border-right : 1px solid #BED6F8; /*panelBorderColor*/
+ border-bottom : 0px;
+ font-size : 11px; /*generalSizeFont*/
+ font-family : verdana; /*generalFamilyFont*/
+ padding : 0px;
+}
+
+.pbar_content{
+ border-top : 1px solid #BED6F8; /*panelBorderColor*/
+ font-family : verdana; /*generalFamilyFont*/
+ font-size : 11px; /*generalSizeFont*/
+ padding : 10px;
+ color : #000000; /*generalTextColor*/
+}
+
+.pbar_label{
+ border : 0px solid #BED6F8; /*panelBorderColor*/
+ background-color : #E9F2FF; /*headerBackgroundColor*/
+ font-size : 11px; /*headerSizeFont*/
+ font-family : verdana; /*generalFamilyFont*/
+ color : #000000; /*headerTextColor*/
+ font-weight : bold;
+ background-image : url(pbar_bg.gif); /*from headerGradientColor to headerBackgroundColor*/
+ background-position : top left;
+ background-repeat : repeat-x;
+ padding : 4px 4px 4px 10px;
+ cursor : pointer;
+ margin : 1px;
+ white-space : nowrap;
+}
+
+.pbar_bottom{
+ border-top : 1px solid #BED6F8; /*panelBorderColor*/
+}
+.pbar_hide{display : none}
+
+</style>
+
+</head>
+
+<body>
+
+
+<div class="pbar_size">
+
+ <div class="pbar_item">
+ <div class="pbar_label">
+ Header name 1
+ </div>
+ <div class="pbar_content">
+ An automated testing facility is in our roadmap for the near future. This facility will generate test cases for your component as soon as you develop it. The testing framework will not just test the components, but also any other server-side or client-side functionality including JavaScript code. What is more, it will do all of this without deploying the test application into the Servlet container.
+ </div>
+ </div>
+
+ <div class="pbar_item">
+ <div class="pbar_label">
+ Header name 2
+ </div>
+ <div class="pbar_content pbar_hide">
+ An automated testing facility is in our roadmap for the near future. This facility will generate test cases for your component as soon as you develop it. The testing framework will not just test the components, but also any other server-side or client-side functionality including JavaScript code. What is more, it will do all of this without deploying the test application into the Servlet container.
+ </div>
+ </div>
+
+ <div class="pbar_item">
+ <div class="pbar_label">
+ Header name 3
+ </div>
+ <div class="pbar_content pbar_hide">
+ An automated testing facility is in our roadmap for the near future. This facility will generate test cases for your component as soon as you develop it. The testing framework will not just test the components, but also any other server-side or client-side functionality including JavaScript code. What is more, it will do all of this without deploying the test application into the Servlet container.
+ </div>
+ </div>
+
+ <div class="pbar_bottom">
+ </div>
+
+</div>
+
+
+
+
+
+
+</body>
+</html>
Added: management/design/panelBar/pbar_bg.gif
===================================================================
(Binary files differ)
Property changes on: management/design/panelBar/pbar_bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/panelBar/spacer.gif
===================================================================
(Binary files differ)
Property changes on: management/design/panelBar/spacer.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/panelMenu/icon.gif
===================================================================
(Binary files differ)
Property changes on: management/design/panelMenu/icon.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/panelMenu/panel_menu.html
===================================================================
--- management/design/panelMenu/panel_menu.html (rev 0)
+++ management/design/panelMenu/panel_menu.html 2008-03-11 13:39:50 UTC (rev 6687)
@@ -0,0 +1,213 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+<title>coll_panel</title>
+<style>
+.pmenu_size{
+ width : 300px;
+}
+
+.pmenu_text{
+ width: 100%;
+ padding-left : 5px;
+}
+
+.pmenu_item table{
+ border-top : 1px solid #BED6F8; /*panelBorderColor*/
+ font-size : 11px; /*generalSizeFont*/
+ font-family : verdana; /*generalFamilyFont*/
+ padding : 2px 1px 1px 1px;
+ margin-top : 1px;
+ cursor : pointer;
+}
+
+.pmenu_label{
+ border : 1px solid #BED6F8; /*panelBorderColor*/
+ font-size : 11px; /*generalSizeFont*/
+ font-family : verdana; /*generalFamilyFont*/
+ padding : 1px;
+ margin-bottom : 3px
+}
+
+.pmenu_label table.label{
+ background-color : #E9F2FF; /*headerBackgroundColor*/
+ font-size : 11px; /*headerSizeFont*/
+ font-family : verdana; /*generalFamilyFont*/
+ color : #000000; /*headerTextColor*/
+ font-weight : regular;
+ background-image : url(pmenu_bg.gif); /*from headerGradientColor to headerBackgroundColor*/
+ background-position : top left;
+ background-repeat : repeat-x;
+ padding : 2px 1px 2px 2px;
+ cursor : pointer;
+}
+
+.group{
+ font-weight : regular;
+}
+
+.disabled{
+ color : #BED6F8; /*panelBorderColor*/
+}
+
+.select{
+ background : #C7D7EC; /*additionalBackgroundColor*/
+ border-top : 1px solid #FFFFFF; /*panelBorderColor*/
+}
+
+
+</style>
+
+</head>
+
+<body>
+
+
+<div class="pmenu_size">
+<div class="pmenu_label">
+ <table cellspacing=0 cellpadding=0 border=0 class="label">
+ <tr>
+ <td><img src="icon.gif" width="16" height="16"></td>
+ <td class="pmenu_text">Display item name</td>
+ <td><img src="spacer.gif" width="16" height="16"></td>
+ </tr>
+ </table>
+
+ <div class="pmenu_item">
+ <table cellspacing=0 cellpadding=0 border=0 class="group">
+ <tr>
+ <td><img src="spacer.gif" width="16" height="16"><img src="icon.gif" width="16" height="16"></td>
+ <td class="pmenu_text">Display item name</td>
+ <td><img src="spacer.gif" width="16" height="16"></td>
+ </tr>
+ </table>
+
+ <div class="pmenu_item">
+ <table cellspacing=0 cellpadding=0 border=0 class="">
+ <tr>
+ <td><img src="spacer.gif" width="16" height="16"><img src="spacer.gif" width="16" height="16"><img src="icon.gif" width="16" height="16"></td>
+ <td class="pmenu_text">Display item name</td>
+ <td><img src="spacer.gif" width="16" height="16"></td>
+ </tr>
+ </table>
+
+
+
+ </div>
+ <div class="pmenu_item">
+ <table cellspacing=0 cellpadding=0 border=0 class="select">
+ <tr>
+ <td><img src="spacer.gif" width="16" height="16"><img src="spacer.gif" width="16" height="16"><img src="icon.gif" width="16" height="16"></td>
+ <td class="pmenu_text">Display item name</td>
+ <td><img src="spacer.gif" width="16" height="16"></td>
+ </tr>
+ </table>
+
+
+
+ </div>
+
+ </div>
+ <div class="pmenu_item">
+ <table cellspacing=0 cellpadding=0 border=0 class="disabled group">
+ <tr>
+ <td><img src="spacer.gif" width="16" height="16"><img src="icon.gif" width="16" height="16"></td>
+ <td class="pmenu_text">Display item name</td>
+ <td><img src="spacer.gif" width="16" height="16"></td>
+ </tr>
+ </table>
+
+ <div class="pmenu_item" style="display : none">
+ <table cellspacing=0 cellpadding=0 border=0>
+ <tr>
+ <td><img src="spacer.gif" width="16" height="16"><img src="spacer.gif" width="16" height="16"><img src="icon.gif" width="16" height="16"></td>
+ <td class="pmenu_text">Display item name</td>
+ <td><img src="spacer.gif" width="16" height="16"></td>
+ </tr>
+ </table>
+
+
+
+ </div>
+
+ </div>
+</div>
+
+<div class="pmenu_label">
+ <table cellspacing=0 cellpadding=0 border=0 class="label">
+ <tr>
+ <td><img src="icon.gif" width="16" height="16"></td>
+ <td class="pmenu_text">Display item name</td>
+ <td><img src="spacer.gif" width="16" height="16"></td>
+ </tr>
+ </table>
+
+ <div class="pmenu_item" style="display : none">
+ <table cellspacing=0 cellpadding=0 border=0>
+ <tr>
+ <td><img src="spacer.gif" width="16" height="16"><img src="icon.gif" width="16" height="16"></td>
+ <td class="pmenu_text">Display item name</td>
+ <td><img src="spacer.gif" width="16" height="16"></td>
+ </tr>
+ </table>
+
+
+
+ </div>
+</div>
+
+<div class="pmenu_label">
+ <table cellspacing=0 cellpadding=0 border=0 class="label">
+ <tr>
+ <td><img src="icon.gif" width="16" height="16"></td>
+ <td class="pmenu_text">Display item name</td>
+ <td><img src="spacer.gif" width="16" height="16"></td>
+ </tr>
+ </table>
+
+ <div class="pmenu_item" style="display : none">
+ <table cellspacing=0 cellpadding=0 border=0>
+ <tr>
+ <td><img src="spacer.gif" width="16" height="16"><img src="icon.gif" width="16" height="16"></td>
+ <td class="pmenu_text">Display item name</td>
+ <td><img src="spacer.gif" width="16" height="16"></td>
+ </tr>
+ </table>
+
+
+
+ </div>
+</div>
+
+<div class="pmenu_label">
+ <table cellspacing=0 cellpadding=0 border=0 class="label">
+ <tr>
+ <td><img src="icon.gif" width="16" height="16"></td>
+ <td class="pmenu_text">Display item name</td>
+ <td><img src="spacer.gif" width="16" height="16"></td>
+ </tr>
+ </table>
+
+ <div class="pmenu_item" style="display : none ">
+ <table cellspacing=0 cellpadding=0 border=0>
+ <tr>
+ <td><img src="spacer.gif" width="16" height="16"><img src="icon.gif" width="16" height="16"></td>
+ <td class="pmenu_text">Display item name</td>
+ <td><img src="spacer.gif" width="16" height="16"></td>
+ </tr>
+ </table>
+
+
+
+ </div>
+</div>
+</div>
+
+
+
+
+
+
+</body>
+</html>
Added: management/design/panelMenu/pmenu_bg.gif
===================================================================
(Binary files differ)
Property changes on: management/design/panelMenu/pmenu_bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/panelMenu/spacer.gif
===================================================================
(Binary files differ)
Property changes on: management/design/panelMenu/spacer.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 10 months
JBoss Rich Faces SVN: r6686 - in trunk/test-applications/jsp/src/main: java/dfs and 19 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2008-03-11 09:27:33 -0400 (Tue, 11 Mar 2008)
New Revision: 6686
Added:
trunk/test-applications/jsp/src/main/java/listShuttle/ListShuttleConverter.java
trunk/test-applications/jsp/src/main/java/orderingList/OrderingListConverter.java
trunk/test-applications/jsp/src/main/java/skinning/
trunk/test-applications/jsp/src/main/java/skinning/Skinning.java
trunk/test-applications/jsp/src/main/webapp/Skinning/
trunk/test-applications/jsp/src/main/webapp/Skinning/Skinning.jsp
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Skinning.xml
Modified:
trunk/test-applications/jsp/src/main/java/dfs/DemoSliderBean.java
trunk/test-applications/jsp/src/main/java/fileUpload/FileUpload.java
trunk/test-applications/jsp/src/main/java/rich/RichBean.java
trunk/test-applications/jsp/src/main/java/sortingAndFiltering/SortingAndFiltering.java
trunk/test-applications/jsp/src/main/java/tabPanel/TabPanel.java
trunk/test-applications/jsp/src/main/java/util/style/Style.java
trunk/test-applications/jsp/src/main/webapp/DataFilterSlider/DataFilterSlider.jsp
trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp
trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp
trunk/test-applications/jsp/src/main/webapp/Panel/Panel.jsp
trunk/test-applications/jsp/src/main/webapp/ProgressBar/ProgressBar.jsp
trunk/test-applications/jsp/src/main/webapp/SortingAndFiltering/SortingAndFiltering.jsp
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Converter.xml
trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
trunk/test-applications/jsp/src/main/webapp/pages/RichMenu/RichMenu.jsp
trunk/test-applications/jsp/src/main/webapp/pages/main.jsp
Log:
+ update FileUpload
+ update Combobox
+ add skinning
Modified: trunk/test-applications/jsp/src/main/java/dfs/DemoSliderBean.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/dfs/DemoSliderBean.java 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/java/dfs/DemoSliderBean.java 2008-03-11 13:27:33 UTC (rev 6686)
@@ -33,6 +33,14 @@
private DemoInventoryList demoInventoryList;
private String action;
private String actionListener;
+ private String onslide;
+ private String onchange;
+ private boolean storeResults;
+ private Integer startRange;
+ private Integer endRange;
+ private Integer increment;
+ private String trailer;
+ private Integer handleValue;
public DemoSliderBean() {
rendered = true;
Modified: trunk/test-applications/jsp/src/main/java/fileUpload/FileUpload.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/fileUpload/FileUpload.java 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/java/fileUpload/FileUpload.java 2008-03-11 13:27:33 UTC (rev 6686)
@@ -3,10 +3,9 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.ArrayList;
+
import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;
@@ -15,17 +14,20 @@
private boolean autoclear;
private boolean rendered;
private boolean required;
+ private String acceptedTypes;
private String requiredMessage;
private String listHeight;
private String listWidth;
- private Map<String, InputStream> data = new HashMap<String, InputStream>();
+ private ArrayList data;
private Integer maxFilesQuantity;
public FileUpload() {
+ data = new ArrayList();
disabled = false;
autoclear = false;
rendered = true;
required = false;
+ acceptedTypes = "*";
requiredMessage = "requiredMessage";
listHeight = "200px";
listWidth = "150px";
@@ -40,7 +42,6 @@
ByteArrayOutputStream b = new ByteArrayOutputStream();
b.write(upload.getData());
}
-
}
public boolean isDisabled() {
@@ -107,8 +108,19 @@
this.listWidth = listWidth;
}
- public void setData(Map<String, InputStream> data) {
+ public String getAcceptedTypes() {
+ return acceptedTypes;
+ }
+
+ public void setAcceptedTypes(String acceptedTypes) {
+ this.acceptedTypes = acceptedTypes;
+ }
+
+ public ArrayList getData() {
+ return data;
+ }
+
+ public void setData(ArrayList data) {
this.data = data;
}
-
}
Added: trunk/test-applications/jsp/src/main/java/listShuttle/ListShuttleConverter.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/listShuttle/ListShuttleConverter.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/listShuttle/ListShuttleConverter.java 2008-03-11 13:27:33 UTC (rev 6686)
@@ -0,0 +1,33 @@
+package listShuttle;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import util.data.Data;
+
+public class ListShuttleConverter implements Converter {
+
+ public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
+ String [] str = arg2.split(":");
+ return new Data(Integer.parseInt(str[0]), str[1], str[2], str[3],str[4]);
+ }
+//list.add(new Data(i, "Button " + i, "Link " + i, "select" +(i % 5), statusIcon[i % 5]));
+ public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) {
+ Data data = (Data)arg2;
+ return data.getInt0() + ":" + data.getStr0() + ":" + data.getStr1() + ":" + data.getStr2() + ":" + data.getStr3();
+ }
+
+}
+// public Object getAsObject(FacesContext context, UIComponent component,
+// String value) {
+// int index = value.indexOf(':');
+// return new OptionItem(value.substring(0, index), Integer.valueOf(value.substring(index + 1)));
+// }
+// public String getAsString(FacesContext context, UIComponent component,
+// Object value) {
+// OptionItem optionItem = (OptionItem) value;
+// return optionItem.getName() + ":" + optionItem.getPrice();
+// }
Added: trunk/test-applications/jsp/src/main/java/orderingList/OrderingListConverter.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/orderingList/OrderingListConverter.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/orderingList/OrderingListConverter.java 2008-03-11 13:27:33 UTC (rev 6686)
@@ -0,0 +1,33 @@
+package orderingList;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import util.data.Data;
+
+public class OrderingListConverter implements Converter {
+
+ public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
+ String [] str = arg2.split(":");
+ return new Data(Integer.parseInt(str[0]), str[1], str[2], str[3],str[4]);
+ }
+//list.add(new Data(i, "Button " + i, "Link " + i, "select" +(i % 5), statusIcon[i % 5]));
+ public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) {
+ Data data = (Data)arg2;
+ return data.getInt0() + ":" + data.getStr0() + ":" + data.getStr1() + ":" + data.getStr2() + ":" + data.getStr3();
+ }
+
+}
+// public Object getAsObject(FacesContext context, UIComponent component,
+// String value) {
+// int index = value.indexOf(':');
+// return new OptionItem(value.substring(0, index), Integer.valueOf(value.substring(index + 1)));
+// }
+// public String getAsString(FacesContext context, UIComponent component,
+// Object value) {
+// OptionItem optionItem = (OptionItem) value;
+// return optionItem.getName() + ":" + optionItem.getPrice();
+// }
Modified: trunk/test-applications/jsp/src/main/java/rich/RichBean.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/rich/RichBean.java 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/java/rich/RichBean.java 2008-03-11 13:27:33 UTC (rev 6686)
@@ -25,11 +25,11 @@
srcContainer = "Blank";
map = new MapComponent();
// map.add( value, add( pages_path/name_pages, array<boolean>(Property, Straightforward) );
- map.add("Blank", add("/pages/Blank/Blank", new boolean [] {false, true, true}));
- map.add("Calendar", add("/Calendar/Calendar", new boolean [] {false, true, true}));
- map.add("DataFilterSlider", add("/DataFilterSlider/DataFilterSlider", new boolean [] {false, true, false}));
- map.add("DataScroller", add("/DataScroller/DataScroller", new boolean [] {false, true, true}));
- map.add("DataTable", add("/DataTable/DataTable", new boolean [] {false, true, true}));
+ map.add("Blank", add("/pages/Blank/Blank", new boolean [] {true, true, true}));
+ map.add("Calendar", add("/Calendar/Calendar", new boolean [] {true, true, true}));
+ map.add("DataFilterSlider", add("/DataFilterSlider/DataFilterSlider", new boolean [] {true, true, false}));
+ map.add("DataScroller", add("/DataScroller/DataScroller", new boolean [] {true, true, true}));
+ map.add("DataTable", add("/DataTable/DataTable", new boolean [] {true, true, true}));
map.add("DragAndDrop", add("/DragAndDrop/DragAndDrop", new boolean [] {false, false, false}));
map.add("DropDownMenu", add("/DropDownMenu/DropDownMenu", new boolean [] {false, true, true}));
map.add("Effect", add("/Effect/Effect", new boolean [] {false, false, false}));
@@ -69,6 +69,7 @@
map.add("FileUpload", add("/FileUpload/FileUpload", new boolean [] {false, false, false}));
map.add("InplaceSelect", add("/InplaceSelect/InplaceSelect", new boolean [] {false, false, false}));
map.add("InplaceInput", add("/InplaceInput/InplaceInput", new boolean [] {false, false, false}));
+ map.add("Skinning", add("/Skinning/Skinning", new boolean [] {false, false, false}));
Iterator<String> iterator = map.getSet().iterator();
while(iterator.hasNext()){
list.add(new SelectItem(iterator.next()));
Added: trunk/test-applications/jsp/src/main/java/skinning/Skinning.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/skinning/Skinning.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/skinning/Skinning.java 2008-03-11 13:27:33 UTC (rev 6686)
@@ -0,0 +1,210 @@
+package skinning;
+
+public class Skinning {
+ private String selectSkinning;
+ private String skinning;
+ private String skinningClass;
+ private String commandButton;
+ private String commandLink;
+ private String dataTable;
+ private String inputSecret;
+ private String inputText;
+ private String inputTextarea;
+ private String outputLink;
+ private String outputText;
+ private String panelGrid;
+ private String selectBooleanCheckbox;
+ private String selectManyCheckbox;
+ private String selectManyListBox;
+ private String selectManyMenu;
+ private String selectOneListbox;
+ private String selectOneMenu;
+ private String selectOneRadio;
+
+ public Skinning() {
+ commandButton = "rich-button";
+ commandLink = "rich-link";
+ dataTable = "rich-isindex";
+ inputSecret = "rich-button";
+ inputText = "rich-input";
+ inputTextarea = "rich-textarea";
+ commandLink = "rich-link";
+ outputLink = "rich-link";
+ outputText = "rich-legend";
+ panelGrid = "rich-fieldset";
+ selectBooleanCheckbox = "rich-select";
+ selectManyCheckbox = "rich-select";
+ selectManyListBox = "rich-select";
+ selectManyMenu = "rich-select";
+ selectOneListbox = "rich-select";
+ selectOneMenu = "rich-select";
+ selectOneRadio = "rich-select";
+ skinning = "disable";
+ skinningClass = "disable";
+ }
+
+ public String getCommandButton() {
+ return commandButton;
+ }
+
+ public void setCommandButton(String commandButton) {
+ this.commandButton = commandButton;
+ }
+
+ public String getCommandLink() {
+ return commandLink;
+ }
+
+ public void setOmmandLink(String commandLink) {
+ this.commandLink = commandLink;
+ }
+
+ public String getDataTable() {
+ return dataTable;
+ }
+
+ public void setDataTable(String dataTable) {
+ this.dataTable = dataTable;
+ }
+
+ public String getInputSecret() {
+ return inputSecret;
+ }
+
+ public void setInputSecret(String inputSecret) {
+ this.inputSecret = inputSecret;
+ }
+
+ public String getInputText() {
+ return inputText;
+ }
+
+ public void setInputText(String inputText) {
+ this.inputText = inputText;
+ }
+
+ public String getInputTextarea() {
+ return inputTextarea;
+ }
+
+ public void setInputTextarea(String inputTextarea) {
+ this.inputTextarea = inputTextarea;
+ }
+
+ public String getOutputLink() {
+ return outputLink;
+ }
+
+ public void setOutputLink(String outputLink) {
+ this.outputLink = outputLink;
+ }
+
+ public String getOutputText() {
+ return outputText;
+ }
+
+ public void setOutputText(String outputText) {
+ this.outputText = outputText;
+ }
+
+ public String getPanelGrid() {
+ return panelGrid;
+ }
+
+ public void setPanelGrid(String panelGrid) {
+ this.panelGrid = panelGrid;
+ }
+
+ public String getSelectBooleanCheckbox() {
+ return selectBooleanCheckbox;
+ }
+
+ public void setSelectBooleanCheckbox(String selectBooleanCheckbox) {
+ this.selectBooleanCheckbox = selectBooleanCheckbox;
+ }
+
+ public String getSelectManyListBox() {
+ return selectManyListBox;
+ }
+
+ public void setSelectManyListBox(String selectManyListBox) {
+ this.selectManyListBox = selectManyListBox;
+ }
+
+ public String getSelectManyMenu() {
+ return selectManyMenu;
+ }
+
+ public void setSelectManyMenu(String selectManyMenu) {
+ this.selectManyMenu = selectManyMenu;
+ }
+
+ public String getSelectOneListbox() {
+ return selectOneListbox;
+ }
+
+ public void setSelectOneListbox(String selectOneListbox) {
+ this.selectOneListbox = selectOneListbox;
+ }
+
+ public String getSelectOneMenu() {
+ return selectOneMenu;
+ }
+
+ public void setSelectOneMenu(String selectOneMenu) {
+ this.selectOneMenu = selectOneMenu;
+ }
+
+ public String getSelectOneRadio() {
+ return selectOneRadio;
+ }
+
+ public void setSelectOneRadio(String selectOneRadio) {
+ this.selectOneRadio = selectOneRadio;
+ }
+
+ public String getSelectManyCheckbox() {
+ return selectManyCheckbox;
+ }
+
+ public void setSelectManyCheckbox(String selectManyCheckbox) {
+ this.selectManyCheckbox = selectManyCheckbox;
+ }
+
+ public void setCommandLink(String commandLink) {
+ this.commandLink = commandLink;
+ }
+
+ public String getSelectSkinning() {
+ return selectSkinning;
+ }
+
+ public String getSkinning() {
+ return skinning;
+ }
+
+ public void setSkinning(String skinning) {
+ this.skinning = skinning;
+ }
+
+ public String getSkinningClass() {
+ return skinningClass;
+ }
+
+ public void setSkinningClass(String skinningClass) {
+ this.skinningClass = skinningClass;
+ }
+
+ public void setSelectSkinning(String selectSkinning) {
+ if (selectSkinning.equals("skinning")) {
+ setSkinning("enable");
+ } else if (selectSkinning.equals("skinningClass")) {
+ setSkinning("disable");
+ setSkinningClass("enable");
+ } else {
+ setSkinning("disable");
+ setSkinningClass("disable");
+ }
+ this.selectSkinning = selectSkinning;
+ }
+}
Modified: trunk/test-applications/jsp/src/main/java/sortingAndFiltering/SortingAndFiltering.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/sortingAndFiltering/SortingAndFiltering.java 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/java/sortingAndFiltering/SortingAndFiltering.java 2008-03-11 13:27:33 UTC (rev 6686)
@@ -19,11 +19,13 @@
private String currentSortOrder;
private String filterInput;
private String filterValue;
+
private final Comparator<Data> comparator = new Comparator<Data> () {
public int compare(Data o1, Data o2) {
- return o2.getStr1().length() - o1.getStr1().length();
+ return o1.getStr1().length() - o2.getStr1().length();
}
};
+
public String getFilterValue() {
return filterValue;
}
Modified: trunk/test-applications/jsp/src/main/java/tabPanel/TabPanel.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tabPanel/TabPanel.java 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/java/tabPanel/TabPanel.java 2008-03-11 13:27:33 UTC (rev 6686)
@@ -32,6 +32,7 @@
headerSpacing="20px";
label="Tab Label";
labelWidth="150px";
+ selectedTab = "tabTwo";
activeTabStyle=null;
disabledTabStyle=null;
Modified: trunk/test-applications/jsp/src/main/java/util/style/Style.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/style/Style.java 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/java/util/style/Style.java 2008-03-11 13:27:33 UTC (rev 6686)
@@ -62,7 +62,10 @@
private String controlClass;
private String captionStyle;
private String activeClass;
-
+ private String trailerStyleClass;
+ private String barClass;
+ private String handleStyle;
+
private String styleA;
private String styleClassA;
private String selectStyleA;
@@ -73,7 +76,7 @@
private String columnClassesA;
private String footerClassA;
private String headerClassA;
-
+
public Style() {
style = "style";
styleClass = "styleClass";
@@ -133,7 +136,10 @@
controlClass = "controlClass";
captionStyle = "captionStyle";
activeClass = "activeClass";
-
+ trailerStyleClass = "trailerStyleClass";
+ barClass = "barClass";
+ handleStyle = "handleStyle";
+
styleA = "styleA";
styleClassA = "styleClassA";
selectStyleA = "selectStyleA";
@@ -697,4 +703,28 @@
public void setHandleStyleClass(String handleStyleClass) {
this.handleStyleClass = handleStyleClass;
}
+
+ public String getTrailerStyleClass() {
+ return trailerStyleClass;
+ }
+
+ public void setTrailerStyleClass(String trailerStyleClass) {
+ this.trailerStyleClass = trailerStyleClass;
+ }
+
+ public String getBarClass() {
+ return barClass;
+ }
+
+ public void setBarClass(String barClass) {
+ this.barClass = barClass;
+ }
+
+ public String getHandleStyle() {
+ return handleStyle;
+ }
+
+ public void setHandleStyle(String handleStyle) {
+ this.handleStyle = handleStyle;
+ }
}
Modified: trunk/test-applications/jsp/src/main/webapp/DataFilterSlider/DataFilterSlider.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/DataFilterSlider/DataFilterSlider.jsp 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/webapp/DataFilterSlider/DataFilterSlider.jsp 2008-03-11 13:27:33 UTC (rev 6686)
@@ -8,18 +8,19 @@
<rich:dataFilterSlider sliderListener="#{dfs.doSlide}" action="#{dfs.act}" actionListener="#{dfs.actListener}"
rendered="#{dfs.rendered}" binding="#{inventoryList.dataFilterSlider}"
for="carList" forValRef="inventoryList.carInventory"
- filterBy="getMileage" manualInput="true" storeResults="true" width="400px"
+ filterBy="getMileage" manualInput="true" width="400px"
styleClass="#{style.styleClass}" rangeStyleClass="#{style.rangeStyleClass}" trailerStyleClass="#{style.trailerStyleClass}" style="#{style.style}" fieldStyleClass="#{style.fieldStyleClass}" trackStyleClass="#{style.trackStyleClass}" handleStyleClass="#{style.handleStyleClass}"
+ onslide="true" onchange="true" storeResults="true"
startRange="10000" endRange="60000" increment="10000"
trailer="true" handleValue="10000" id="dfsID"
onbeforedomupdate="#{event.onbeforedomupdate}"
- onchange="#{event.onchange}" onclick="#{event.onclick}"
+ onclick="#{event.onclick}"
oncomplete="#{event.oncomplete}" ondblclick="#{event.ondblclick}"
onerror="#{event.onerror}" onkeydown="#{event.onkeydown}"
onkeypress="#{event.onkeypress}" onkeyup="#{event.onkeyup}"
onmousedown="#{event.onmousedown}" onmousemove="#{event.onmousemove}"
onmouseout="#{event.onmouseout}" onmouseover="#{event.onmouseover}"
- onmouseup="#{event.onmouseup}" onslide="#{event.onslide}"
+ onmouseup="#{event.onmouseup}"
onSlideSubmit="#{event.onSlideSubmit}">
</rich:dataFilterSlider>
Modified: trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp 2008-03-11 13:27:33 UTC (rev 6686)
@@ -4,42 +4,54 @@
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="FileUploadSubviewID">
-<rich:fileUpload id="fileUploadID" disabled="#{fileUpload.disabled}" autoclear="#{fileUpload.autoclear}"
-required="#{fileUpload.required}" requiredMessage="#{fileUpload.requiredMessage}" rendered="#{fileUpload.rendered}"
-listHeight="#{fileUpload.listHeight}" listWidth="#{fileUpload.listHeight}" data="#{fileUpload.data}"
-maxFilesQuantity="#{fileUpload.maxFilesQuantity}" fileUploadListener="#{fileUpload.fileUploadListener}">
- <f:facet name="progress">
- <progressBar:progressBar style="height: 5px; width: 250px;">
- </progressBar:progressBar>
- </f:facet>
- <f:facet name="label">
- <h:outputText value="{_KB}KB from {KB}KB uploaded :[ {mm}:{ss} ]"></h:outputText>
- </f:facet>
-</rich:fileUpload>
+ <rich:fileUpload id="fileUploadID" uploadData="#{fileUpload.data}"
+ acceptedTypes="#{fileUpload.acceptedTypes}"
+ disabled="#{fileUpload.disabled}" autoclear="#{fileUpload.autoclear}"
+ required="#{fileUpload.required}"
+ requiredMessage="#{fileUpload.requiredMessage}"
+ rendered="#{fileUpload.rendered}"
+ listHeight="#{fileUpload.listHeight}"
+ listWidth="#{fileUpload.listHeight}"
+ maxFilesQuantity="#{fileUpload.maxFilesQuantity}"
+ fileUploadListener="#{fileUpload.fileUploadListener}">
+ <f:facet name="label">
+ <h:outputText value="{_KB}KB from {KB}KB uploaded :[ {mm}:{ss} ]"></h:outputText>
+ </f:facet>
+ </rich:fileUpload>
+
-<h:panelGrid columns="2">
- <h:outputText value="listHeight"></h:outputText>
- <h:inputText value="#{fileUpload.listHeight}" onchange="submit();"></h:inputText>
+ <h:panelGrid columns="2">
+ <h:outputText value="acceptedTypes"></h:outputText>
+ <h:inputText value="#{fileUpload.acceptedTypes}" onchange="submit();"></h:inputText>
- <h:outputText value="listWidth"></h:outputText>
- <h:inputText value="#{fileUpload.listWidth}" onchange="submit();"></h:inputText>
+ <h:outputText value="listHeight"></h:outputText>
+ <h:inputText value="#{fileUpload.listHeight}" onchange="submit();"></h:inputText>
- <h:outputText value="maxFilesQuantity"></h:outputText>
- <h:inputText value="#{fileUpload.maxFilesQuantity}" onchange="submit();"></h:inputText>
-
- <h:outputText value="autoclear"></h:outputText>
- <h:selectBooleanCheckbox value="#{fileUpload.autoclear}" onchange="submit();"></h:selectBooleanCheckbox>
-
- <h:outputText value="disabled"></h:outputText>
- <h:selectBooleanCheckbox value="#{fileUpload.disabled}" onchange="submit();"></h:selectBooleanCheckbox>
-
- <h:outputText value="rendered"></h:outputText>
- <h:selectBooleanCheckbox value="#{fileUpload.rendered}" onchange="submit();"></h:selectBooleanCheckbox>
+ <h:outputText value="listWidth"></h:outputText>
+ <h:inputText value="#{fileUpload.listWidth}" onchange="submit();"></h:inputText>
- <h:outputText value="required"></h:outputText>
- <h:selectBooleanCheckbox value="#{fileUpload.required}" onchange="submit();"></h:selectBooleanCheckbox>
+ <h:outputText value="maxFilesQuantity"></h:outputText>
+ <h:inputText value="#{fileUpload.maxFilesQuantity}"
+ onchange="submit();"></h:inputText>
- <h:outputText value="requiredMessage"></h:outputText>
- <h:inputText value="#{fileUpload.requiredMessage}" onchange="submit();"></h:inputText>
-</h:panelGrid>
+ <h:outputText value="autoclear"></h:outputText>
+ <h:selectBooleanCheckbox value="#{fileUpload.autoclear}"
+ onchange="submit();"></h:selectBooleanCheckbox>
+
+ <h:outputText value="disabled"></h:outputText>
+ <h:selectBooleanCheckbox value="#{fileUpload.disabled}"
+ onchange="submit();"></h:selectBooleanCheckbox>
+
+ <h:outputText value="rendered"></h:outputText>
+ <h:selectBooleanCheckbox value="#{fileUpload.rendered}"
+ onchange="submit();"></h:selectBooleanCheckbox>
+
+ <h:outputText value="required"></h:outputText>
+ <h:selectBooleanCheckbox value="#{fileUpload.required}"
+ onchange="submit();"></h:selectBooleanCheckbox>
+
+ <h:outputText value="requiredMessage"></h:outputText>
+ <h:inputText value="#{fileUpload.requiredMessage}"
+ onchange="submit();"></h:inputText>
+ </h:panelGrid>
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp 2008-03-11 13:27:33 UTC (rev 6686)
@@ -7,7 +7,7 @@
This is because such an error can easily be made at programming level, <br />
and while invisible for the user who does not understand or cannot <br />
acquire the source code, many of those
-<rich:inplaceInput inputMaxLength="#{inplaceInput.inputMaxLength}"
+<rich:inplaceInput inputMaxLength="#{inplaceInput.inputMaxLength}"
inputWidth="#{inplaceInput.inputWidth}"
maxInputWidth="#{inplaceInput.maxInputWidth}"
minInputWidth="#{inplaceInput.minInputWidth}"
@@ -25,6 +25,7 @@
immediate="#{inplaceInput.immediate}">
</rich:inplaceInput>
are easy to exploit.
+
<h:panelGrid columns="2">
<a4j:commandButton value="refresh" reRender="inplaceInputValueCLID"></a4j:commandButton>
<h:outputText id="inplaceInputValueCLID"
Modified: trunk/test-applications/jsp/src/main/webapp/Panel/Panel.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Panel/Panel.jsp 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/webapp/Panel/Panel.jsp 2008-03-11 13:27:33 UTC (rev 6686)
@@ -20,7 +20,7 @@
<h:panelGroup>
<h:form>
- <rich:panel z
+ <rich:panel
onmouseover="document.getElementById(this.id+'_header').style.background='#60BA01';document.getElementById(this.id+'_body').style.background='#F4FFF8'"
onmouseout="document.getElementById(this.id+'_header').style.background='#4C9600';document.getElementById(this.id+'_body').style.background='#E4FFC8'"
style="width:200px;" headerClass="hea2" bodyClass="bo3">
Modified: trunk/test-applications/jsp/src/main/webapp/ProgressBar/ProgressBar.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/ProgressBar/ProgressBar.jsp 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/webapp/ProgressBar/ProgressBar.jsp 2008-03-11 13:27:33 UTC (rev 6686)
@@ -4,19 +4,16 @@
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:subview id="progressBarSubviewID">
-<rich:panelMenu>
-<rich:panelMenuItem>
<rich:progressBar id="progressBarID" value="#{progressBar.value}"
style="width: 450px; height: 19px;#{style.style};" completeClass="#{style.completeClass}" finishClass="#{style.finishClass}" initialClass="#{style.initialClass}" remainClass="#{style.remainClass}" styleClass="#{style.styleClass}"
mode="#{progressBar.mode}" enabled="#{progressBar.enabled}"
actionListener="#{progressBar.actionListener}"
- interval="#{progressBar.interval}" action="#{progressBar.action}"
+ interval="#{progressBar.interval}"
maxValue="#{progressBar.maxValue}" minValue="#{progressBar.minValue}"
rendered="#{progressBar.rendered}" reRender="loadInfoPBID,valuePBID"
progressVar="progressVar" parameters="params:'%'"
reRenderAfterComplete="completedPBID"
ignoreDupResponses="#{progressBar.ignoreDupResponses}"
- dualColoredLabel="#{progressBar.dualColoredLabel}"
onbeforedomupdate="#{event.onbeforedomupdate}"
onclick="#{event.onclick}" oncomplete="#{event.oncomplete}"
ondblclick="#{event.ondblclick}" onkeydown="#{event.onkeydown}"
@@ -33,17 +30,17 @@
<h:outputText
value="{minValue} {params} / {value} {params}/ {maxValue} {params}"></h:outputText>
<h:outputText id="loadInfoPBID"
- value="[Load: #{progressBar.loadInfo}] " />
+ value="[Load: #{progressBar.loadInfo}]" />
<h:graphicImage value="/pics/ajax_process.gif" />
</rich:progressBar>
- </rich:panelMenuItem>
- </rich:panelMenu>
+
<f:verbatim>
<br />
</f:verbatim>
+
<h:outputText
- value="[parameters=params:'%'], [{minValue} {params} / {value} {params}/ {maxValue} {params}]" />
+ value="[parameters=params:'%'], [{progressVar} | {minValue} {params} / {value} {params}/ {maxValue} {params}]" />
<h:panelGrid columns="1">
<a4j:commandButton value="getValue"
onclick="alert($('formID:progressBarSubviewID:progressBarID').component.getValue())"></a4j:commandButton>
Added: trunk/test-applications/jsp/src/main/webapp/Skinning/Skinning.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Skinning/Skinning.jsp (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/Skinning/Skinning.jsp 2008-03-11 13:27:33 UTC (rev 6686)
@@ -0,0 +1,132 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="ajax"%>
+<%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="richfaces"%>
+
+<f:subview id="skinningSubviewID">
+ <h:panelGrid columns="2" border="2" >
+ <h:outputText value="styleClass"></h:outputText>
+ <h:outputText value="components"></h:outputText>
+
+ <h:panelGroup>
+ <h:outputText value="commandButton "></h:outputText>
+ <h:inputText value="#{skinning.commandButton}" onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:commandButton value="commandButton"
+ styleClass="#{skinning.commandButton}"></h:commandButton>
+
+ <h:panelGroup>
+ <h:outputText value="commandLink "></h:outputText>
+ <h:inputText value="#{skinning.commandLink}" onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:commandLink value="commandLink"
+ styleClass="#{skinning.commandLink}"></h:commandLink>
+
+ <h:panelGroup>
+ <h:outputText value="dataTable "></h:outputText>
+ <h:inputText value="#{skinning.dataTable}" onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:dataTable value="#{dataOrderedList.defaultArr}" var="def"
+ styleClass="#{skinning.dataTable}">
+ <h:column>
+ <h:outputText value="#{def}"></h:outputText>
+ </h:column>
+ </h:dataTable>
+
+ <h:panelGroup>
+ <h:outputText value="inputSecret "></h:outputText>
+ <h:inputText value="#{skinning.inputSecret}" onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:inputSecret value="secret" styleClass="#{skinning.inputSecret}"></h:inputSecret>
+
+ <h:panelGroup>
+ <h:outputText value="inputText "></h:outputText>
+ <h:inputText value="#{skinning.inputText}" onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:inputText value="inputText" styleClass="#{skinning.inputText}"></h:inputText>
+
+ <h:panelGroup>
+ <h:outputText value="inputTextarea "></h:outputText>
+ <h:inputText value="#{skinning.inputTextarea}" onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:inputTextarea rows="4" cols="5" value="inputTextarea"
+ styleClass="#{skinning.inputTextarea}"></h:inputTextarea>
+
+ <h:panelGroup>
+ <h:outputText value="outputLink "></h:outputText>
+ <h:inputText value="#{skinning.outputLink}" onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:outputLink styleClass="#{skinning.outputLink}"></h:outputLink>
+
+ <h:panelGroup>
+ <h:outputText value="outputText "></h:outputText>
+ <h:inputText value="#{skinning.outputText}" onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:outputText value="outputText" styleClass="#{skinning.outputText}"></h:outputText>
+
+ <h:panelGroup>
+ <h:outputText value="panelGrid "></h:outputText>
+ <h:inputText value="#{skinning.outputText}" onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:panelGrid columns="1" styleClass="#{skinning.outputText}">
+ <h:panelGroup>
+ <h:outputText value="panelGrid"></h:outputText>
+ </h:panelGroup>
+ </h:panelGrid>
+
+ <h:panelGroup>
+ <h:outputText value="selectBooleanCheckbox "></h:outputText>
+ <h:inputText value="#{skinning.selectBooleanCheckbox}"
+ onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:panelGroup>
+ <h:selectBooleanCheckbox value="true"
+ styleClass="#{skinning.selectBooleanCheckbox}"></h:selectBooleanCheckbox>
+ <h:selectBooleanCheckbox value="false"
+ styleClass="#{skinning.selectBooleanCheckbox}"></h:selectBooleanCheckbox>
+ </h:panelGroup>
+
+ <h:panelGroup>
+ <h:outputText value="selectManyCheckbox "></h:outputText>
+ <h:inputText value="#{skinning.selectManyCheckbox}"
+ onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:selectManyCheckbox styleClass="#{skinning.selectManyCheckbox}">
+ <f:selectItems value="#{combobox.selectItem}" />
+ </h:selectManyCheckbox>
+
+ <h:panelGroup>
+ <h:outputText value="selectManyMenu "></h:outputText>
+ <h:inputText value="#{skinning.selectManyMenu}" onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:selectManyMenu styleClass="#{skinning.selectManyMenu}">
+ <f:selectItems value="#{combobox.selectItem}" />
+ </h:selectManyMenu>
+
+ <h:panelGroup>
+ <h:outputText value="selectOneListbox "></h:outputText>
+ <h:inputText value="#{skinning.selectOneListbox}"
+ onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:selectOneListbox styleClass="#{skinning.selectOneListbox}">
+ <f:selectItems value="#{combobox.selectItem}" />
+ </h:selectOneListbox>
+
+ <h:panelGroup>
+ <h:outputText value="selectOneMenu "></h:outputText>
+ <h:inputText value="#{skinning.selectOneMenu}" onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:selectOneMenu styleClass="#{skinning.selectOneMenu}">
+ <f:selectItems value="#{combobox.selectItem}" />
+ </h:selectOneMenu>
+
+ <h:panelGroup>
+ <h:outputText value="selectOneRadio"></h:outputText>
+ <h:inputText value="#{skinning.selectOneRadio}" onchange="submit();"></h:inputText>
+ </h:panelGroup>
+ <h:selectOneRadio styleClass="#{skinning.selectOneRadio}">
+ <f:selectItems value="#{combobox.selectItem}" />
+ </h:selectOneRadio>
+
+ </h:panelGrid>
+</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/SortingAndFiltering/SortingAndFiltering.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/SortingAndFiltering/SortingAndFiltering.jsp 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/webapp/SortingAndFiltering/SortingAndFiltering.jsp 2008-03-11 13:27:33 UTC (rev 6686)
@@ -2,7 +2,9 @@
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+
<f:subview id="sortingAndFilteringSubviewID">
+
<h:panelGrid columns="9" border="1" style="font-size:12px">
<h:outputText value="#1"></h:outputText>
<h:outputText value="#2"></h:outputText>
@@ -41,7 +43,8 @@
<h:outputText value=" filterExpression='data > filterValue"></h:outputText>
</h:panelGrid>
<h:panelGrid columns="1" title="7">
- <h:outputText value="filterValue='/pics/error.gif'"></h:outputText>
+ <h:outputText value="sortBy"></h:outputText>
+ <h:outputText value="selfSorted='#{sortingAndFiltering.selfSorted}'"></h:outputText>
</h:panelGrid>
<h:panelGrid columns="1" title="8">
<h:outputText value="filterBy" />
@@ -50,9 +53,12 @@
<h:outputText value="sortBy"></h:outputText>
</h:panelGrid>
</h:panelGrid>
- <rich:dataTable id="dataTableSAFID" value="#{sortingAndFiltering.data}" var="data">
- <rich:column sortBy="#{data.int0}" selfSorted="#{sortingAndFiltering.selfSorted}" sortOrder="#{sortingAndFiltering.sortOrder}"
- filterBy="#{data.int0}">
+ <rich:dataTable id="dataTableSAFID" value="#{sortingAndFiltering.data}"
+ var="data" sortMode="#{sortingAndFiltering.sortMode}">
+ <f:facet name="caption"><h:outputText value="sortMode: #{sortingAndFiltering.sortMode}"></h:outputText></f:facet>
+ <rich:column sortBy="#{data.int0}"
+ selfSorted="#{sortingAndFiltering.selfSorted}"
+ sortOrder="#{sortingAndFiltering.sortOrder}" filterBy="#{data.int0}">
<f:facet name="header">
<h:outputText value="#1" />
</f:facet>
@@ -61,7 +67,8 @@
<h:outputText value="#1" />
</f:facet>
</rich:column>
- <rich:column filterBy="#{data.int1}" sortBy="#{data.int1}" selfSorted="#{sortingAndFiltering.selfSorted}"
+ <rich:column filterBy="#{data.int1}" sortBy="#{data.int1}"
+ selfSorted="#{sortingAndFiltering.selfSorted}"
filterEvent="ondblclick">
<f:facet name="header">
<h:outputText value="#2" />
@@ -71,7 +78,8 @@
<h:outputText value="#2" />
</f:facet>
</rich:column>
- <rich:column sortBy="#{data.str0}" sortOrder="#{sortingAndFiltering.sortOrder}"
+ <rich:column sortBy="#{data.str0}"
+ sortOrder="#{sortingAndFiltering.sortOrder}"
filterMethod="#{sortingAndFiltering.filterMethod}">
<f:facet name="header">
<h:outputText value="#3" />
@@ -81,7 +89,8 @@
<h:outputText value="#3" />
</f:facet>
</rich:column>
- <rich:column filterBy="#{data.int2}" selfSorted="#{sortingAndFiltering.selfSorted}">
+ <rich:column filterBy="#{data.int2}"
+ selfSorted="#{sortingAndFiltering.selfSorted}">
<f:facet name="header">
<h:outputText value="#4" />
</f:facet>
@@ -90,7 +99,9 @@
<h:outputText value="#4" />
</f:facet>
</rich:column>
- <rich:column filterBy="#{data.str1}" sortOrder="#{sortingAndFiltering.sortOrder}" comparator="#{sortingAndFiltering.comparator}">
+ <rich:column filterBy="#{data.str1}"
+ sortOrder="#{sortingAndFiltering.sortOrder}"
+ comparator="#{sortingAndFiltering.comparator}">
<f:facet name="header">
<h:outputText value="#5" />
</f:facet>
@@ -99,7 +110,8 @@
<h:outputText value="#5" />
</f:facet>
</rich:column>
- <rich:column filterExpression="#{data.int3 > sortingAndFiltering.filterValue}">
+ <rich:column
+ filterExpression="#{data.int3 > sortingAndFiltering.filterValue}">
<f:facet name="header">
<h:outputText value="#6" />
</f:facet>
@@ -108,7 +120,8 @@
<h:outputText value="#6" />
</f:facet>
</rich:column>
- <rich:column filterValue="/pics/error.gif">
+ <rich:column sortBy="#{data.str2}"
+ selfSorted="#{sortingAndFiltering.selfSorted}">
<f:facet name="header">
<h:outputText value="#7" />
</f:facet>
@@ -138,8 +151,9 @@
</rich:column>
</rich:dataTable>
- <rich:dataTable id="dataTableFilterValueID" value="#{sortingAndFiltering.data}" var="data">
- <rich:column filterValue="/pics/error.gif">
+ <rich:dataTable id="dataTableFilterValueID"
+ value="#{sortingAndFiltering.data}" var="data">
+ <rich:column filterValue="/pics/error.gif" filterBy="#{data.str2}">
<f:facet name="header">
<h:outputText value="#7(filterValue='/pics/error.gif)'" />
</f:facet>
@@ -153,22 +167,27 @@
<h:panelGrid columns="2">
<h:outputText value="filterMethod (#3):"></h:outputText>
- <h:inputText value="#{sortingAndFiltering.filterInput}" onchange="submit();" />
+ <h:inputText value="#{sortingAndFiltering.filterInput}"
+ onchange="submit();" />
<h:outputText value="filterValue (#6):"></h:outputText>
- <h:inputText value="#{sortingAndFiltering.filterValue}" onchange="submit();" />
+ <h:inputText value="#{sortingAndFiltering.filterValue}"
+ onchange="submit();" />
<h:outputText value="sortMode" />
- <h:selectOneRadio value="#{sortingAndFiltering.sortMode}" onchange="submit();">
+ <h:selectOneRadio value="#{sortingAndFiltering.sortMode}"
+ onchange="submit();">
<f:selectItem itemLabel="single" itemValue="single" />
- <f:selectItem itemLabel="multy" itemValue="multy" />
+ <f:selectItem itemLabel="multi" itemValue="multi" />
</h:selectOneRadio>
<h:outputText value="selfSorted" />
- <h:selectBooleanCheckbox value="#{sortingAndFiltering.selfSorted}" onchange="submit();" />
+ <h:selectBooleanCheckbox value="#{sortingAndFiltering.selfSorted}"
+ onchange="submit();" />
<h:outputText value="sortOrder" />
- <h:selectOneRadio value="#{sortingAndFiltering.currentSortOrder}" onchange="submit();">
+ <h:selectOneRadio value="#{sortingAndFiltering.currentSortOrder}"
+ onchange="submit();">
<f:selectItem itemLabel="DESCENDING" itemValue="DESCENDING" />
<f:selectItem itemLabel="UNSORTED" itemValue="UNSORTED" />
<f:selectItem itemLabel="ASCENDING" itemValue="ASCENDING" />
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Converter.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Converter.xml 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Converter.xml 2008-03-11 13:27:33 UTC (rev 6686)
@@ -4,10 +4,15 @@
<faces-config>
<converter>
<converter-id>listShuttleConverter</converter-id>
- <converter-class>util.converter.ListShuttleConverter</converter-class>
+ <converter-class>listShuttle.ListShuttleConverter</converter-class>
</converter>
<converter>
<converter-id>orderingListConverter</converter-id>
- <converter-class>util.converter.OrderingListConverter</converter-class>
+ <converter-class>orderingList.OrderingListConverter</converter-class>
</converter>
+ <converter>
+ <converter-id>pickListConverter</converter-id>
+ <converter-class>pickList.PickListConverter</converter-class>
+ </converter>
+
</faces-config>
Added: trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Skinning.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Skinning.xml (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Skinning.xml 2008-03-11 13:27:33 UTC (rev 6686)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>skinning</managed-bean-name>
+ <managed-bean-class>skinning.Skinning</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-03-11 13:27:33 UTC (rev 6686)
@@ -12,7 +12,7 @@
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
- <param-value>/WEB-INF/faces-config-DataTable.xml,/WEB-INF/faces-config-SimpleTogglePanel.xml,/WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,/WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,/WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,/WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,/WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,/WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,/WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,/WEB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,/WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xml,!
/WEB-INF/faces-config-Insert.xml,/WEB-INF/faces-config-RichBean.xml,/WEB-INF/faces-config-ScrollableDataTable.xml,/WEB-INF/faces-config-jQuery.xml,/WEB-INF/faces-config-DragAndDrop.xml,/WEB-INF/faces-config-OrderingList.xml,/WEB-INF/faces-config-DataOrderedList.xml,/WEB-INF/faces-config-DataDefinitionList.xml,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combobox.xml,/WEB-INF/faces-config-PTComponent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-config-FileUpload.xml,/WEB-INF/faces-config-InplaceSelect.xml,/WEB-INF/faces-config-InplaceInput.xml</param-value>
+ <param-value>/WEB-INF/faces-config-DataTable.xml,/WEB-INF/faces-config-SimpleTogglePanel.xml,/WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,/WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,/WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,/WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,/WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,/WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,/WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,/WEB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,/WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xml,!
/WEB-INF/faces-config-Insert.xml,/WEB-INF/faces-config-RichBean.xml,/WEB-INF/faces-config-ScrollableDataTable.xml,/WEB-INF/faces-config-jQuery.xml,/WEB-INF/faces-config-DragAndDrop.xml,/WEB-INF/faces-config-OrderingList.xml,/WEB-INF/faces-config-DataOrderedList.xml,/WEB-INF/faces-config-DataDefinitionList.xml,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combobox.xml,/WEB-INF/faces-config-PTComponent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-config-FileUpload.xml,/WEB-INF/faces-config-InplaceSelect.xml,/WEB-INF/faces-config-InplaceInput.xml,/WEB-INF/faces-config-Skinning.xml</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
@@ -20,12 +20,24 @@
</context-param>
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
- <param-value>enable</param-value>
+ <param-value>#{skinning.skinningClass}</param-value>
</context-param>
+ <context-param>
+ <param-name>org.richfaces.CONTROL_SKINNING</param-name>
+ <param-value>#{skinning.skinning}</param-value>
+ </context-param>
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
+ <init-param>
+ <param-name>createTempFiles</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxRequestSize</param-name>
+ <param-value>143482880</param-value>
+ </init-param>
</filter>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
Modified: trunk/test-applications/jsp/src/main/webapp/pages/RichMenu/RichMenu.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/pages/RichMenu/RichMenu.jsp 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/webapp/pages/RichMenu/RichMenu.jsp 2008-03-11 13:27:33 UTC (rev 6686)
@@ -37,6 +37,11 @@
<h:selectOneMenu binding="#{skinBean.component}" onblur="submit();">
<a4j:support action="#{skinBean.change}" event="onchange" />
</h:selectOneMenu>
+ <h:selectOneMenu value="#{skinning.selectSkinning}" onblur="submit();">
+ <f:selectItem itemLabel="none" itemValue="none"/>
+ <f:selectItem itemLabel="skinning" itemValue="SKINNING"/>
+ <f:selectItem itemLabel="skinningClass" itemValue="SKINNING_CLASSES"/>
+ </h:selectOneMenu>
</h:panelGrid>
<h:panelGrid columns="1">
Modified: trunk/test-applications/jsp/src/main/webapp/pages/main.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/pages/main.jsp 2008-03-11 13:21:56 UTC (rev 6685)
+++ trunk/test-applications/jsp/src/main/webapp/pages/main.jsp 2008-03-11 13:27:33 UTC (rev 6686)
@@ -23,7 +23,7 @@
<h:commandLink value="Select" action="Map"></h:commandLink>
<h:commandLink value="Customize page" action="CustomizePage"></h:commandLink>
</h:panelGrid>
- </rich:panel>
+ </rich:panel>
<rich:spacer></rich:spacer>
<rich:panel>
<h:outputText style="align:right;" value="RichFace: #{a4j.version}" />
16 years, 10 months
JBoss Rich Faces SVN: r6685 - in trunk/test-applications/facelets/src/main: java/fileUpload and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2008-03-11 09:21:56 -0400 (Tue, 11 Mar 2008)
New Revision: 6685
Modified:
trunk/test-applications/facelets/src/main/java/combobox/Combobox.java
trunk/test-applications/facelets/src/main/java/fileUpload/FileUpload.java
trunk/test-applications/facelets/src/main/java/sortingAndFiltering/SortingAndFiltering.java
trunk/test-applications/facelets/src/main/webapp/FileUpload/FileUpload.xhtml
trunk/test-applications/facelets/src/main/webapp/ProgressBar/ProgressBar.xhtml
trunk/test-applications/facelets/src/main/webapp/SortingAndFiltering/SortingAndFiltering.xhtml
trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml
Log:
+ update FileUpload
+ update Combobox
Modified: trunk/test-applications/facelets/src/main/java/combobox/Combobox.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/combobox/Combobox.java 2008-03-11 13:10:18 UTC (rev 6684)
+++ trunk/test-applications/facelets/src/main/java/combobox/Combobox.java 2008-03-11 13:21:56 UTC (rev 6685)
@@ -9,6 +9,10 @@
import util.data.Data;
+/**
+ * @author AYanul
+ *
+ */
public class Combobox {
public boolean disabled;
public String defaultLabel;
@@ -16,7 +20,7 @@
public String hideDelay;
public boolean directInputSuggestions;
public boolean immediate;
- public int inputSize;
+ public String inputSize;
public String width;
public String value;
public int tabindex;
@@ -40,7 +44,7 @@
this.hideDelay = "100";
this.directInputSuggestions = true;
this.immediate = false;
- this.inputSize = 4;
+ this.inputSize = "4";
this.width = "300";
this.value = "";
this.tabindex = 2;
@@ -115,14 +119,6 @@
this.immediate = immediate;
}
- public int getInputSize() {
- return inputSize;
- }
-
- public void setInputSize(int inputSize) {
- this.inputSize = inputSize;
- }
-
public String getWidth() {
return width;
}
@@ -242,4 +238,13 @@
public void setListWidth(String listWidth) {
this.listWidth = listWidth;
}
+
+ public String getInputSize() {
+ return inputSize;
+ }
+
+ public void setInputSize(String inputSize) {
+ this.inputSize = inputSize;
+ }
+
}
Modified: trunk/test-applications/facelets/src/main/java/fileUpload/FileUpload.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/fileUpload/FileUpload.java 2008-03-11 13:10:18 UTC (rev 6684)
+++ trunk/test-applications/facelets/src/main/java/fileUpload/FileUpload.java 2008-03-11 13:21:56 UTC (rev 6685)
@@ -3,10 +3,9 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.ArrayList;
+
import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;
@@ -15,17 +14,20 @@
private boolean autoclear;
private boolean rendered;
private boolean required;
+ private String acceptedTypes;
private String requiredMessage;
private String listHeight;
private String listWidth;
- private Map<String, InputStream> data = new HashMap<String, InputStream>();
+ private ArrayList data;
private Integer maxFilesQuantity;
public FileUpload() {
+ data = new ArrayList();
disabled = false;
autoclear = false;
rendered = true;
required = false;
+ acceptedTypes = "*";
requiredMessage = "requiredMessage";
listHeight = "200px";
listWidth = "150px";
@@ -40,7 +42,6 @@
ByteArrayOutputStream b = new ByteArrayOutputStream();
b.write(upload.getData());
}
-
}
public boolean isDisabled() {
@@ -107,8 +108,19 @@
this.listWidth = listWidth;
}
- public void setData(Map<String, InputStream> data) {
+ public String getAcceptedTypes() {
+ return acceptedTypes;
+ }
+
+ public void setAcceptedTypes(String acceptedTypes) {
+ this.acceptedTypes = acceptedTypes;
+ }
+
+ public ArrayList getData() {
+ return data;
+ }
+
+ public void setData(ArrayList data) {
this.data = data;
}
-
}
Modified: trunk/test-applications/facelets/src/main/java/sortingAndFiltering/SortingAndFiltering.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/sortingAndFiltering/SortingAndFiltering.java 2008-03-11 13:10:18 UTC (rev 6684)
+++ trunk/test-applications/facelets/src/main/java/sortingAndFiltering/SortingAndFiltering.java 2008-03-11 13:21:56 UTC (rev 6685)
@@ -19,11 +19,13 @@
private String currentSortOrder;
private String filterInput;
private String filterValue;
+
private final Comparator<Data> comparator = new Comparator<Data> () {
public int compare(Data o1, Data o2) {
- return o2.getStr1().length() - o1.getStr1().length();
+ return o1.getStr1().length() - o2.getStr1().length();
}
};
+
public String getFilterValue() {
return filterValue;
}
Modified: trunk/test-applications/facelets/src/main/webapp/FileUpload/FileUpload.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/FileUpload/FileUpload.xhtml 2008-03-11 13:10:18 UTC (rev 6684)
+++ trunk/test-applications/facelets/src/main/webapp/FileUpload/FileUpload.xhtml 2008-03-11 13:21:56 UTC (rev 6685)
@@ -2,17 +2,16 @@
<f:subview xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" id="FileUploadSubviewID">
<rich:fileUpload id="fileUploadID" disabled="#{fileUpload.disabled}" autoclear="#{fileUpload.autoclear}"
required="#{fileUpload.required}" requiredMessage="#{fileUpload.requiredMessage}" rendered="#{fileUpload.rendered}"
-listHeight="#{fileUpload.listHeight}" listWidth="#{fileUpload.listHeight}" data="#{fileUpload.data}"
+listHeight="#{fileUpload.listHeight}" listWidth="#{fileUpload.listHeight}" uploadData="#{fileUpload.data}"
maxFilesQuantity="#{fileUpload.maxFilesQuantity}" fileUploadListener="#{fileUpload.fileUploadListener}">
- <f:facet name="progress">
- <rich:progressBar style="height: 5px; width: 250px;">
- </rich:progressBar>
- </f:facet>
<f:facet name="label">
<h:outputText value="{_KB}KB from {KB}KB uploaded :[ {mm}:{ss} ]"></h:outputText>
</f:facet>
</rich:fileUpload>
<h:panelGrid columns="2">
+ <h:outputText value="acceptedTypes"></h:outputText>
+ <h:inputText value="#{fileUpload.acceptedTypes}" onchange="submit();"></h:inputText>
+
<h:outputText value="listHeight"></h:outputText>
<h:inputText value="#{fileUpload.listHeight}" onchange="submit();"></h:inputText>
Modified: trunk/test-applications/facelets/src/main/webapp/ProgressBar/ProgressBar.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/ProgressBar/ProgressBar.xhtml 2008-03-11 13:10:18 UTC (rev 6684)
+++ trunk/test-applications/facelets/src/main/webapp/ProgressBar/ProgressBar.xhtml 2008-03-11 13:21:56 UTC (rev 6685)
@@ -1,12 +1,11 @@
<f:subview xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" id="progressBarSubviewID">
-<rich:panelMenu>
-<rich:panelMenuItem>
+
<rich:progressBar id="progressBarID" value="#{progressBar.value}"
style="width: 450px; height: 19px;#{style.style};" completeClass="#{style.completeClass}" finishClass="#{style.finishClass}" initialClass="#{style.initialClass}" remainClass="#{style.remainClass}" styleClass="#{style.styleClass}"
mode="#{progressBar.mode}" enabled="#{progressBar.enabled}"
actionListener="#{progressBar.actionListener}"
- interval="#{progressBar.interval}" action="#{progressBar.action}"
+ interval="#{progressBar.interval}"
maxValue="#{progressBar.maxValue}" minValue="#{progressBar.minValue}"
rendered="#{progressBar.rendered}" reRender="loadInfoPBID,valuePBID"
progressVar="progressVar" parameters="params:'%'"
@@ -27,19 +26,19 @@
<h:outputText value="Process completed"></h:outputText>
</f:facet>
<h:outputText
- value="{minValue} {params} / {value} {params}/ {maxValue} {params}"></h:outputText>
+ value="{progressVar} | {minValue} {params} / {value} {params}/ {maxValue} {params}"></h:outputText>
<h:outputText id="loadInfoPBID"
value="[Load: #{progressBar.loadInfo}] " />
<h:graphicImage value="/pics/ajax_process.gif" />
</rich:progressBar>
- </rich:panelMenuItem>
- </rich:panelMenu>
+
<f:verbatim>
<br />
</f:verbatim>
+
<h:outputText
- value="[parameters=params:'%'], [{minValue} {params} / {value} {params}/ {maxValue} {params}]" />
+ value="[parameters=params:'%'], [{progressVar} | {minValue} {params} / {value} {params}/ {maxValue} {params}]" />
<h:panelGrid columns="1">
<a4j:commandButton value="getValue"
onclick="alert($('formID:progressBarSubviewID:progressBarID').component.getValue())"></a4j:commandButton>
Modified: trunk/test-applications/facelets/src/main/webapp/SortingAndFiltering/SortingAndFiltering.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/SortingAndFiltering/SortingAndFiltering.xhtml 2008-03-11 13:10:18 UTC (rev 6684)
+++ trunk/test-applications/facelets/src/main/webapp/SortingAndFiltering/SortingAndFiltering.xhtml 2008-03-11 13:21:56 UTC (rev 6685)
@@ -37,7 +37,6 @@
<h:outputText value=" filterExpression='data > filterValue"></h:outputText>
</h:panelGrid>
<h:panelGrid columns="1" title="7">
- <h:outputText value="filterValue='/pics/error.gif'"></h:outputText>
</h:panelGrid>
<h:panelGrid columns="1" title="8">
<h:outputText value="filterBy" />
@@ -46,7 +45,7 @@
<h:outputText value="sortBy"></h:outputText>
</h:panelGrid>
</h:panelGrid>
- <rich:dataTable id="dataTableSAFID" value="#{sortingAndFiltering.data}" var="data">
+ <rich:dataTable id="dataTableSAFID" value="#{sortingAndFiltering.data}" var="data" sortMode="#{sortingAndFiltering.sortMode}">
<rich:column sortBy="#{data.int0}" selfSorted="#{sortingAndFiltering.selfSorted}" sortOrder="#{sortingAndFiltering.sortOrder}"
filterBy="#{data.int0}">
<f:facet name="header">
@@ -104,7 +103,7 @@
<h:outputText value="#6" />
</f:facet>
</rich:column>
- <rich:column filterValue="/pics/error.gif">
+ <rich:column>
<f:facet name="header">
<h:outputText value="#7" />
</f:facet>
Modified: trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml 2008-03-11 13:10:18 UTC (rev 6684)
+++ trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml 2008-03-11 13:21:56 UTC (rev 6685)
@@ -43,6 +43,14 @@
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
+ <init-param>
+ <param-name>createTempFiles</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxRequestSize</param-name>
+ <param-value>143482880</param-value>
+ </init-param>
</filter>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
16 years, 10 months
JBoss Rich Faces SVN: r6684 - trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-03-11 09:10:18 -0400 (Tue, 11 Mar 2008)
New Revision: 6684
Modified:
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
http://jira.jboss.com/jira/browse/RF-2349
Modified: trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-03-11 12:59:26 UTC (rev 6683)
+++ trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-03-11 13:10:18 UTC (rev 6684)
@@ -149,17 +149,16 @@
},
ieSelectWorkAround: function(menuName, on){
- //alert(navigator.userAgent);
if(this.IE || this.NS) {
- menuName = $(menuName).id;
var menu = $(menuName);
+ menuName = menu.id;
var iframe = $(menuName + "_iframe");
if(!iframe&&on){
- iframe = this.initIFrame(menu);
+ this.initIFrame(menu);
+ iframe = $(menuName + "_iframe");
}
var nsfix = (this.NS ? 7 : 0);
if(on){
- var dim = Element.getDimensions(menu);
iframe.style.top = menu.style.top;
iframe.style.left = menu.style.left;
iframe.style.width = menu.offsetWidth + "px"
16 years, 10 months
JBoss Rich Faces SVN: r6683 - in trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures: examples and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-11 08:59:26 -0400 (Tue, 11 Mar 2008)
New Revision: 6683
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleSingleSorting.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/sortingUsage.xhtml
Log:
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml 2008-03-11 12:31:00 UTC (rev 6682)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml 2008-03-11 12:59:26 UTC (rev 6683)
@@ -5,7 +5,12 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<h:form>
- <rich:panel style="overflow:auto; width:300px; height:300px;">
+ <style>
+ .rich-inplace-view{
+ color:gray;
+ border-bottom-color:gray;
+ }
+ </style>
<rich:dataTable value="#{capitalsBean.capitals}" var="cap" width="500px">
<f:facet name="header">
<h:outputText value="Filtering Example"/>
@@ -16,13 +21,12 @@
</f:facet>
<h:graphicImage value="#{cap.stateFlag}"/>
</rich:column>
- <rich:column filterBy="#{cap.state}">
- <rich:calendar popup="true"></rich:calendar>
+ <rich:column filterBy="#{cap.state}" filterDefaultLabel="click to filter">
+ <h:outputText value="#{cap.state}"></h:outputText>
</rich:column>
- <rich:column filterBy="#{cap.name}">
- <rich:inplaceInput value="#{cap.name}"/>
+ <rich:column filterBy="#{cap.name}" filterDefaultLabel="click to filter">
+ <h:outputText value="#{cap.name}"/>
</rich:column>
</rich:dataTable>
- </rich:panel>
</h:form>
</ui:composition>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleSingleSorting.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleSingleSorting.xhtml 2008-03-11 12:31:00 UTC (rev 6682)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleSingleSorting.xhtml 2008-03-11 12:59:26 UTC (rev 6683)
@@ -0,0 +1,26 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <h:form>
+ <rich:dataTable value="#{capitalsBean.capitals}" var="cap" width="300px">
+ <f:facet name="header">
+ <h:outputText value="Sorting Example"/>
+ </f:facet>
+ <rich:column sortBy="#{cap.state}">
+ <f:facet name="header">
+ <h:outputText value="State Name"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{cap.state}"></h:outputText>
+ </rich:column>
+ <rich:column sortBy="#{cap.name}">
+ <f:facet name="header">
+ <h:outputText value="State Capital"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{cap.name}"/>
+ </rich:column>
+ </rich:dataTable>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/sortingUsage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/sortingUsage.xhtml 2008-03-11 12:31:00 UTC (rev 6682)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/sortingUsage.xhtml 2008-03-11 12:59:26 UTC (rev 6683)
@@ -1,3 +1,29 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-</html>
\ No newline at end of file
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+ <p>
+ SHORT DESCRIPTION
+ </p>
+
+ <div class="sample-container" >
+
+ <ui:include src="/richfaces/sortingFilteringFeatures/examples/simpleSingleSorting.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/sortingFilteringFeatures/examples/simpleSingleSorting.xhtml"/>
+ </ui:include>
+ </div>
+
+ <p>
+ DESCRIPTION
+ </p>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
16 years, 10 months
JBoss Rich Faces SVN: r6682 - in trunk/ui/combobox/src/test/java/org/richfaces: renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-11 08:31:00 -0400 (Tue, 11 Mar 2008)
New Revision: 6682
Modified:
trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java
trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
Log:
format code
Modified: trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java
===================================================================
--- trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java 2008-03-11 12:25:36 UTC (rev 6681)
+++ trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java 2008-03-11 12:31:00 UTC (rev 6682)
@@ -44,122 +44,121 @@
public class ComboBoxComponentTest extends AbstractAjax4JsfTestCase {
- UIComboBox comboBox;
- UIForm form;
- String suggestions = "Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Massachusetts,Michigan,Georgia,Hawaii,Idaho,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Minnesota,Mississippi,Missouri,Montana,Nebraska";
- List selectItems = new ArrayList();
+ UIComboBox comboBox;
+ UIForm form;
+ String suggestions = "Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Massachusetts,Michigan,Georgia,Hawaii,Idaho,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Minnesota,Mississippi,Missouri,Montana,Nebraska";
+ List selectItems = new ArrayList();
-
- private static Set javaScripts = new HashSet();
+ private static Set javaScripts = new HashSet();
- static {
- javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
- javaScripts.add("scripts/comboboxUtils.js");
- javaScripts.add("scripts/combobox.js");
- javaScripts.add("scripts/combolist.js");
- javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
+ static {
+ javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
+ javaScripts.add("scripts/comboboxUtils.js");
+ javaScripts.add("scripts/combobox.js");
+ javaScripts.add("scripts/combolist.js");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
- }
-
- public ComboBoxComponentTest( String testName ) {
- super( testName );
}
- public void setUp() throws Exception {
- super.setUp();
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- comboBox = (UIComboBox)application.createComponent("org.richfaces.ComboBox");
- comboBox.setSuggestionValues(Arrays.asList(suggestions.split(",")));
-
- selectItems.add(new SelectItem("District of Columbia"));
- selectItems.add(new SelectItem("Illinois"));
- selectItems.add(new SelectItem("Maryland"));
- selectItems.add(new SelectItem("Nevada"));
- selectItems.add(new SelectItem("New Hampshire"));
- selectItems.add(new SelectItem("New Jersey"));
-
- UISelectItem item1 = new UISelectItem();
- item1.setValue(new SelectItem("Oregon"));
-
- UISelectItem item2 = new UISelectItem();
- item2.setValue(new SelectItem("Pennsylvania"));
-
- UISelectItem item3 = new UISelectItem();
- item3.setValue(new SelectItem("Rhode Island"));
-
- UISelectItem item4 = new UISelectItem();
- item4.setValue(new SelectItem("South Carolina"));
-
- comboBox.getChildren().add(item1);
- comboBox.getChildren().add(item2);
- comboBox.getChildren().add(item3);
- comboBox.getChildren().add(item4);
-
-
- UISelectItems items = new UISelectItems();
- items.setValue(selectItems);
- comboBox.getChildren().add(items);
- form.getChildren().add(comboBox);
+ public ComboBoxComponentTest(String testName) {
+ super(testName);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ comboBox = (UIComboBox) application.createComponent("org.richfaces.ComboBox");
+ comboBox.setSuggestionValues(Arrays.asList(suggestions.split(",")));
+
+ selectItems.add(new SelectItem("District of Columbia"));
+ selectItems.add(new SelectItem("Illinois"));
+ selectItems.add(new SelectItem("Maryland"));
+ selectItems.add(new SelectItem("Nevada"));
+ selectItems.add(new SelectItem("New Hampshire"));
+ selectItems.add(new SelectItem("New Jersey"));
+
+ UISelectItem item1 = new UISelectItem();
+ item1.setValue(new SelectItem("Oregon"));
+
+ UISelectItem item2 = new UISelectItem();
+ item2.setValue(new SelectItem("Pennsylvania"));
+
+ UISelectItem item3 = new UISelectItem();
+ item3.setValue(new SelectItem("Rhode Island"));
+
+ UISelectItem item4 = new UISelectItem();
+ item4.setValue(new SelectItem("South Carolina"));
+
+ comboBox.getChildren().add(item1);
+ comboBox.getChildren().add(item2);
+ comboBox.getChildren().add(item3);
+ comboBox.getChildren().add(item4);
+
+ UISelectItems items = new UISelectItems();
+ items.setValue(selectItems);
+ comboBox.getChildren().add(items);
+ form.getChildren().add(comboBox);
+ }
+
+ public void testRender() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ }
+
+ public void testComboBoxStyles() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List links = page.getDocumentElement().getHtmlElementsByTagName("link");
+ if (links.size() == 0) {
+ fail();
}
-
- public void testRender() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
+ for (int i = 0; i < links.size(); i++) {
+ HtmlElement link = (HtmlElement) links.get(i);
+ assertTrue(link.getAttributeValue("href").contains("css/combobox.xcss"));
}
-
- public void testComboBoxStyles() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- List links = page.getDocumentElement().getHtmlElementsByTagName("link");
- if(links.size()==0){fail();}
- for (int i = 0; i < links.size(); i++) {
- HtmlElement link = (HtmlElement) links.get(i);
- assertTrue(link.getAttributeValue("href").contains(
- "css/combobox.xcss"));
- }
- }
-
- public void testComboBoxScripts() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
+ }
- List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
- for (Iterator it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = (HtmlScript) it.next();
- String srcAttr = item.getSrcAttribute();
- if (item.getFirstChild() != null) {
- String scriptBodyString = item.getFirstChild().toString();
- if (scriptBodyString.contains("Richfaces.ComboBox")) {
- assertTrue(scriptBodyString.contains("Richfaces.ComboBox.CLASSES"));
- }
- }
+ public void testComboBoxScripts() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
- if (StringUtils.isNotBlank(srcAttr)) {
- boolean found = false;
- for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
- String src = (String) srcIt.next();
- found = srcAttr.contains(src);
- if (found) {
- break;
- }
- }
- assertTrue(found);
- }
+ List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
+ for (Iterator it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = (HtmlScript) it.next();
+ String srcAttr = item.getSrcAttribute();
+ if (item.getFirstChild() != null) {
+ String scriptBodyString = item.getFirstChild().toString();
+ if (scriptBodyString.contains("Richfaces.ComboBox")) {
+ assertTrue(scriptBodyString.contains("Richfaces.ComboBox.CLASSES"));
}
+ }
+
+ if (StringUtils.isNotBlank(srcAttr)) {
+ boolean found = false;
+ for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
+ String src = (String) srcIt.next();
+ found = srcAttr.contains(src);
+ if (found) {
+ break;
+ }
+ }
+ assertTrue(found);
+ }
}
-
- public void tearDown() throws Exception {
- // TODO Auto-generated method stub
- form = null;
- comboBox = null;
- super.tearDown();
- }
-
+ }
+
+ public void tearDown() throws Exception {
+ // TODO Auto-generated method stub
+ form = null;
+ comboBox = null;
+ super.tearDown();
+ }
+
public void testComponent() {
- assertTrue( true );
+ assertTrue(true);
}
}
Modified: trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
===================================================================
--- trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-03-11 12:25:36 UTC (rev 6681)
+++ trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-03-11 12:31:00 UTC (rev 6682)
@@ -26,74 +26,70 @@
*/
public class ComboBoxRendererTest extends AbstractAjax4JsfTestCase {
- private UIComponent form;
- private UIComboBox comboBox;
- private ComboBoxRenderer renderer;
- String suggestions = "Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Massachusetts,Michigan,Georgia,Hawaii,Idaho,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Minnesota,Mississippi,Missouri,Montana,Nebraska";
- List selectItems = new ArrayList();
+ private UIComponent form;
+ private UIComboBox comboBox;
+ private ComboBoxRenderer renderer;
+ String suggestions = "Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Massachusetts,Michigan,Georgia,Hawaii,Idaho,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Minnesota,Mississippi,Missouri,Montana,Nebraska";
+ List selectItems = new ArrayList();
+ public void setUp() throws Exception {
+ super.setUp();
+ renderer = new ComboBoxRenderer();
+ comboBox = (UIComboBox) application.createComponent("org.richfaces.ComboBox");
+ comboBox.setSuggestionValues(Arrays.asList(suggestions.split(",")));
+ selectItems.add(new SelectItem("District of Columbia"));
+ selectItems.add(new SelectItem("Illinois"));
+ selectItems.add(new SelectItem("Maryland"));
+ selectItems.add(new SelectItem("Nevada"));
+ selectItems.add(new SelectItem("New Hampshire"));
+ selectItems.add(new SelectItem("New Jersey"));
-
- public void setUp() throws Exception {
- super.setUp();
- renderer = new ComboBoxRenderer();
- comboBox = (UIComboBox)application.createComponent("org.richfaces.ComboBox");
- comboBox.setSuggestionValues(Arrays.asList(suggestions.split(",")));
-
- selectItems.add(new SelectItem("District of Columbia"));
- selectItems.add(new SelectItem("Illinois"));
- selectItems.add(new SelectItem("Maryland"));
- selectItems.add(new SelectItem("Nevada"));
- selectItems.add(new SelectItem("New Hampshire"));
- selectItems.add(new SelectItem("New Jersey"));
-
- UISelectItem item1 = new UISelectItem();
- item1.setValue(new SelectItem("Oregon"));
-
- UISelectItem item2 = new UISelectItem();
- item2.setValue(new SelectItem("Pennsylvania"));
-
- UISelectItem item3 = new UISelectItem();
- item3.setValue(new SelectItem("Rhode Island"));
-
- UISelectItem item4 = new UISelectItem();
- item4.setValue(new SelectItem("South Carolina"));
-
- comboBox.getChildren().add(item1);
- comboBox.getChildren().add(item2);
- comboBox.getChildren().add(item3);
- comboBox.getChildren().add(item4);
-
- UISelectItems items = new UISelectItems();
- items.setValue(selectItems);
- facesContext.getViewRoot().getChildren().add(comboBox);
-
- Map requestMap = facesContext.getExternalContext().getRequestParameterMap();
- String id = "comboBoxValue" + comboBox.getClientId(facesContext);
- requestMap.put(id, "Pennsylvania");
- }
-
- public void itemsTextAsJSArrayTest() {
- String script = renderer.getItemsTextAsJSArray(facesContext, comboBox);
- assertNotNull(script);
- }
-
- public void testRender() throws Exception{
-
- HtmlPage page = renderView();
- assertNotNull(page);
- HtmlElement elem = page.getHtmlElementById(comboBox.getClientId(facesContext));
- assertNotNull(elem);
- assertEquals(elem.getTagName(), "div");
- }
-
-
- public void tearDown() throws Exception {
- super.tearDown();
- renderer = null;
- }
-
- public ComboBoxRendererTest(String name) {
- super(name);
- }
+ UISelectItem item1 = new UISelectItem();
+ item1.setValue(new SelectItem("Oregon"));
+
+ UISelectItem item2 = new UISelectItem();
+ item2.setValue(new SelectItem("Pennsylvania"));
+
+ UISelectItem item3 = new UISelectItem();
+ item3.setValue(new SelectItem("Rhode Island"));
+
+ UISelectItem item4 = new UISelectItem();
+ item4.setValue(new SelectItem("South Carolina"));
+
+ comboBox.getChildren().add(item1);
+ comboBox.getChildren().add(item2);
+ comboBox.getChildren().add(item3);
+ comboBox.getChildren().add(item4);
+
+ UISelectItems items = new UISelectItems();
+ items.setValue(selectItems);
+ facesContext.getViewRoot().getChildren().add(comboBox);
+
+ Map requestMap = facesContext.getExternalContext().getRequestParameterMap();
+ String id = "comboBoxValue" + comboBox.getClientId(facesContext);
+ requestMap.put(id, "Pennsylvania");
+ }
+
+ public void itemsTextAsJSArrayTest() {
+ String script = renderer.getItemsTextAsJSArray(facesContext, comboBox);
+ assertNotNull(script);
+ }
+
+ public void testRender() throws Exception {
+
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ HtmlElement elem = page.getHtmlElementById(comboBox.getClientId(facesContext));
+ assertNotNull(elem);
+ assertEquals(elem.getTagName(), "div");
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ renderer = null;
+ }
+
+ public ComboBoxRendererTest(String name) {
+ super(name);
+ }
}
16 years, 10 months
JBoss Rich Faces SVN: r6681 - in trunk/ui/inplaceSelect/src/main/java/org/richfaces: renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-11 08:25:36 -0400 (Tue, 11 Mar 2008)
New Revision: 6681
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/component/UIInplaceSelect.java
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
Log:
add desc, format code
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/component/UIInplaceSelect.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/component/UIInplaceSelect.java 2008-03-11 12:23:57 UTC (rev 6680)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/component/UIInplaceSelect.java 2008-03-11 12:25:36 UTC (rev 6681)
@@ -9,7 +9,9 @@
import org.ajax4jsf.util.SelectUtils;
/**
+ * UI implementation of ComboBox component
* @author Anton Belevich
+ * @since 3.2.0
*
*/
public class UIInplaceSelect extends UISelectOne{
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-03-11 12:23:57 UTC (rev 6680)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-03-11 12:25:36 UTC (rev 6681)
@@ -23,8 +23,9 @@
import org.richfaces.component.UIInplaceSelect;
/**
+ * InplaceSelect base renderer implementation
* @author Anton Belevich
- *
+ * @since 3.2.0
*/
public class InplaceSelectBaseRenderer extends ComboBoxBaseRenderer{
@@ -33,96 +34,92 @@
private static final String CONTROLS_FACET = "controls";
- @Override
- protected void doDecode(FacesContext context, UIComponent component) {
- UIInplaceSelect inplaceInput = null;
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ UIInplaceSelect inplaceInput = null;
- if (component instanceof UIInplaceSelect) {
- inplaceInput = (UIInplaceSelect) component;
- } else {
- if (logger.isDebugEnabled()) {
- logger.debug("No decoding necessary since the component "
- + component.getId() +
- " is not an instance or a sub class of UIInplaceSelect");
- }
- return;
- }
-
- if (InputUtils.isDisabled(inplaceInput) || InputUtils.isReadOnly(inplaceInput)) {
- if (logger.isDebugEnabled()) {
- logger.debug(("No decoding necessary since the component "
- + component.getId() + " is disabled"));
- }
- }
-
- String clientId = component.getClientId(context);
- if (clientId == null) {
- throw new NullPointerException("component " + inplaceInput.getClientId(context) + " client id is NULL" );
- }
-
- clientId = clientId + "inplaceValue";
- Map request = context.getExternalContext().getRequestParameterMap();
- if (request.containsKey(clientId)) {
- String newValue = (String)request.get(clientId);
- inplaceInput.setSubmittedValue(newValue);
- }
+ if (component instanceof UIInplaceSelect) {
+ inplaceInput = (UIInplaceSelect) component;
+ } else {
+ if (logger.isDebugEnabled()) {
+ logger.debug("No decoding necessary since the component " + component.getId() + " is not an instance or a sub class of UIInplaceSelect");
+ }
+ return;
}
-
- @Override
- public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException {
- UIInplaceSelect select = null;
- Converter converter = null;
- if (component instanceof UIInplaceSelect) {
- select = (UIInplaceSelect)component;
- converter = select.getConverter();
- }
- return getConvertedValue(context, component, submittedValue, converter);
+
+ if (InputUtils.isDisabled(inplaceInput) || InputUtils.isReadOnly(inplaceInput)) {
+ if (logger.isDebugEnabled()) {
+ logger.debug(("No decoding necessary since the component " + component.getId() + " is disabled"));
+ }
}
-
- public void encodeItems(FacesContext context, UIComponent component) throws IOException {
- List values = new ArrayList();
- ResponseWriter writer = context.getResponseWriter();
-
- List <SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
- if(!selectItems.isEmpty()) {
- for (Iterator <SelectItem> iterator = selectItems.iterator(); iterator.hasNext();) {
- SelectItem selectItem = iterator.next();
- String value = getConvertedStringValue(context, component, selectItem.getValue());
- values.add(value);
- encodeSuggestion(writer, component, value, RICH_INPLACE_SELECT_CLASSES);
- }
- }
- setValuesList(values);
+
+ String clientId = component.getClientId(context);
+ if (clientId == null) {
+ throw new NullPointerException("component " + inplaceInput.getClientId(context) + " client id is NULL");
}
-
- public void encodeControlsFacet(FacesContext context, UIComponent component) throws IOException {
- UIComponent facet = component.getFacet(CONTROLS_FACET);
- if ((facet != null) && (facet.isRendered())) {
- renderChild(context, facet);
- }
+
+ clientId = clientId + "inplaceValue";
+ Map request = context.getExternalContext().getRequestParameterMap();
+ if (request.containsKey(clientId)) {
+ String newValue = (String) request.get(clientId);
+ inplaceInput.setSubmittedValue(newValue);
}
-
- public boolean isControlsFacetExists(FacesContext context, UIComponent component) {
- UIComponent facet = component.getFacet(CONTROLS_FACET);
- if (facet != null && facet.isRendered()) {
- return true;
- }
- return false;
+ }
+
+ @Override
+ public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException {
+ UIInplaceSelect select = null;
+ Converter converter = null;
+ if (component instanceof UIInplaceSelect) {
+ select = (UIInplaceSelect) component;
+ converter = select.getConverter();
}
+ return getConvertedValue(context, component, submittedValue, converter);
+ }
-
- @Override
- protected String getConvertedStringValue(FacesContext context, UIComponent component, Object value) {
- UIInplaceSelect select = null;
- Converter converter = null;
- if (component instanceof UIInplaceSelect) {
- select = (UIInplaceSelect)component;
- converter = select.getConverter();
- }
- return getConvertedStringValue(context, component, value, converter);
+ public void encodeItems(FacesContext context, UIComponent component) throws IOException {
+ List values = new ArrayList();
+ ResponseWriter writer = context.getResponseWriter();
+
+ List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
+ if (!selectItems.isEmpty()) {
+ for (Iterator<SelectItem> iterator = selectItems.iterator(); iterator.hasNext();) {
+ SelectItem selectItem = iterator.next();
+ String value = getConvertedStringValue(context, component, selectItem.getValue());
+ values.add(value);
+ encodeSuggestion(writer, component, value, RICH_INPLACE_SELECT_CLASSES);
+ }
}
-
- protected Class <? extends UIComponent> getComponentClass() {
- return UIInplaceSelect.class;
+ setValuesList(values);
+ }
+
+ public void encodeControlsFacet(FacesContext context, UIComponent component) throws IOException {
+ UIComponent facet = component.getFacet(CONTROLS_FACET);
+ if ((facet != null) && (facet.isRendered())) {
+ renderChild(context, facet);
}
+ }
+
+ public boolean isControlsFacetExists(FacesContext context, UIComponent component) {
+ UIComponent facet = component.getFacet(CONTROLS_FACET);
+ if (facet != null && facet.isRendered()) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ protected String getConvertedStringValue(FacesContext context, UIComponent component, Object value) {
+ UIInplaceSelect select = null;
+ Converter converter = null;
+ if (component instanceof UIInplaceSelect) {
+ select = (UIInplaceSelect) component;
+ converter = select.getConverter();
+ }
+ return getConvertedStringValue(context, component, value, converter);
+ }
+
+ protected Class<? extends UIComponent> getComponentClass() {
+ return UIInplaceSelect.class;
+ }
}
16 years, 10 months
JBoss Rich Faces SVN: r6680 - in trunk/ui/combobox/src: main/templates and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-11 08:23:57 -0400 (Tue, 11 Mar 2008)
New Revision: 6680
Modified:
trunk/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java
trunk/ui/combobox/src/main/templates/combobox.jspx
trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
Log:
http://jira.jboss.com/jira/browse/RF-2445, format code, fix junit
Modified: trunk/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java
===================================================================
--- trunk/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java 2008-03-11 11:35:33 UTC (rev 6679)
+++ trunk/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java 2008-03-11 12:23:57 UTC (rev 6680)
@@ -36,197 +36,190 @@
*/
public class ComboBoxBaseRenderer extends HeaderResourcesRendererBase {
- private List valuesList = null;
-
- private final String RICH_COMBOBOX_ITEM_CLASSES = "rich-combobox-item rich-combobox-item-normal";
- private static Log logger = LogFactory.getLog(ComboBoxBaseRenderer.class);
-
-
- protected Class<? extends UIComponent> getComponentClass() {
- return UIComboBox.class;
+ private List valuesList = null;
+ private final String RICH_COMBOBOX_ITEM_CLASSES = "rich-combobox-item rich-combobox-item-normal";
+ private static Log logger = LogFactory.getLog(ComboBoxBaseRenderer.class);
+
+ protected Class<? extends UIComponent> getComponentClass() {
+ return UIComboBox.class;
+ }
+
+ protected void doDecode(FacesContext context, UIComponent component) {
+ UIComboBox comboBox = null;
+
+ if (component instanceof UIComboBox) {
+ comboBox = (UIComboBox) component;
+ } else {
+ if (logger.isDebugEnabled()) {
+ logger.debug("No decoding necessary since the component " + component.getId() + " is not an instance or a sub class of UIComboBox");
+ }
+ return;
}
-
- protected void doDecode(FacesContext context, UIComponent component) {
- UIComboBox comboBox = null;
- if (component instanceof UIComboBox) {
- comboBox = (UIComboBox)component;
- } else {
- if (logger.isDebugEnabled()) {
- logger.debug("No decoding necessary since the component "
- + component.getId() + " is not an instance or a sub class of UIComboBox");
- }
- return;
- }
-
- if (InputUtils.isDisabled(comboBox) || InputUtils.isReadOnly(comboBox)) {
- if (logger.isDebugEnabled()) {
- logger.debug(("No decoding necessary since the component "
- + component.getId() + " is disabled"));
- }
- }
-
- String clientId = component.getClientId(context);
- if (clientId == null) {
- throw new NullPointerException("component " + comboBox.getClientId(context) + " client id is NULL" );
- }
-
- clientId = "comboboxValue" + clientId;
- Map request = context.getExternalContext().getRequestParameterMap();
- if (request.containsKey(clientId)) {
- String newValue = (String)request.get(clientId);
- comboBox.setSubmittedValue(newValue);
- }
+ if (InputUtils.isDisabled(comboBox) || InputUtils.isReadOnly(comboBox)) {
+ if (logger.isDebugEnabled()) {
+ logger.debug(("No decoding necessary since the component " + component.getId() + " is disabled"));
+ }
}
-
- public void encodeItems( FacesContext context, UIComponent component) throws IOException {
- UIComboBox comboBox = (UIComboBox)component;
- Object suggestionValues = comboBox.getSuggestionValues();
- ResponseWriter writer = context.getResponseWriter();
-
- List values = new ArrayList();
-
- if (suggestionValues != null) {
- if (suggestionValues instanceof Collection) {
- for (Iterator iterator = ((Collection)suggestionValues).iterator(); iterator.hasNext();) {
- String value = getConvertedStringValue(context, comboBox, iterator.next()) ;
- values.add(value);
- encodeSuggestion(writer, comboBox, value, RICH_COMBOBOX_ITEM_CLASSES);
- }
- } else if (suggestionValues.getClass().isArray()) {
- Object [] suggestions = (Object [])suggestionValues;
- for (int i = 0; i < suggestions.length; i++) {
- String value = getConvertedStringValue(context, comboBox, suggestions[i]);
- values.add(value);
- encodeSuggestion(writer, comboBox, value, RICH_COMBOBOX_ITEM_CLASSES );
- }
- } else {
- throw new IllegalArgumentException("suggestionValues should be Collection or array");
- }
-
- }
-
- List <SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
- if(!selectItems.isEmpty()) {
- for (Iterator <SelectItem> iterator = selectItems.iterator(); iterator.hasNext();) {
- SelectItem selectItem = iterator.next();
- String value = getConvertedStringValue(context, comboBox, selectItem.getValue());
- values.add(value);
- encodeSuggestion(writer, comboBox, value, RICH_COMBOBOX_ITEM_CLASSES);
- }
- }
- setValuesList(values);
+
+ String clientId = component.getClientId(context);
+ if (clientId == null) {
+ throw new NullPointerException("component " + comboBox.getClientId(context) + " client id is NULL");
}
-
- @Override
- public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException {
- UIComboBox comboBox = null;
- Converter converter = null;
-
- if(component instanceof UIComboBox) {
- comboBox = (UIComboBox)component;
- converter = comboBox.getConverter();
- }
-
- return getConvertedValue(context, component, submittedValue, converter);
+
+ clientId = clientId + "comboboxValue";
+ Map request = context.getExternalContext().getRequestParameterMap();
+ if (request.containsKey(clientId)) {
+ String newValue = (String) request.get(clientId);
+ comboBox.setSubmittedValue(newValue);
}
-
- public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue, Converter converter) {
- Object convertedValue = null;
- String newValue = (String)submittedValue;
+ }
- ValueExpression valueExpression = component.getValueExpression("value");
-
- if (converter == null) {
- if (valueExpression != null) {
- Class valueType = valueExpression.getType(context.getELContext());
- if(valueType == null || String.class.equals(valueType) || Object.class.equals(valueType)){
- if(logger.isDebugEnabled()) {
- logger.debug("No conversion necessary for value " +
- newValue + " of component " + component.getClientId(context));
- }
- } else {
- converter = context.getApplication().createConverter(valueType);
- if(converter == null){
- throw new ConverterException(Messages.getMessage(Messages.NO_CONVERTER_FOUND_ERROR, valueType.getName()));
- }
- }
- }
+ public void encodeItems(FacesContext context, UIComponent component) throws IOException {
+ UIComboBox comboBox = (UIComboBox) component;
+ Object suggestionValues = comboBox.getSuggestionValues();
+ ResponseWriter writer = context.getResponseWriter();
+
+ List values = new ArrayList();
+
+ if (suggestionValues != null) {
+ if (suggestionValues instanceof Collection) {
+ for (Iterator iterator = ((Collection) suggestionValues).iterator(); iterator.hasNext();) {
+ String value = getConvertedStringValue(context, comboBox, iterator.next());
+ values.add(value);
+ encodeSuggestion(writer, comboBox, value, RICH_COMBOBOX_ITEM_CLASSES);
}
-
- if(converter != null){
- convertedValue = converter.getAsObject(context, component, newValue);
- } else {
- convertedValue = newValue;
+ } else if (suggestionValues.getClass().isArray()) {
+ Object[] suggestions = (Object[]) suggestionValues;
+ for (int i = 0; i < suggestions.length; i++) {
+ String value = getConvertedStringValue(context, comboBox, suggestions[i]);
+ values.add(value);
+ encodeSuggestion(writer, comboBox, value, RICH_COMBOBOX_ITEM_CLASSES);
}
- return convertedValue;
-
-
+ } else {
+ throw new IllegalArgumentException("suggestionValues should be Collection or array");
+ }
+
}
-
- protected String getConvertedStringValue(FacesContext context, UIComponent component, Object value) {
- Converter converter = null;
- if (component instanceof UIComboBox) {
- UIComboBox comboBox = (UIComboBox)component;
- converter = comboBox.getConverter();
- }
- return getConvertedStringValue(context, component, value, converter);
+
+ List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
+ if (!selectItems.isEmpty()) {
+ for (Iterator<SelectItem> iterator = selectItems.iterator(); iterator.hasNext();) {
+ SelectItem selectItem = iterator.next();
+ String value = getConvertedStringValue(context, comboBox, selectItem.getValue());
+ values.add(value);
+ encodeSuggestion(writer, comboBox, value, RICH_COMBOBOX_ITEM_CLASSES);
+ }
}
-
- protected String getConvertedStringValue(FacesContext context, UIComponent component, Object value, Converter converter) {
- if (converter == null) {
- if (value == null) {
- return "";
- } else if (value instanceof String) {
- return (String) value;
- }
-
- Class converterType = value.getClass();
- if (converterType != null ) {
- converter = context.getApplication().createConverter(converterType);
- }
-
- if (converter == null) {
- return value.toString();
- }
+ setValuesList(values);
+ }
+
+ @Override
+ public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException {
+ UIComboBox comboBox = null;
+ Converter converter = null;
+
+ if (component instanceof UIComboBox) {
+ comboBox = (UIComboBox) component;
+ converter = comboBox.getConverter();
+ }
+
+ return getConvertedValue(context, component, submittedValue, converter);
+ }
+
+ public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue, Converter converter) {
+ Object convertedValue = null;
+ String newValue = (String) submittedValue;
+
+ ValueExpression valueExpression = component.getValueExpression("value");
+
+ if (converter == null) {
+ if (valueExpression != null) {
+ Class valueType = valueExpression.getType(context.getELContext());
+ if (valueType == null || String.class.equals(valueType) || Object.class.equals(valueType)) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("No conversion necessary for value " + newValue + " of component " + component.getClientId(context));
+ }
+ } else {
+ converter = context.getApplication().createConverter(valueType);
+ if (converter == null) {
+ throw new ConverterException(Messages.getMessage(Messages.NO_CONVERTER_FOUND_ERROR, valueType.getName()));
+ }
}
- return converter.getAsString(context, component, value);
+ }
}
-
- public void encodeSuggestion(ResponseWriter writer, UIComponent component, String value, String classes) throws IOException{
- writer.startElement(HTML.SPAN_ELEM, component);
- writer.writeAttribute(HTML.class_ATTRIBUTE, classes, null);
- writer.write(value);
- writer.endElement(HTML.SPAN_ELEM);
+
+ if (converter != null) {
+ convertedValue = converter.getAsObject(context, component, newValue);
+ } else {
+ convertedValue = newValue;
}
-
- public String getItemsTextAsJSArray(FacesContext context, UIComponent component) {
- return ScriptUtils.toScript(valuesList);
- }
-
- public String getAsEventHandler(FacesContext context, UIComponent component, String attributeName) {
- String event = (String) component.getAttributes().get(attributeName);
- ScriptString result = JSReference.NULL;
-
- if (event != null) {
- event = event.trim();
-
- if (event.length() != 0) {
- JSFunctionDefinition function = new JSFunctionDefinition();
- function.addParameter("event");
- function.addToBody(event);
+ return convertedValue;
- result = function;
- }
- }
- return ScriptUtils.toScript(result);
+ }
+
+ protected String getConvertedStringValue(FacesContext context, UIComponent component, Object value) {
+ Converter converter = null;
+ if (component instanceof UIComboBox) {
+ UIComboBox comboBox = (UIComboBox) component;
+ converter = comboBox.getConverter();
}
+ return getConvertedStringValue(context, component, value, converter);
+ }
- public List getValuesList() {
- return valuesList;
+ protected String getConvertedStringValue(FacesContext context, UIComponent component, Object value, Converter converter) {
+ if (converter == null) {
+ if (value == null) {
+ return "";
+ } else if (value instanceof String) {
+ return (String) value;
+ }
+
+ Class converterType = value.getClass();
+ if (converterType != null) {
+ converter = context.getApplication().createConverter(converterType);
+ }
+
+ if (converter == null) {
+ return value.toString();
+ }
}
+ return converter.getAsString(context, component, value);
+ }
- public void setValuesList(List valuesList) {
- this.valuesList = valuesList;
+ public void encodeSuggestion(ResponseWriter writer, UIComponent component, String value, String classes) throws IOException {
+ writer.startElement(HTML.SPAN_ELEM, component);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, classes, null);
+ writer.write(value);
+ writer.endElement(HTML.SPAN_ELEM);
+ }
+
+ public String getItemsTextAsJSArray(FacesContext context, UIComponent component) {
+ return ScriptUtils.toScript(valuesList);
+ }
+
+ public String getAsEventHandler(FacesContext context, UIComponent component, String attributeName) {
+ String event = (String) component.getAttributes().get(attributeName);
+ ScriptString result = JSReference.NULL;
+
+ if (event != null) {
+ event = event.trim();
+ if (event.length() != 0) {
+ JSFunctionDefinition function = new JSFunctionDefinition();
+ function.addParameter("event");
+ function.addToBody(event);
+ result = function;
+ }
}
+
+ return ScriptUtils.toScript(result);
+ }
+
+ public List getValuesList() {
+ return valuesList;
+ }
+
+ public void setValuesList(List valuesList) {
+ this.valuesList = valuesList;
+ }
}
Modified: trunk/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/ui/combobox/src/main/templates/combobox.jspx 2008-03-11 11:35:33 UTC (rev 6679)
+++ trunk/ui/combobox/src/main/templates/combobox.jspx 2008-03-11 12:23:57 UTC (rev 6680)
@@ -193,13 +193,13 @@
</jsp:scriptlet>
<f:resource var="spacer" name="images/spacer.gif"/>
-<div id="control#{clientId}" class="rich-combobox-font rich-combobox #{styleClass}" style="width:#{listWidth};#{style}"
+<div id="#{clientId}" class="rich-combobox-font rich-combobox #{styleClass}" style="width:#{listWidth};#{style}"
x:passThruWithExclusions="value,name,type,id,styleClass,class,style,size,autocomplete,disabled,onchange">
- <input id="comboboxValue#{clientId}" name="comboboxValue#{clientId}" type="hidden"/>
+ <input id="#{clientId}comboboxValue" name="#{clientId}comboboxValue" type="hidden"/>
<div class="rich-combobox-list-cord"></div>
<div class="rich-combobox-font rich-combobox-shell" style="width:#{width};z-index:1;">
- <input id="comboboxField#{clientId}"
- name="comboboxField#{clientId}"
+ <input id="#{clientId}comboboxField"
+ name="#{clientId}comboboxField"
disabled="#{disabled}"
class="#{valueStyle} rich-combobox-input-inactive #{inputDisabledClass}" type="text"
value="#{value}"
@@ -211,19 +211,19 @@
style="width:#{correction}; #{inputStyle}"
autocomplete="off"
/>
- <input id="comboBoxButtonBG#{clientId}"
+ <input id="#{clientId}comboBoxButtonBG"
readonly="true"
type="text"
value=""
class="rich-combobox-font-inactive rich-combobox-button-background rich-combobox-button-inactive"/>
- <input id="comboboxButton#{clientId}" readonly="true" disabled="#{disabled}" type="text" value="" style="#{buttonStyle}; background-image: #{buttonIconNormal};"
+ <input id="#{clientId}comboboxButton" readonly="true" disabled="#{disabled}" type="text" value="" style="#{buttonStyle}; background-image: #{buttonIconNormal};"
class="rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive #{buttonDisabledClass}"/>
<div class="rich-combobox-strut rich-combobox-font" style="width:#{correction}">Strut</div>
</div>
- <div id="listParent#{clientId}" class="rich-combobox-list-cord #{listClass}" style="display:none; #{listStyle};z-index: 3;position:absolute;">
+ <div id="#{clientId}listParent" class="rich-combobox-list-cord #{listClass}" style="display:none; #{listStyle};z-index: 3;position:absolute;">
<div class="rich-combobox-shadow">
- <table id="shadow#{clientId}" cellpadding="0" cellspacing="0" border="0">
+ <table id="#{clientId}shadow" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="rich-combobox-shadow-tl">
<img src="#{spacer}" width="10" height="1" alt="" border="0"></img><br></br>
@@ -242,9 +242,9 @@
</tr>
</table>
</div>
- <div id="listPosition#{clientId}" class="rich-combobox-list-position">
- <div id="listDecoration#{clientId}" class="rich-combobox-list-decoration">
- <div id="list#{clientId}" class="rich-combobox-list-scroll">
+ <div id="#{clientId}listPosition" class="rich-combobox-list-position">
+ <div id="#{clientId}listDecoration" class="rich-combobox-list-decoration">
+ <div id="#{clientId}list" class="rich-combobox-list-scroll">
<f:call name="encodeItems"/>
</div>
</div>
@@ -293,14 +293,14 @@
}
}
- var combobox = new Richfaces.ComboBox( "control#{clientId}",
- "list#{clientId}",
- "listParent#{clientId}",
- "comboboxValue#{clientId}",
- "comboboxField#{clientId}",
- "comboboxButton#{clientId}",
- "comboBoxButtonBG#{clientId}",
- "shadow#{clientId}",
+ var combobox = new Richfaces.ComboBox( "#{clientId}",
+ "#{clientId}list",
+ "#{clientId}listParent",
+ "#{clientId}comboboxValue",
+ "#{clientId}comboboxField",
+ "#{clientId}comboboxButton",
+ "#{clientId}comboBoxButtonBG",
+ "#{clientId}shadow",
Richfaces.ComboBox.CLASSES,
"#{listWidth}", "#{listHeight}",
#{this:getItemsTextAsJSArray(context, component)},
Modified: trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
===================================================================
--- trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-03-11 11:35:33 UTC (rev 6679)
+++ trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-03-11 12:23:57 UTC (rev 6680)
@@ -5,14 +5,12 @@
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
+import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.component.UISelectItem;
import javax.faces.component.UISelectItems;
-import javax.faces.component.UISelectOne;
import javax.faces.model.SelectItem;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
@@ -21,7 +19,6 @@
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlSelect;
/**
* @author Anton Belevich
@@ -69,8 +66,11 @@
UISelectItems items = new UISelectItems();
items.setValue(selectItems);
- facesContext.getViewRoot().getChildren().add(comboBox);
-
+ facesContext.getViewRoot().getChildren().add(comboBox);
+
+ Map requestMap = facesContext.getExternalContext().getRequestParameterMap();
+ String id = "comboBoxValue" + comboBox.getClientId(facesContext);
+ requestMap.put(id, "Pennsylvania");
}
public void itemsTextAsJSArrayTest() {
@@ -82,7 +82,7 @@
HtmlPage page = renderView();
assertNotNull(page);
- HtmlElement elem = page.getHtmlElementById("control"+ comboBox.getClientId(facesContext));
+ HtmlElement elem = page.getHtmlElementById(comboBox.getClientId(facesContext));
assertNotNull(elem);
assertEquals(elem.getTagName(), "div");
}
@@ -93,8 +93,6 @@
renderer = null;
}
-
-
public ComboBoxRendererTest(String name) {
super(name);
}
16 years, 10 months
JBoss Rich Faces SVN: r6679 - trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-03-11 07:35:33 -0400 (Tue, 11 Mar 2008)
New Revision: 6679
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js
Log:
cosmetic changes
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js 2008-03-11 11:16:23 UTC (rev 6678)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js 2008-03-11 11:35:33 UTC (rev 6679)
@@ -14,12 +14,10 @@
var comBottom = fieldTop + height;
var listHeight = parseInt(this.list.style.height) + Richfaces.getBorderWidth(this.list.parentNode, "tb");
- //var top = 0 ;//= -4;
- //var top = comBottom;
if (parseInt(listHeight) > (docHeight - comBottom)) {
if (fieldTop > (docHeight - comBottom)) {
+ //opens up
top = 0 - parseInt(listHeight);
- //var upPos = true;
}
}
16 years, 10 months