JBoss Rich Faces SVN: r5056 - trunk/framework/impl/src/main/javascript/prototype.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-12-27 22:36:53 -0500 (Thu, 27 Dec 2007)
New Revision: 5056
Modified:
trunk/framework/impl/src/main/javascript/prototype/patches.js
Log:
http://jira.jboss.com/jira/browse/RF-1567
Modified: trunk/framework/impl/src/main/javascript/prototype/patches.js
===================================================================
--- trunk/framework/impl/src/main/javascript/prototype/patches.js 2007-12-28 01:54:55 UTC (rev 5055)
+++ trunk/framework/impl/src/main/javascript/prototype/patches.js 2007-12-28 03:36:53 UTC (rev 5056)
@@ -71,38 +71,53 @@
});
}
+Event.destroyEventCache = function(node) {
+ var eventID = node._eventID;
+ if (eventID) {
+ var cache = Event.cache[eventID];
+
+ for (var eventName in cache) {
+ var wrappers = cache[eventName];
+
+ wrappers.each(function(wrapper) {
+ if (node.removeEventListener) {
+ node.removeEventListener(eventName, wrapper, false);
+ } else {
+ node.detachEvent("on" + eventName, wrapper);
+ }
+ });
+
+ cache[eventName] = null;
+ }
+
+ delete Event.cache[eventID];
+ }
+}
+
Event.unloadElementsCache = function(oldNode) {
- //refer to window.unload handling conditions in prototype script
- if (!window.attachEvent) return;
-
- if (!oldNode) return;
+ if (oldNode) {
+ Event.destroyEventCache(oldNode);
+
+ //node.all is quicker than recursive traversing
+ //window doesn't have "all" attribute
+ var all = oldNode.all;
+
+ if (all) {
+ var counter = 0;
+ var length = all.length;
+
+ for (var counter = 0; counter < length; counter++ ) {
+ Event.destroyEventCache(all[counter]);
+ }
+ } else {
+ var node = oldNode.firstChild;
+ while (node) {
+ Event.unloadElementsCache(node);
+ node = node.nextSibling;
+ }
+ }
+ }
- var node = oldNode;
- //node.all is quicker than recursive traversing
- //window doesn't have "all" attribute
- var all = node.all || {};
- var counter = 0;
-
- do {
- var eventID = node._eventID;
- if (eventID) {
- var cache = Event.cache[eventID];
-
- for (var eventName in cache) {
- var wrappers = cache[eventName];
-
- wrappers.each(function(wrapper) {
- node.detachEvent("on" + eventName, wrapper);
- });
-
- cache[eventName] = null;
- }
-
- delete Event.cache[eventID];
- }
-
- node = all[counter++];
- } while (node);
};
//
18 years, 4 months
JBoss Rich Faces SVN: r5055 - management/design/progressBar/markup.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-12-27 20:54:55 -0500 (Thu, 27 Dec 2007)
New Revision: 5055
Modified:
management/design/progressBar/markup/ProgressBar.html
Log:
ProgressBar design updated
Modified: management/design/progressBar/markup/ProgressBar.html
===================================================================
--- management/design/progressBar/markup/ProgressBar.html 2007-12-27 23:14:04 UTC (rev 5054)
+++ management/design/progressBar/markup/ProgressBar.html 2007-12-28 01:54:55 UTC (rev 5055)
@@ -32,14 +32,11 @@
<fieldset><legend>Simple Progress Bar</legend>
<br><br>
-<div class="pbar_block">
-<div class="pbar_bar_height pbar_bar_width pbar_bar_shell">
+<div class="pbar_block pbar_bar_height pbar_bar_width pbar_bar_shell">
<div class="pbar_bar_uploaded">
</div>
</div>
-Uploaded 200Kb from 500Kb
-</div>
</fieldset>
@@ -48,8 +45,7 @@
<fieldset><legend>Progress Bar with digital status indication</legend>
<br><br>
-<div class="pbar_block">
-<div class="pbar_bar_height pbar_bar_width pbar_bar_shell_dig">
+<div class="pbar_block pbar_bar_height pbar_bar_width pbar_bar_shell_dig">
<div class="pbar_bar_height pbar_bar_width pbar_bar_track_dig">
50%
</div>
@@ -59,8 +55,6 @@
</div>
</div>
</div>
-Uploaded 200Kb from 500Kb
-</div>
</fieldset>
@@ -69,12 +63,9 @@
<fieldset><legend>Permanent Progress Bar</legend>
<br><br>
-<div class="pbar_block">
-<div class="pbar_bar_height pbar_bar_width pbar_bar_perm">
+<div class="pbar_block pbar_bar_height pbar_bar_width pbar_bar_perm">
</div>
-Uploaded 200Kb from 500Kb
-</div>
</fieldset>
18 years, 4 months
JBoss Rich Faces SVN: r5054 - in trunk/sandbox/ui: pickList and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-12-27 18:14:04 -0500 (Thu, 27 Dec 2007)
New Revision: 5054
Modified:
trunk/sandbox/ui/combobox/
trunk/sandbox/ui/pickList/
trunk/sandbox/ui/pickList/pom.xml
trunk/sandbox/ui/progressBAR/
Log:
picklist pom fixed
Property changes on: trunk/sandbox/ui/combobox
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: trunk/sandbox/ui/pickList
___________________________________________________________________
Name: svn:ignore
+ target
Modified: trunk/sandbox/ui/pickList/pom.xml
===================================================================
--- trunk/sandbox/ui/pickList/pom.xml 2007-12-27 21:10:45 UTC (rev 5053)
+++ trunk/sandbox/ui/pickList/pom.xml 2007-12-27 23:14:04 UTC (rev 5054)
@@ -5,7 +5,7 @@
<version>3.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.sandbox.ui</groupId>
<artifactId>pickList</artifactId>
<name>pickList</name>
<version>3.2.0-SNAPSHOT</version>
Property changes on: trunk/sandbox/ui/progressBAR
___________________________________________________________________
Name: svn:ignore
+ target
18 years, 4 months
JBoss Rich Faces SVN: r5053 - in trunk/sandbox/ui/combobox/src/main: resources/org/richfaces/renderkit/html/css and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-12-27 16:10:45 -0500 (Thu, 27 Dec 2007)
New Revision: 5053
Modified:
trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
client-side functionality
Modified: trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java 2007-12-27 20:54:32 UTC (rev 5052)
+++ trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java 2007-12-27 21:10:45 UTC (rev 5053)
@@ -31,12 +31,12 @@
return UIComboBox.class;
}
- protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ /*protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
UIComboBox comboBox = (UIComboBox)component;
String popupId = comboBox.getClientId(context) + POPUP;
- writer.startElement(HTML.DIV_ELEM, comboBox);
- writer.writeAttribute(HTML.id_ATTRIBUTE, popupId, null);
- writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none", null);
+ //writer.startElement(HTML.DIV_ELEM, comboBox);
+ //writer.writeAttribute(HTML.id_ATTRIBUTE, popupId, null);
+ //writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none", null);
List <String> suggestionValues = comboBox.getSuggestionValues();
if (suggestionValues != null) {
@@ -46,11 +46,24 @@
}
}
- writer.endElement(HTML.DIV_ELEM);
- writer.startElement(HTML.SCRIPT_ELEM, component);
- writer.writeText(encodeScript(context, component,popupId), "script");
- writer.endElement(HTML.SCRIPT_ELEM);
+ //writer.endElement(HTML.DIV_ELEM);
+ //writer.startElement(HTML.SCRIPT_ELEM, component);
+ //writer.writeText(encodeScript(context, component,popupId), "script");
+ //writer.endElement(HTML.SCRIPT_ELEM);
+ }*/
+
+ public void encodeItems( FacesContext context, UIComponent component) throws IOException {
+ UIComboBox comboBox = (UIComboBox)component;
+ List <String> suggestionValues = comboBox.getSuggestionValues();
+ ResponseWriter writer = context.getResponseWriter();
+
+ if (suggestionValues != null) {
+ for (Iterator <String> iterator = suggestionValues.iterator(); iterator.hasNext();) {
+ String suggestion = iterator .next();
+ encodeSuggestion(writer, comboBox, suggestion);
+ }
+ }
}
protected void encodeSuggestion(ResponseWriter writer, UIComboBox comboBox, String value) throws IOException{
Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2007-12-27 20:54:32 UTC (rev 5052)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2007-12-27 21:10:45 UTC (rev 5053)
@@ -1 +1,42 @@
-<?xml version="1.0" encoding="UTF-8"?>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<f:template xmlns:f='http:/jsf.exadel.com/template'
+ xmlns:u='http:/jsf.exadel.com/template/util'
+ xmlns="http://www.w3.org/1999/xhtml" >
+
+<f:verbatim>
+<![CDATA[
+
+.rich-combobox-list {
+ z-index: 1000;
+ overflow: auto;
+ white-space:nowrap;
+}
+
+.rich-combobox-item {
+ border:1px solid #FFFFFF;
+ font-family:tahoma,arial,helvetica,sans-serif;
+ font-size:12px;
+ font-size-adjust:none;
+ font-stretch:normal;
+ font-style:normal;
+ font-variant:normal;
+ font-weight:normal;
+ line-height:normal;
+ overflow:hidden;
+ padding:2px;
+ white-space:nowrap;
+}
+
+.rich-combobox-item-normal {
+
+}
+
+.rich-combobox-item-selected {
+ background:#DFE8F6 none repeat scroll 0%;
+ border:1px dotted #A3BAE9 !important;
+ cursor:pointer;
+}
+
+]]>
+</f:verbatim>
+</f:template>
\ No newline at end of file
Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2007-12-27 20:54:32 UTC (rev 5052)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2007-12-27 21:10:45 UTC (rev 5053)
@@ -2,8 +2,208 @@
Richfaces.ComboBox = Class.create();
Richfaces.ComboBox.prototype = {
- initialize: function(combobox, options) {
+ initialize: function(combobox, listId, fieldId, buttonId, classes, listWidth, listHeight) {
this.combobox = $(combobox);
+ this.comboList = new Richfaces.ComboBoxList(listId, classes, listWidth, listHeight);
+ this.field = $(fieldId);
+ this.button = $(buttonId);
+
+ this.initCombobox();
+ },
+
+ initCombobox : function() {
+ this.button.observe("click", function(e){this.clickHandler(e);}.bindAsEventListener(this));
+ this.field.observe("keydown", function(e){this.keyboardManager(e);}.bindAsEventListener(this));
+ //this.field.observe("blur", function(e){this.focusHandler(e);}.bindAsEventListener(this));
+ this.field.observe("change", function(e){this.dataUpdating(e);}.bindAsEventListener(this));
+
+ this.comboList.list.observe("mousemove", function(e){this.listListener(e)}.bindAsEventListener(this));
+ this.comboList.list.observe("click", function(e){this.valueHandler(e);}.bindAsEventListener(this));
+ },
+
+ clickHandler : function(event) {
+ if (this.comboList.visible()) {
+ this.comboList.hide();
+ } else {
+ this.comboList.show();
+ }
+ this.field.focus();
+ },
+
+ listListener : function(event) {
+ //changes item's decoration
+ var item = this.comboList.getEventItem(event);
+ if (item) {
+ this.comboList.selectItem(this.comboList.getEventItem(event));
+ }
+ },
+
+ valueHandler : function(event) {
+ this.field.value = this.comboList.selectedItem.innerHTML;
+
+ this.comboList.hide();
+ },
+
+ keyboardManager : function(event) {
+ if ((event.keyCode == Event.KEY_UP) || (event.keyCode == Event.KEY_DOWN)) {
+ this.comboList.moveSelectedItem(event);
+ }
+ },
+
+ focusHandler : function(event) {
+ this.comboList.hide();
+ },
+
+ dataUpdating : function() {
+ this.comboList.setItems(this.comboList.dataFilter(this.field.value));
+ this.comboList.show();
}
+};
-};
+Richfaces.ComboBoxList = Class.create();
+Richfaces.ComboBoxList.prototype = {
+
+ initialize: function(listId, classes, width, height) {
+ this.list = $(listId);
+ this.items = this.getItems();
+
+ this.currentItems = this.items;
+
+ this.classes = classes;
+ this.selectedItem = null;
+
+ this.setSize(width, height);
+ },
+
+ getItems : function() {
+ return this.list.childNodes;
+ },
+
+ show : function() {
+ if (this.currentItems.length != 0) {
+ this.selectItem(this.currentItems[0]);
+ }
+ this.list.show();
+ },
+
+ hide : function() {
+ this.resetState();
+ this.list.hide();
+ },
+
+ visible : function() {
+ return this.list.visible();
+ },
+
+ setSize : function(width, height) {
+ this.list.style.width = width + "px";
+ this.list.style.height = height + "px";
+ },
+
+ scrolling : function(event) {
+ var increment;
+ var listTop = Richfaces.ComboBoxList.getElemXY(this.list).top;
+ var scrollTop = this.list.scrollTop;
+ var itemTop = Richfaces.ComboBoxList.getElemXY(this.selectedItem).top;
+
+ if ((event.keyCode == Event.KEY_UP) || (event.keyCode == 33)) {
+ increment = (itemTop - scrollTop) - listTop;
+ if (increment < 0) {
+ this.list.scrollTop += increment;
+ }
+ } else if ((event.keyCode == Event.KEY_DOWN) || (event.keyCode == 34)) {
+ var itemBottom = itemTop + this.selectedItem.offsetHeight;
+ var increment = (itemBottom - scrollTop) - (listTop + this.list.clientHeight);
+ if (increment > 0) {
+ this.list.scrollTop += increment;
+ }
+ }
+ Event.stop(event);
+ },
+
+ /* items library*/
+ selectItem : function(item) {
+ if (this.selectedItem) {
+ this.normalizeItem(this.selectedItem);
+ }
+
+ this.selectedItem = item;
+ this.changeItem(item, this.classes.ITEM.SELECTED);
+ },
+
+ normalizeItem : function(item) {
+ this.selectedItem = null;
+ this.changeItem(item, this.classes.ITEM.NORMAL);
+ },
+
+ changeItem : function(item, className) {
+ item.className = className;
+ },
+
+ getEventItem : function(event) {
+ var item = Event.findElement(event, "div");
+ if ((item == null) || (item.id == this.list.id)) {
+ return;
+ }
+ return item;
+ },
+
+ moveSelectedItem : function(event) {
+ var item = this.selectedItem;
+ if (event.keyCode == Event.KEY_UP) {
+ var prevItem = item.previousSibling;
+ if (prevItem) {
+ this.itemsRearrangement(item, prevItem);
+ }
+ } else if (event.keyCode == Event.KEY_DOWN) {
+ var nextItem = item.nextSibling;
+ if (nextItem) {
+ this.itemsRearrangement(item, nextItem);
+ }
+ }
+ this.scrolling(event);
+ },
+
+ itemsRearrangement : function(item, newItem) {
+ this.normalizeItem(item);
+ this.selectItem(newItem);
+ },
+
+ resetState : function() {
+ this.normalizeItem(this.selectedItem);
+ this.selectedItem = null;
+ },
+
+ setItems : function(newItems) {
+ this.currentItems = newItems;
+
+ this.list.innerHTML = newItems.join(""); //FIXME: to optimaize
+ },
+
+ dataFilter : function(text) {
+ var filteredData = new Array();
+ for (var i = 0; i < this.items.length; i++) {
+ var item = this.items[i];
+ if (item.innerHTML.substr(0, text.length).toLowerCase() == text.toLowerCase()) { //FIXME: to optimaize
+ filteredData.push(item);
+ }
+ }
+ return filteredData;
+ },
+}
+
+Richfaces.ComboBoxList.getElemXY = function(elem) {
+ var x = elem.offsetLeft;
+ var y = elem.offsetTop;
+
+ for (var parent = elem.offsetParent; parent; parent = parent.offsetParent) {
+ x += parent.offsetLeft;
+ y += parent.offsetTop;
+ }
+ return {left: x, top: y};
+}
+
+Richfaces.ComboBoxList.CLASSES = {
+ ITEM : {NORMAL : "rich-combobox-item rich-combobox-item-normal", SELECTED : "rich-combobox-item rich-combobox-item-selected"},
+ LIST : {}
+}
\ No newline at end of file
Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2007-12-27 20:54:32 UTC (rev 5052)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2007-12-27 21:10:45 UTC (rev 5053)
@@ -1,32 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
-<f:root xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://ajax4jsf.org/cdk/template"
- xmlns:c=" http://java.sun.com/jsf/core"
+<f:root
+ xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
xmlns:ui=" http://ajax4jsf.org/cdk/ui"
- xmlns:vcp=" http://ajax4jsf.org/cdk/vcp"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:jsp=" http://ajax4jsf.org/cdk/jsp"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
baseclass="org.richfaces.renderkit.ComboBoxBaseRenderer"
class="org.richfaces.renderkit.html.ComboBoxRenderer"
component="org.richfaces.component.UIComboBox">
+ <h:styles>css/combobox.xcss</h:styles>
<h:scripts>
- new org.ajax4jsf.javascript.PrototypeScript(),/org/richfaces/renderkit/html/scripts/combobox.js
+ new org.ajax4jsf.javascript.PrototypeScript(),
+ scripts/combobox.js
</h:scripts>
- <f:resource name="org.richfaces.renderkit.html.images.SpinnerButtonDown" var="down_arrow" />
-
+ <f:resource name="org.richfaces.renderkit.html.images.SpinnerButtonDown" var="down_arrow" />
+
<f:clientid var="clientId" />
-
- <table cellpadding="0" cellspacing="0" id="#{clientId}">
- <tbody>
- <tr>
- <td>
- <input type="text" id="#{clientId}_input"/>
- </td>
- <td style="padding: 0px 4px 0px 4px">
- <input type="image" src="#{down_arrow}" id="#{clientId}_button" onclick="return false;"/>
- </td>
- </tr>
- </tbody>
- </table>
- <vcp:body/>
+ <div id="#{clientId}">
+ <div id="comboboxControl#{clientId}" class="" style="position:relative;">
+ <input id="comboboxField#{clientId}" class="" type="text" size="20" autocomplete="off"/>
+ <img id="comboboxButton#{clientId}" class="" style="position:absolute; top:0pt; border:1px solid black; height:22px;width:22px;" src="#{down_arrow}"/>
+ </div>
+ <div id="list#{clientId}" style="display:none" class="rich-combobox-list">
+ <f:call name="encodeItems"/>
+ </div>
+ </div>
+ <script type="text/javascript">
+ var combobox = new Richfaces.ComboBox("#{clientId}",
+ "list#{clientId}",
+ "comboboxField#{clientId}",
+ "comboboxButton#{clientId}", Richfaces.ComboBoxList.CLASSES, 100, 150);
+ </script>
</f:root>
\ No newline at end of file
18 years, 4 months
JBoss Rich Faces SVN: r5052 - in trunk/sandbox: ui and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-12-27 15:54:32 -0500 (Thu, 27 Dec 2007)
New Revision: 5052
Modified:
trunk/sandbox/samples/pom.xml
trunk/sandbox/ui/pom.xml
Log:
columns & columns-demo removed from build
Modified: trunk/sandbox/samples/pom.xml
===================================================================
--- trunk/sandbox/samples/pom.xml 2007-12-27 20:49:58 UTC (rev 5051)
+++ trunk/sandbox/samples/pom.xml 2007-12-27 20:54:32 UTC (rev 5052)
@@ -15,7 +15,6 @@
<module>panel2-sample</module>
<module>simpleTogglePanel2-sample</module>
- <module>columnsDemo</module>
<!--module>contextMenuDemo</module-->
<module>fileUploadPOC</module>
<module>fileUploadDemo</module>
Modified: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml 2007-12-27 20:49:58 UTC (rev 5051)
+++ trunk/sandbox/ui/pom.xml 2007-12-27 20:54:32 UTC (rev 5052)
@@ -15,7 +15,6 @@
<module>simpleTogglePanel2</module>
<module>state</module>
<module>treeTable</module>
- <module>columns</module>
<module>rex-resizable</module>
<module>rex-messageBox</module>
<!--module>rex-button</module-->
18 years, 4 months
JBoss Rich Faces SVN: r5051 - in branches/3.1.x/ui: orderingList and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-12-27 15:49:58 -0500 (Thu, 27 Dec 2007)
New Revision: 5051
Modified:
branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
branches/3.1.x/ui/orderingList/
Log:
garbage removed from UIListShuttle.java
Modified: branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
===================================================================
--- branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2007-12-27 20:48:39 UTC (rev 5050)
+++ branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2007-12-27 20:49:58 UTC (rev 5051)
@@ -366,7 +366,9 @@
}
public abstract MethodBinding getValueChangeListener();
+ public abstract void setValueChangeListener(MethodBinding valueChangeMethod);
+
public ValueChangeListener[] getValueChangeListeners() {
return (ValueChangeListener[]) getFacesListeners(ValueChangeListener.class);
}
Property changes on: branches/3.1.x/ui/orderingList
___________________________________________________________________
Name: svn:ignore
- .classpath
.project
.settings
target
+ .classpath
.project
.settings
target
bin
18 years, 4 months
JBoss Rich Faces SVN: r5050 - in branches/3.1.x: samples/treeModelDemo/src/main/java/org/richfaces/model and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-12-27 15:48:39 -0500 (Thu, 27 Dec 2007)
New Revision: 5050
Added:
branches/3.1.x/samples/treeModelDemo/src/main/java/org/richfaces/model/SimpleRecursiveNode.java
Modified:
branches/3.1.x/samples/treeModelDemo/src/main/java/org/richfaces/TreeModelBean.java
branches/3.1.x/samples/treeModelDemo/src/main/webapp/pages/index.jsp
branches/3.1.x/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
branches/3.1.x/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-980
Modified: branches/3.1.x/samples/treeModelDemo/src/main/java/org/richfaces/TreeModelBean.java
===================================================================
--- branches/3.1.x/samples/treeModelDemo/src/main/java/org/richfaces/TreeModelBean.java 2007-12-27 19:45:44 UTC (rev 5049)
+++ branches/3.1.x/samples/treeModelDemo/src/main/java/org/richfaces/TreeModelBean.java 2007-12-27 20:48:39 UTC (rev 5050)
@@ -3,7 +3,10 @@
*/
package org.richfaces;
+import java.util.List;
+
import org.richfaces.component.UITree;
+import org.richfaces.model.SimpleRecursiveNode;
/**
* @author Nick Belaevski
@@ -15,4 +18,25 @@
public Boolean adviseNodeOpened(UITree tree) {
return Boolean.TRUE;
}
+
+ private SimpleRecursiveNode simpleRecursiveNode;
+
+ public TreeModelBean() {
+ simpleRecursiveNode = new SimpleRecursiveNode(null, null);
+ for (int i = 0; i < 5; i++) {
+ SimpleRecursiveNode node2 = new SimpleRecursiveNode(simpleRecursiveNode, "Node " + i);
+
+ for (int j = 0; j < 6; j++) {
+ SimpleRecursiveNode node3 = new SimpleRecursiveNode(node2, "Node " + i + " " + j);
+
+ for (int k = 0; k < 4; k++) {
+ SimpleRecursiveNode node4 = new SimpleRecursiveNode(node3, "Node " + i + " " + j + " " + k);
+ }
+ }
+ }
+ }
+
+ public List getSimpleResursiveNodes() {
+ return simpleRecursiveNode.getChildren();
+ }
}
Copied: branches/3.1.x/samples/treeModelDemo/src/main/java/org/richfaces/model/SimpleRecursiveNode.java (from rev 4967, trunk/samples/treeModelDemo/src/main/java/org/richfaces/model/SimpleRecursiveNode.java)
===================================================================
--- branches/3.1.x/samples/treeModelDemo/src/main/java/org/richfaces/model/SimpleRecursiveNode.java (rev 0)
+++ branches/3.1.x/samples/treeModelDemo/src/main/java/org/richfaces/model/SimpleRecursiveNode.java 2007-12-27 20:48:39 UTC (rev 5050)
@@ -0,0 +1,79 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ * <br /><br />
+ *
+ * Created 22.12.2007
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public class SimpleRecursiveNode {
+
+ private SimpleRecursiveNode parent;
+
+ private List children = new ArrayList();
+
+ private String text;
+
+ public SimpleRecursiveNode(SimpleRecursiveNode parent,
+ String text) {
+ super();
+ this.parent = parent;
+ if (parent != null) {
+ parent.addChild(this);
+ }
+ this.text = text;
+ }
+
+ public void addChild(SimpleRecursiveNode node) {
+ children.add(node);
+ }
+
+ public void removeChild(SimpleRecursiveNode node) {
+ children.remove(node);
+ }
+
+ public void remove() {
+ if (parent != null) {
+ parent.removeChild(this);
+ }
+ }
+
+ public SimpleRecursiveNode getParent() {
+ return parent;
+ }
+
+ public List getChildren() {
+ return children;
+ }
+
+ public String getText() {
+ return text;
+ }
+}
Modified: branches/3.1.x/samples/treeModelDemo/src/main/webapp/pages/index.jsp
===================================================================
--- branches/3.1.x/samples/treeModelDemo/src/main/webapp/pages/index.jsp 2007-12-27 19:45:44 UTC (rev 5049)
+++ branches/3.1.x/samples/treeModelDemo/src/main/webapp/pages/index.jsp 2007-12-27 20:48:39 UTC (rev 5050)
@@ -85,6 +85,14 @@
</model:treeNodes--%>
</model:treeNodesAdaptor>
</tree:tree>
+
+ <tree:tree adviseNodeOpened="#{treeModelBean.adviseNodeOpened}" switchType="client">
+ <model:recursiveTreeNodesAdaptor roots="#{treeModelBean.simpleResursiveNodes}" var="node" nodes="#{node.children}">
+ <tree:treeNode>
+ <h:commandLink value="#{node.text}" action="#{node.remove}" />
+ </tree:treeNode>
+ </model:recursiveTreeNodesAdaptor>
+ </tree:tree>
</h:form>
</f:view>
</body>
Modified: branches/3.1.x/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
===================================================================
--- branches/3.1.x/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2007-12-27 19:45:44 UTC (rev 5049)
+++ branches/3.1.x/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2007-12-27 20:48:39 UTC (rev 5050)
@@ -66,10 +66,11 @@
String id = treeNode.getClientId(context);
if (UITree.SWITCH_AJAX.equals(tree.getSwitchType())) {
- JSFunction function = AjaxRendererUtils.buildAjaxFunction(tree.getNodeFacet(),
+ UITreeNode nodeFacet = tree.getNodeFacet();
+ JSFunction function = AjaxRendererUtils.buildAjaxFunction(nodeFacet,
context);
Map eventOptions = AjaxRendererUtils.buildEventOptions(context,
- tree.getNodeFacet());
+ nodeFacet);
Map parameters = (Map) eventOptions.get("parameters");
parameters.remove(id);
Modified: branches/3.1.x/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- branches/3.1.x/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-12-27 19:45:44 UTC (rev 5049)
+++ branches/3.1.x/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-12-27 20:48:39 UTC (rev 5050)
@@ -492,7 +492,9 @@
Object rowKey = tree.getRowKey();
try {
tree.setRowKey(selectedNodeKey);
- result = tree.getNodeFacet().getClientId(context);
+ if (tree.isRowAvailable()) {
+ result = tree.getNodeFacet().getClientId(context);
+ }
} finally {
try {
tree.setRowKey(rowKey);
18 years, 4 months
JBoss Rich Faces SVN: r5049 - management/design/comboBox/markup.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-12-27 14:45:44 -0500 (Thu, 27 Dec 2007)
New Revision: 5049
Modified:
management/design/comboBox/markup/comboBox.html
Log:
combo box design updated
Modified: management/design/comboBox/markup/comboBox.html
===================================================================
--- management/design/comboBox/markup/comboBox.html 2007-12-27 19:06:13 UTC (rev 5048)
+++ management/design/comboBox/markup/comboBox.html 2007-12-27 19:45:44 UTC (rev 5049)
@@ -14,7 +14,7 @@
.cb_button_bg_press{ background : url(images/bg_press.png) repeat-x bottom #C7D7EC} /*gradient - from tabBackgroundColor to generalBackgroundColor, background-color - tabBackgroundColor*/
.cb_button_arrow{ background : url(images/down.gif) center no-repeat; cursor : pointer;}
-.cb_list_cord{ position : relative; font-size : 0px; display:none;}/*DDL is hidden!!!!!*/
+.cb_list_cord{ position : relative; font-size : 0px; /*display:none;*/ top: 2px;}/*DDL is hidden!!!!!*/
.cb_list_position{ position : absolute; top:-5px; left:0px;}
.cb_list_decoration{ border : 1px solid #c0c0c0 /*panelBorderColor*/; padding : 0px; background : #FFFFFF; /*tableBackgroundColor*/}
.cb_list_scroll{ overflow : auto; width : 100%; height : 100;}
18 years, 4 months
JBoss Rich Faces SVN: r5048 - trunk/framework/impl/src/main/javascript/ajaxjsf.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-12-27 14:06:13 -0500 (Thu, 27 Dec 2007)
New Revision: 5048
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
http://jira.jboss.com/jira/browse/RF-1771
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2007-12-27 18:50:42 UTC (rev 5047)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2007-12-27 19:06:13 UTC (rev 5048)
@@ -941,6 +941,11 @@
var newscript = Sarissa.getText(oncomplete,true);
if (event) {
var target = event.target ? event.target : event.srcElement;
+ if (!window.data) {
+ window.data = data;
+ } else {
+ Object.extend(window.data, data);
+ }
new Function(newscript).apply(target);
} else {
window.eval(newscript);
18 years, 4 months
JBoss Rich Faces SVN: r5047 - trunk/sandbox/ui/pickList/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-12-27 13:50:42 -0500 (Thu, 27 Dec 2007)
New Revision: 5047
Modified:
trunk/sandbox/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java
Log:
remove unnecessary import
Modified: trunk/sandbox/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java
===================================================================
--- trunk/sandbox/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java 2007-12-27 18:48:31 UTC (rev 5046)
+++ trunk/sandbox/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java 2007-12-27 18:50:42 UTC (rev 5047)
@@ -5,7 +5,6 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
-import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
18 years, 4 months