JBoss Rich Faces SVN: r5444 - branches/3.1.x/test-applications/facelets/src/main/webapp/Tree.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-16 21:52:13 -0500 (Wed, 16 Jan 2008)
New Revision: 5444
Modified:
branches/3.1.x/test-applications/facelets/src/main/webapp/Tree/Tree.xhtml
Log:
Tree.xhtml in test-applications/facelets/src/main/webapp/Tree/Tree.xhtml fixed
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/Tree/Tree.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/Tree/Tree.xhtml 2008-01-17 02:45:39 UTC (rev 5443)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/Tree/Tree.xhtml 2008-01-17 02:52:13 UTC (rev 5444)
@@ -33,8 +33,8 @@
<h:outputText value="collapsed" rendered="#{bean.renderFacets}" />
</f:facet>
- <dnd:dndParam name="treeParam" value="Tree Parameter" />
- <dnd:dndParam name="accept" value="accept" />
+ <rich:dndParam name="treeParam" value="Tree Parameter" />
+ <rich:dndParam name="accept" value="accept" />
<rich:treeNode type="input" dropListener="#{bean.processDrop}"
oncollapse="Element.removeClassName(event['treeItem'].getElement(), 'colored')"
@@ -43,7 +43,7 @@
<h:inputText value="#{data.name}" required="true" styleClass="inputs">
</h:inputText>
- <dnd:dndParam name="nodeParam" value="Node Parameter" />
+ <rich:dndParam name="nodeParam" value="Node Parameter" />
</rich:treeNode>
<rich:treeNode type="text" nodeClass="customNode" acceptedTypes="file2" onselected="return false;">
16 years, 12 months
JBoss Rich Faces SVN: r5443 - in trunk/ui/tree/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-16 21:45:39 -0500 (Wed, 16 Jan 2008)
New Revision: 5443
Modified:
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
trunk/ui/tree/src/main/templates/htmlTreeNode.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1850
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js
===================================================================
--- trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js 2008-01-17 02:44:42 UTC (rev 5442)
+++ trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js 2008-01-17 02:45:39 UTC (rev 5443)
@@ -54,7 +54,7 @@
},
getDropzoneOptions: function() {
- var attr = Richfaces.getNSAttribute("dropzoneoptions", this.iconElement);
+ var attr = Richfaces.getNSAttribute("dropzoneoptions", this.elements.iconElement);
if (attr) {
return attr.parseJSON(EventHandlersWalk);
}
@@ -108,7 +108,7 @@
return window.drag.treeDraggableOptions;
}
- var attr = Richfaces.getNSAttribute("draggableoptions", this.iconElement);
+ var attr = Richfaces.getNSAttribute("draggableoptions", this.elements.iconElement);
if (attr) {
var opts = attr.parseJSON(EventHandlersWalk);
if (window.drag) {
@@ -131,6 +131,6 @@
getElement: function() {
//returns <tr> holding node without children
- return this.textElement.parentNode;
+ return this.elements.textElement.parentNode;
}
});
\ No newline at end of file
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
===================================================================
--- trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2008-01-17 02:44:42 UTC (rev 5442)
+++ trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2008-01-17 02:45:39 UTC (rev 5443)
@@ -4,7 +4,6 @@
this.parent = parent;
this.tree = tree;
this.elements = {};
- this.elementID = {};
var element;
@@ -17,40 +16,61 @@
}
element.object = this;
+
+ var rows = element.rows;
+ this.elements.mainRow = rows[0];
+
+ var sibling = element.nextSibling;
+ var siblingId = this.id + Tree.ID_DEVIDER + Tree.ID_CHILDS_ROW;
+ while (sibling && sibling.id != siblingId) {
+ sibling = sibling.nextSibling
+ };
- this.elementID.children = this.id + Tree.ID_DEVIDER + Tree.ID_CHILDS_ROW;
- this.elementID.mainRow = this.id + Tree.ID_DEVIDER + Tree.ID_MAIN_ROW;
- this.elementID.handle = this.id + Tree.ID_DEVIDER + Tree.ID_HANDLE;
- this.elementID.handleImgExpanded = this.elementID.handle + Tree.ID_DEVIDER + Tree.ID_HANDLE_IMG_EXPANDED;
- this.elementID.handleImgCollapsed = this.elementID.handle + Tree.ID_DEVIDER + Tree.ID_HANDLE_IMG_COLLAPSED;
- this.elementID.icon = this.id + Tree.ID_DEVIDER + Tree.ID_ICON;
- this.elementID.text = this.id + Tree.ID_DEVIDER + Tree.ID_TEXT;
+ this.elements.childrenRow = sibling;
+ var handlesId = this.id + Tree.ID_DEVIDER + Tree.ID_HANDLES;
+ var iconId = this.id + Tree.ID_DEVIDER + Tree.ID_ICON;
+ var textId = this.id + Tree.ID_DEVIDER + Tree.ID_TEXT;
+
this.getElements(element, ajaxUpdate);
- var cells = element.rows[0].cells;
- var eIcon = null;
- var eText = null;
+ var handles = null;
+ var cells = this.elements.mainRow.cells;
if ("NETSCAPE" == RichFaces.navigatorType()) {
for (var i = 0; i < cells.length; i++) {
- if (cells[i].id == this.elementID.icon) {
- eIcon = cells[i];
- } else if (cells[i].id == this.elementID.text) {
- eText = cells[i];
+ if (cells[i].id == iconId) {
+ this.elements.iconElement = cells[i];
+ } else if (cells[i].id == textId) {
+ this.elements.textElement = cells[i];
+ } else if (cells[i].id == handlesId) {
+ handles = cells[i];
}
- if (eIcon && eText) {
+ if (this.elements.iconElement && this.elements.textElement && handles) {
break;
}
}
} else {
- var cells = element.rows[0].cells;
//seeking by id seems to be miserably slow in IE than by index
- eIcon = cells[this.elementID.icon];
- eText = cells[this.elementID.text];
+ this.elements.iconElement = cells[iconId];
+ this.elements.textElement = cells[textId];
+ handles = cells[handlesId];
}
- this.iconElement = eIcon;
- this.textElement = eText;
+ var handleId = this.id + Tree.ID_DEVIDER + Tree.ID_HANDLE;
+ var handleImgExpandedId = handleId + Tree.ID_DEVIDER + Tree.ID_HANDLE_IMG_EXPANDED;
+ var handleImgCollapsedId = handleId + Tree.ID_DEVIDER + Tree.ID_HANDLE_IMG_COLLAPSED;
+
+ this.elements.handle = Element.firstDescendant(Element.firstDescendant(handles));
+ if (this.elements.handle.id == handleId) {
+ this.elements.handleImgCollapsed = this.elements.handle.firstDescendant();
+ this.elements.handleImgExpanded = this.elements.handleImgCollapsed.next();
+
+ if (this.elements.handleImgExpanded.id != handleImgExpandedId ||
+ this.elements.handleImgCollapsed.id != handleImgCollapsedId) {
+
+ throw "Script inconsistency detected! Please inform developers...";
+ }
+ }
this.eventSelectionClick = this.toggleSelection.bindAsEventListener(this);
this.eventMouseOut = this.processMouseOut.bindAsEventListener(this);
@@ -66,7 +86,7 @@
this.enableDropzoneCursors(dropOpts.acceptCursor, dropOpts.rejectCursor);
}
- this.observeEvents(eIcon, eText);
+ this.observeEvents();
},
destroy: function() {
@@ -79,37 +99,38 @@
}
this.childs = null;
+ this.elements = null;
},
- observeEvents: function(eIcon, eText) {
- if (eIcon) {
- var contextMenu = Richfaces.getNSAttribute("oncontextmenu", eIcon);
+ observeEvents: function() {
+ if (this.elements.iconElement) {
+ var contextMenu = Richfaces.getNSAttribute("oncontextmenu", this.elements.iconElement);
if (contextMenu && contextMenu.length > 0) {
this.onContextMenu = new Function("event", contextMenu + "; return true;").bindAsEventListener(this);
}
- Event.observe(eIcon, "mousedown", this.eventSelectionClick);
- Event.observe(eIcon, "mouseout", this.eventMouseOut);
- Event.observe(eIcon, "mouseover", this.eventMouseOver);
+ Event.observe(this.elements.iconElement, "mousedown", this.eventSelectionClick);
+ Event.observe(this.elements.iconElement, "mouseout", this.eventMouseOut);
+ Event.observe(this.elements.iconElement, "mouseover", this.eventMouseOver);
if (this.onContextMenu) {
- eIcon.oncontextmenu = this.onContextMenu;
+ this.elements.iconElement.oncontextmenu = this.onContextMenu;
}
}
- if (eText)
+ if (this.elements.textElement)
{
- Event.observe(eText, "mousedown", this.eventSelectionClick);
- Event.observe(eText, "mouseout", this.eventMouseOut);
- Event.observe(eText, "mouseover", this.eventMouseOver);
+ Event.observe(this.elements.textElement, "mousedown", this.eventSelectionClick);
+ Event.observe(this.elements.textElement, "mouseout", this.eventMouseOut);
+ Event.observe(this.elements.textElement, "mouseover", this.eventMouseOver);
if (this.onContextMenu) {
- eText.oncontextmenu = this.onContextMenu;
+ this.elements.textElement.oncontextmenu = this.onContextMenu;
}
}
if (this.tree.switchType=="client" && this.childs.length > 0) {
this.eventCollapsionClick = this.toggleCollapsion.bindAsEventListener(this);
- var handleElt = this.tree.toggleOnClick ? this.elementID.mainRow : this.elementID.handle;
+ var handleElt = this.tree.toggleOnClick ? this.elements.mainRow : this.elements.handle;
Event.observe(handleElt, "click", this.eventCollapsionClick);
}
},
@@ -117,7 +138,7 @@
getElements: function(element, ajaxUpdate) {
this.childs = [];
- var childsTd = element.nextSibling;//$(this.elementID.children);
+ var childsTd = element.nextSibling;
if (ajaxUpdate && this.tree.showConnectingLines) {
var cell = element.rows[0].cells[0];
@@ -180,7 +201,7 @@
if (this.hasChilds()) Element.toggle(row);
// Rerender main row to avoid bad representation in Opera and Konqueror/Safari
- var e = $(this.elementID.mainRow)
+ var e = this.elements.mainRow;
if (e) {
Element.hide(e);
Element.show(e);
@@ -188,11 +209,11 @@
var nodeStateInput = $(this.id + "NodeExpanded");
- var eIcon = $(this.elementID.icon);
+ var eIcon = this.elements.iconElement;
if (this.isCollapsed()) {
- Element.hide(this.elementID.handleImgExpanded);
- Element.show(this.elementID.handleImgCollapsed);
+ Element.hide(this.elements.handleImgExpanded);
+ Element.show(this.elements.handleImgCollapsed);
if( eIcon && Element.hasClassName(eIcon, Tree.CLASS_ITEM_EXPANDED)) {
Element.removeClassName(eIcon, Tree.CLASS_ITEM_EXPANDED);
Element.addClassName(eIcon, Tree.CLASS_ITEM_COLLAPSED);
@@ -204,8 +225,8 @@
this.fireCollapsionEvent();
} else {
- Element.show(this.elementID.handleImgExpanded);
- Element.hide(this.elementID.handleImgCollapsed);
+ Element.show(this.elements.handleImgExpanded);
+ Element.hide(this.elements.handleImgCollapsed);
if(eIcon && Element.hasClassName(eIcon, Tree.CLASS_ITEM_COLLAPSED)) {
Element.removeClassName(eIcon, Tree.CLASS_ITEM_COLLAPSED);
Element.addClassName(eIcon, Tree.CLASS_ITEM_EXPANDED);
@@ -221,22 +242,22 @@
},
getRichAttribute: function(name) {
- return Richfaces.getNSAttribute(name, $(this.elementID.icon));
+ return Richfaces.getNSAttribute(name, this.elements.iconElement);
},
collapse: function() {
if (!this.isCollapsed() && this.tree.switchType!="client") {
- var handleElt = $(this.tree.toggleOnClick ? this.elementID.mainRow : this.elementID.handle);
+ var handleElt = $(this.tree.toggleOnClick ? this.elements.mainRow : this.elements.handle);
if (handleElt) {
handleElt.onclick();
}
}
if (this.hasChilds() && !this.isCollapsed()) {
- Element.hide(this.elementID.children);
- Element.hide(this.elementID.handleImgExpanded);
- Element.show(this.elementID.handleImgCollapsed);
- var eIcon = $(this.elementID.icon);
+ Element.hide(this.elements.childrenRow);
+ Element.hide(this.elements.handleImgExpanded);
+ Element.show(this.elements.handleImgCollapsed);
+ var eIcon = this.elements.iconElement;
if(eIcon && Element.hasClassName(eIcon, Tree.CLASS_ITEM_EXPANDED)) {
Element.removeClassName(eIcon, Tree.CLASS_ITEM_EXPANDED);
Element.addClassName(eIcon, Tree.CLASS_ITEM_COLLAPSED);
@@ -248,17 +269,17 @@
expand: function() {
if (this.isCollapsed() && this.tree.switchType!="client") {
- var handleElt = $(this.tree.toggleOnClick ? this.elementID.mainRow : this.elementID.handle);
+ var handleElt = $(this.tree.toggleOnClick ? this.elements.mainRow : this.elements.handle);
if (handleElt) {
handleElt.onclick();
}
}
if (this.hasChilds() && this.isCollapsed()) {
- Element.show(this.elementID.children);
- Element.show(this.elementID.handleImgExpanded);
- Element.hide(this.elementID.handleImgCollapsed);
- var eIcon = $(this.elementID.icon);
+ Element.show(this.elements.childrenRow);
+ Element.show(this.elements.handleImgExpanded);
+ Element.hide(this.elements.handleImgCollapsed);
+ var eIcon = this.elements.iconElement;
if(eIcon && Element.hasClassName(eIcon, Tree.CLASS_ITEM_COLLAPSED)) {
Element.removeClassName(eIcon, Tree.CLASS_ITEM_COLLAPSED);
Element.addClassName(eIcon, Tree.CLASS_ITEM_EXPANDED);
@@ -269,7 +290,7 @@
},
isCollapsed: function() {
- var e = $(this.elementID.children);
+ var e = this.elements.childrenRow;
if (e) {
return e.style.display == "none";
} else {
@@ -280,7 +301,7 @@
processMouseOut: function(e) {
if (this.isMouseIn) {
this.isMouseIn = false;
- var eText = $(this.elementID.text);
+ var eText = this.elements.textElement;
var hClass = Richfaces.getNSAttribute("highlightedclass", eText);
if (hClass) {
var classNames = hClass.split(' ')
@@ -297,7 +318,7 @@
processMouseOver: function(e) {
if(!this.isMouseIn) {
this.isMouseIn = true;
- var eText = $(this.elementID.text);
+ var eText = this.elements.textElement;
var hClass = Richfaces.getNSAttribute("highlightedclass", eText);
if (hClass) {
var classNames = hClass.split(' ')
@@ -352,7 +373,7 @@
alert(s);
*/
- var eText = $(this.elementID.text);
+ var eText = this.elements.textElement;
var sClass = Richfaces.getNSAttribute("selectedclass", eText);
if (sClass) {
@@ -376,11 +397,11 @@
},
isSelected: function() {
- return Element.hasClassName(this.elementID.text, Tree.CLASS_ITEM_SELECTED);
+ return Element.hasClassName(this.elements.textElement, Tree.CLASS_ITEM_SELECTED);
},
deselect: function() {
- var eText = $(this.elementID.text);
+ var eText = this.elements.textElement;
var sClass = Richfaces.getNSAttribute("selectedclass", eText);
if (sClass) {
var classNames = sClass.split(' ')
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
--- trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2008-01-17 02:44:42 UTC (rev 5442)
+++ trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2008-01-17 02:45:39 UTC (rev 5443)
@@ -7,6 +7,7 @@
Tree.ID_CONTENT = "content";
Tree.ID_CHILDS_ROW = "childs";
Tree.ID_CHILDS_TD = "td";
+Tree.ID_HANDLES = "handles";
Tree.ID_HANDLE = "handle";
Tree.ID_HANDLE_IMG_EXPANDED = "img:expanded";
Tree.ID_HANDLE_IMG_COLLAPSED = "img:collapsed";
Modified: trunk/ui/tree/src/main/templates/htmlTreeNode.jspx
===================================================================
--- trunk/ui/tree/src/main/templates/htmlTreeNode.jspx 2008-01-17 02:44:42 UTC (rev 5442)
+++ trunk/ui/tree/src/main/templates/htmlTreeNode.jspx 2008-01-17 02:45:39 UTC (rev 5443)
@@ -40,7 +40,7 @@
<f:call name="utils.encodePassThruWithExclusions">
<f:parameter value="id,onclick"/>
</f:call>
- <td class="dr-tree-h-ic rich-tree-node-handleicon #{line}">
+ <td class="dr-tree-h-ic rich-tree-node-handleicon #{line}" id="#{clientId}:handles">
<jsp:scriptlet>
<![CDATA[
if (Boolean.TRUE.equals(component.getAttributes().get("isAjaxUpdateRoot")) && component.getUITree().isShowConnectingLines()) {
@@ -55,19 +55,6 @@
<div>
<jsp:scriptlet>
- <![CDATA[
- if (org.richfaces.component.UITree.SWITCH_CLIENT.equals(component.getUITree().getSwitchType())) {
- ]]>
- </jsp:scriptlet>
- <input class="dr-tree-h-input" type="hidden" id="#{clientId}NodeExpanded" name="#{clientId}NodeExpanded" value="#{this:getExpandedValue(context,component)}" />
- <jsp:scriptlet>
- <![CDATA[
- }
- ]]>
- </jsp:scriptlet>
-
-
- <jsp:scriptlet>
<![CDATA[
boolean leaf = component.getUITree().isLeaf();
if (leaf) {
@@ -150,6 +137,19 @@
}
]]>
</jsp:scriptlet>
+
+ <jsp:scriptlet>
+ <![CDATA[
+ if (org.richfaces.component.UITree.SWITCH_CLIENT.equals(component.getUITree().getSwitchType())) {
+ ]]>
+ </jsp:scriptlet>
+ <input class="dr-tree-h-input" type="hidden" id="#{clientId}NodeExpanded" name="#{clientId}NodeExpanded" value="#{this:getExpandedValue(context,component)}" />
+ <jsp:scriptlet>
+ <![CDATA[
+ }
+ ]]>
+ </jsp:scriptlet>
+
</div>
</td>
16 years, 12 months
JBoss Rich Faces SVN: r5442 - in trunk/ui: dropdown-menu/src/main/templates/org/richfaces and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-16 21:44:42 -0500 (Wed, 16 Jan 2008)
New Revision: 5442
Modified:
trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
trunk/ui/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1905
Modified: trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
--- trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2008-01-17 01:29:42 UTC (rev 5441)
+++ trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2008-01-17 02:44:42 UTC (rev 5442)
@@ -93,6 +93,7 @@
menuOptions.addEventHandler("onexpand");
menuOptions.addEventHandler("onitemselect");
menuOptions.addEventHandler("ongroupactivate");
+ menuOptions.addOption("disabled");
function.addParameter(menuOptions);
function.appendScript(buffer);
Modified: trunk/ui/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx
===================================================================
--- trunk/ui/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx 2008-01-17 01:29:42 UTC (rev 5441)
+++ trunk/ui/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx 2008-01-17 02:44:42 UTC (rev 5442)
@@ -19,8 +19,8 @@
</jsp:scriptlet>
<div id="#{clientId}" style=""
class="#{component.attributes['styleClass']} dr-menu-label dr-menu-label-unselect rich-ddmenu-label rich-ddmenu-label-unselect"
- onmouseover="this.className='dr-menu-label dr-menu-label-select rich-ddmenu-label rich-ddmenu-label-select' ; #{component.attributes['onmouseover']}"
- onmouseout="this.className='dr-menu-label dr-menu-label-unselect rich-ddmenu-label rich-ddmenu-label-unselect'; #{component.attributes['onmouseout']}"
+ onmouseover="#{component.attributes['onmouseover']}"
+ onmouseout="#{component.attributes['onmouseout']}"
onmousemove="#{component.attributes['onmousemove']}">
<jsp:scriptlet>
<![CDATA[ } else { ]]>
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-01-17 01:29:42 UTC (rev 5441)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-01-17 02:44:42 UTC (rev 5442)
@@ -83,17 +83,19 @@
String itemId = null;
int flcloseonclick = 1;
int flagGroup = 0;
+ boolean disabled = false;
if (kid instanceof UIMenuItem) {
UIMenuItem menuItem = (UIMenuItem) kid;
itemId = kid.getClientId(context);
- if (menuItem.isDisabled()) {
+ disabled = menuItem.isDisabled();
+ if (disabled) {
flcloseonclick = 0;
}
} else if (kid instanceof UIMenuGroup) {
UIMenuGroup menuGroup = (UIMenuGroup) kid;
itemId = "ref" + kid.getClientId(context);
flcloseonclick = 0;
- if (menuGroup.isDisabled()) {
+ if ((disabled = menuGroup.isDisabled())) {
flagGroup = 2;
} else {
flagGroup = 1;
@@ -102,13 +104,16 @@
if (itemId != null) {
JSFunction function = new JSFunction(".addItem");
function.addParameter(itemId);
- function.addParameter(new Integer(flcloseonclick));
-
ScriptOptions options = new ScriptOptions(kid);
options.addEventHandler("onmouseout");
options.addEventHandler("onmouseover");
+ options.addOption("closeOnClick", new Integer(flcloseonclick));
options.addOption("flagGroup", new Integer(flagGroup));
options.addOption("selectClass");
+ options.addOption("style");
+ options.addOption("selectStyle");
+ options.addOption("iconClass");
+ options.addOption("disabled", Boolean.valueOf(disabled));
function.addParameter(options);
return function.toScript();
}
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-01-17 01:29:42 UTC (rev 5441)
+++ trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-01-17 02:44:42 UTC (rev 5442)
@@ -1,4 +1,3 @@
-
if(!window.RichFaces) window.RichFaces = {};
if(!RichFaces.Menu) RichFaces.Menu = {};
@@ -105,13 +104,21 @@
var visible = this.isVisible(menuName);
this.setVisibility(menuName, visibleFlag);
this.ieSelectWorkAround(menuName, visibleFlag);
+ var menuLayer = this.layers[menu.id];
+
if (visible && !visibleFlag) {
- var menuLayer = this.layers[menu.id];
- if (menuLayer && menuLayer.eventOnClose) menuLayer.eventOnClose();
- if (menuLayer && menuLayer.eventOnCollapse) menuLayer.eventOnCollapse();
- if (menuLayer.refItem) menuLayer.refItem.highLightGroup(false);
+ if (menuLayer) {
+ if (menuLayer.eventOnClose) {
+ menuLayer.eventOnClose();
+ }
+ if (menuLayer.eventOnCollapse) {
+ menuLayer.eventOnCollapse();
+ }
+ if (menuLayer.refItem) {
+ menuLayer.refItem.highLightGroup(false);
+ }
+ }
} else if (!visible && visibleFlag) {
- var menuLayer = this.layers[menu.id];
if (menuLayer) {
if (menuLayer.eventOnOpen) {
menuLayer.eventOnOpen();
@@ -119,11 +126,15 @@
if (menuLayer.eventOnExpand) {
menuLayer.eventOnExpand();
}
- if (menuLayer.level && menuLayer.level > 0) {
+
+ if (menuLayer.level>0) {
do {
menuLayer = this.layers[(this.father[menuLayer.id])];
- } while (menuLayer.level > 0)
- if (menuLayer && menuLayer.eventOnGroupActivate) menuLayer.eventOnGroupActivate();
+ } while (menuLayer.level > 0);
+
+ if (menuLayer && menuLayer.eventOnGroupActivate) {
+ menuLayer.eventOnGroupActivate();
+ }
}
}
}
@@ -320,7 +331,7 @@
if (!e) {
e = window.event;
}
- Event.stop(e);
+ //Event.stop(e);
this.event = Object.clone(e);
this.element = Event.element(e);
this.layer = $(layer);
@@ -330,13 +341,25 @@
var win = RichFaces.Menu.getWindowDimensions();
var bodyHeight = body.height;
var bodyWidth = body.width;
+
var clientX = this.event.clientX;
var clientY = this.event.clientY;
- var top = Event.pointerY(this.event);
- var left = Event.pointerX(this.event);
+ var e = this.event;
+ var x = Event.pointerX(e);
+ var y = Event.pointerY(e);
+ var elementDim = Richfaces.Position.getOffsetDimensions(this.layer);
+
+ var offsets = Position.cumulativeOffset(this.layer);
+
+ offsets[0] -= this.layer.offsetLeft || 0;
+ offsets[1] -= this.layer.offsetTop || 0;
+
+ var toolTipX = x - offsets[0];
+ var toolTipY = y - offsets[1];
+
var layerdim = Element.getDimensions(this.layer);
- var layerLeft = left;
+ var layerLeft = toolTipX;
if (clientX + layerdim.width > win.width) {
layerLeft -= (layerdim.width - RichFaces.Menu.Layers.shadowWidth - RichFaces.Menu.Layers.CornerRadius);
@@ -355,7 +378,7 @@
layerLeft = 0;
}
*/
- var layerTop = top;
+ var layerTop = toolTipY;
/*if (layertop + layerdim.height > bodyHeight) {
layertop = bodyHeight - layerdim.height;
}
@@ -688,18 +711,17 @@
this.items = new Array();
RichFaces.Menu.Layers.layers[id] = this;
this.bindings = new Array();
-
+
//Usually set on DD menu to true
this.highlightParent = true;
-
+
this.mouseover =
function(e){
RichFaces.Menu.MouseIn=true;
RichFaces.Menu.Layers.clearLMTO();
- if (this.highlightParent) {
- var menuNode = RichFaces.Menu.Layers.layers[this.layer.id].layer.parentNode.parentNode;
- menuNode.className='dr-menu-label dr-menu-label-select rich-ddmenu-label rich-ddmenu-label-select';
+ if (this.shouldHighlightParent() && !this.isWithin(e)) {
+ this.highlightLabel();
}
Event.stop(e);
@@ -711,9 +733,8 @@
if (!RichFaces.Menu.selectOpen) {
RichFaces.Menu.Layers.setLMTO(this.hideDelay);
}
- if (this.highlightParent) {
- var menuNode = RichFaces.Menu.Layers.layers[this.layer.id].layer.parentNode.parentNode;
- menuNode.className='dr-menu-label dr-menu-label-unselect rich-ddmenu-label rich-ddmenu-label-unselect';
+ if (this.shouldHighlightParent() && !this.isWithin(e)) {
+ this.unHighlightLabel();
}
Event.stop(e);
}.bindAsEventListener(this);
@@ -788,7 +809,50 @@
} */
},
+ getLabel : function() {
+ return RichFaces.Menu.Layers.layers[this.layer.id].layer.parentNode.parentNode;
+ },
+
+ highlightLabel: function() {
+ var label1 = $(this.getLabel());
+ RichFaces.Menu.Items.replaceClasses(label1,
+ ['dr-menu-label-unselect', 'rich-ddmenu-label-unselect'],
+ ['dr-menu-label-select','rich-ddmenu-label-select']);
+ },
+ unHighlightLabel: function() {
+ var label1 = $(this.getLabel());
+ RichFaces.Menu.Items.replaceClasses(label1,
+ ['dr-menu-label-select','rich-ddmenu-label-select'],
+ ['dr-menu-label-unselect', 'rich-ddmenu-label-unselect']);
+ },
+
+ shouldHighlightParent : function() {
+ var result = this.highlightParent;
+ var parent = null;
+ if (result && (parent = this.getParentLayer())) {
+ result &= parent.shouldHighlightParent();
+ }
+ return result;
+ },
+
+ getParentLayer: function() {
+ return this.level > 0 ? RichFaces.Menu.Layers.layers[(RichFaces.Menu.Layers.father[this.id])] : null;
+ },
+
+ isWithin : function(event){
+ var within = true;
+ var targetElement = event.relatedTarget;
+ var srcElement = event.target;
+ var layer = $(this.id);
+ if (targetElement) {
+ within = $(targetElement).descendantOf(layer);
+ }
+
+ within &= $(srcElement).descendantOf(layer);
+
+ return within;
+ },
openSelect: function(event){
RichFaces.Menu.selectOpen = true;
@@ -798,6 +862,7 @@
},
+
closeSelect: function(event){
RichFaces.Menu.selectOpen = false;
var ClickInputb = this.ClickInput.bindAsEventListener(this);
@@ -881,104 +946,11 @@
},
//addItem: function(itemId, hoverClass, plainClass, hoverStyle, plainStyle){
- addItem: function(itemId, flag_close_onclick, options) {
+ addItem: function(itemId, options) {
var dis = this;
- var item = {
- highLightGroup: function(light) {
- if (light) {
- Element.removeClassName(this.id,"dr-menu-item-enabled");
- Element.addClassName(this.id,"dr-menu-item-hover");
- Element.addClassName(this.id,"rich-menu-group-hover");
- if (this.options.selectClass) Element.addClassName(this.id, this.options.selectClass);
-
- Element.addClassName(this.id+":icon","rich-menu-item-icon-selected");
- Element.addClassName(this.id+":anchor","rich-menu-item-label");
- } else if (!this.mouseOver) {
- Element.removeClassName(this.id,"dr-menu-item-hover");
- Element.removeClassName(this.id,"rich-menu-group-hover");
- Element.addClassName(this.id,"dr-menu-item-enabled");
- if (this.options.selectClass) Element.removeClassName(this.id, this.options.selectClass);
-
- Element.removeClassName(this.id+":icon","rich-menu-item-icon-selected");
- Element.removeClassName(this.id+":anchor","rich-menu-item-label");
- }
- }
- };
- item.id = itemId;
- item.obj = $(itemId);
- item.menu = this;
- item.options = options || {};
- item.mouseOver = false;
- if (item.options.onmouseover && item.options.onmouseover != ""){
- item.eventOnMouseOver = new Function("event",item.options.onmouseover).bindAsEventListener(item);
- }
- if (item.options.onmouseout && item.options.onmouseout != ""){
- item.eventOnMouseOut = new Function("event",item.options.onmouseout).bindAsEventListener(item);
- }
+ var item = new RichFaces.Menu.Item(itemId, this, options || {});
+ //item.menu = this;
this.items[itemId] = item;
-
- var onmouseover =
- function(e){
- this.menu.closeMinors(this.id);
- if (this.options.flagGroup == 1) {
- this.mouseOver = true;
- this.highLightGroup(true);
- }
- if (this.eventOnMouseOver) {
- var reltg = (e.relatedTarget) ? e.relatedTarget : e.fromElement;
- while (reltg && reltg != this.obj && reltg.nodeName != 'BODY')
- reltg = reltg.parentNode;
- if (reltg == this.obj) return;
- this.eventOnMouseOver();
- }
- }.bindAsEventListener(item);
-
- var onmouseout =
- function(e){
- if (this.options.flagGroup == 1) {
- this.mouseOver = false;
- this.highLightGroup(false);
- }
- if (this.eventOnMouseOut) {
- var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
- while (reltg && reltg != this.obj && reltg.nodeName != 'BODY')
- reltg = reltg.parentNode;
- if (reltg == this.obj) return;
- this.eventOnMouseOut();
- }
- }.bindAsEventListener(item);
-
- var onmouseclick =
- function(e){
- var menuLayer = item.menu;
- while (menuLayer.level > 0) {
- menuLayer = RichFaces.Menu.Layers.layers[(RichFaces.Menu.Layers.father[menuLayer.id])];
- }
- if (menuLayer && menuLayer.eventOnItemSelect) menuLayer.eventOnItemSelect();
- RichFaces.Menu.Layers.shutdown();
- }.bindAsEventListener(item);
-
- var binding = new RichFaces.Menu.Layer.Binding (
- item.id,
- "mouseover",
- onmouseover);
- this.bindings.push(binding);
- binding.refresh();
- binding = new RichFaces.Menu.Layer.Binding (
- item.id,
- "mouseout",
- onmouseout);
- this.bindings.push(binding);
- binding.refresh();
- if (flag_close_onclick==1){
- binding = new RichFaces.Menu.Layer.Binding (
- item.id,
- "click",
- onmouseclick);
- this.bindings.push(binding);
- binding.refresh();
- }
-
return this;
},
hideMe: function(e){
@@ -1007,7 +979,12 @@
if (!e) {
e = window.event;
}
+
RichFaces.Menu.Layers.showDropDownLayer(this.id, topLevel, e,this.delay);
+ if (options.disabled == false && !RichFaces.Menu.isWithin(e, $(topLevel))) {
+ this.highlightLabel();
+ }
+
}.bindAsEventListener(this);
if(!onEvt){
@@ -1024,6 +1001,9 @@
function(e){
RichFaces.Menu.Layers.setLMTO(this.hideDelay);
RichFaces.Menu.Layers.clearPopUpTO();
+ if (options.disabled == false && !RichFaces.Menu.isWithin(e, $(topLevel))) {
+ this.unHighlightLabel();
+ }
}.bindAsEventListener(this);
// var item = $(topLevel);
@@ -1074,39 +1054,27 @@
this.hideDelay=menuLayer.hideDelay;
}
- this.highlightParent = options.highlightParent;
return this;
},
- asContextMenu: function(parent, evt){
- var refLayer = $(parent);
- if(!refLayer) return this;
+ asContextMenu: function(options){
+ this.highlightParent = false;
+ this.options = options || {};
+ if (this.options.ongroupactivate){
+ this.eventOnGroupActivate = this.options.ongroupactivate.bindAsEventListener(this);
+ }
+ if (this.options.onitemselect){
+ this.eventOnItemSelect = this.options.onitemselect.bindAsEventListener(this);
+ }
+ if (this.options.oncollapse){
+ this.eventOnCollapse = this.options.oncollapse.bindAsEventListener(this);
+ }
+ if (this.options.onexpand){
+ this.eventOnExpand = this.options.onexpand.bindAsEventListener(this);
+ }
-
- var id = this.id;
- this.highlightParent = false;
- if(!evt){
- evt = 'onclick';
- }
- var offEvt = 'onmouseout';
- offEvt = this.eventJsToPrototype(offEvt);
-
- var dis = this;
- var onmouseout =
- function(e){
- RichFaces.Menu.Layers.setLMTO(this.hideDelay);
- RichFaces.Menu.Layers.clearPopUpTO();
- }.bindAsEventListener(this);
- evt = this.eventJsToPrototype(evt);
- var handler = function(e){new RichFaces.Menu.DelayedContextMenu(this.id, e).show();}.bindAsEventListener(this);
- var binding = new RichFaces.Menu.Layer.Binding (parent, evt, handler);
- this.bindings.push(binding);
- binding.refresh();
- binding = new RichFaces.Menu.Layer.Binding (parent, offEvt, onmouseout);
- this.bindings.push(binding);
- binding.refresh();
-
- return this;
+ //TODO: clarify
+ return this;
},
eventJsToPrototype: function(evtName){
var indexof = evtName.indexOf('on');
@@ -1128,7 +1096,7 @@
refresh:function(){
/*LOG.a4j_debug("rebinding " + $H(this).inspect());*/
var obj = $(this.objectId);
- if (obj && obj.tagName) {
+ if(obj){
Event.stopObserving(obj, this.eventname, this.handler);
Event.observe(obj, this.eventname, this.handler);
return true;
@@ -1136,84 +1104,208 @@
return false;
}
};
-if(!RichFaces.Menu.Item) RichFaces.Menu.Item = {};
+RichFaces.Menu.Items = {
+ classNames: ['dr-menu-item-enabled', 'rich-menu-item-enabled'],
+ hoverClassNames : ['dr-menu-item-hover', 'rich-menu-item-hover'],
+ iconClassNames : [],
+ hoverIconClassNames: ['dr-menu-icon-selected', 'rich-menu-item-icon-selected'],
+ labelClassNames: [],
+ hoverLabelClassNames: ['rich-menu-item-label-selected'],
+
+ replaceClasses: function(element, toRemove, toAdd) {
+ var e = $(element);
+ $A(toRemove).each(function(className) {e.removeClassName(className)});
+ $A(toAdd).each(function(className) {e.addClassName(className)});
+ },
+
+ onmouseover: function(item) {
+ var element = item.getElement();
+ var icon = item.getIcon();
+ var labl = item.getLabel();
-/**
- *
- */
-RichFaces.Menu.Item.Onclick = function(evt, item, action, params, target) {
- var form = Event.findElement(evt, 'form');
+ var hoverClass = item.getHoverClasses();
+ var iconHoverClass = item.getIconHoverClasses();
+ var labelHoverClass = item.getLabelHoverClasses();
+
+ var inlineStyle = item.getInlineStyle();
+ var hoverStyle = item.getHoverStyle();
+ element.style.cssText = inlineStyle.concat(hoverStyle);
+
+ this.replaceClasses(element, this.classNames, this.hoverClassNames.concat(hoverClass));
+ this.replaceClasses(icon, this.iconClassNames, this.hoverIconClassNames.concat(iconHoverClass));
+ this.replaceClasses(labl, this.labelClassNames, this.hoverLabelClassNames.concat(labelHoverClass));
+ },
+ onmouseout : function(item) {
+ var element = item.getElement();
+ var icon = item.getIcon();
+ var labl = item.getLabel();
- /*if(!form || typeof(form) == 'undefined' || !form.nodeName || form.nodeName.toLowerCase() != 'form'){
- form = document.createElement('form');
- form.setAttribute('method', 'post');
- form.setAttribute('enctype', 'application/x-www-form-urlencoded');
- form.action = action;
- document.body.appendChild(form);
- }*/
- var objectsCreated = new Array();
- var oldValues = new Object();
- RichFaces.Menu.Item._createOrInitHiddenInput(item + ":submit", item + ":submit", objectsCreated, oldValues, form);
+ var hoverClass = item.getHoverClasses();
+ var iconHoverClass = item.getIconHoverClasses();
+ var labelHoverClass = item.getLabelHoverClasses();
- if (params) {
+ var inlineStyle = item.getInlineStyle();
+ element.style.cssText = inlineStyle;
- for (var param in params) {
- var paramName = param;
- var paramValue = params[paramName];
- if (typeof(paramValue) != 'function') {
- if (paramValue) {
- paramValue = String(paramValue);
+ this.replaceClasses(element, this.hoverClassNames.concat(hoverClass), this.classNames);
+ this.replaceClasses(icon, this.hoverIconClassNames.concat(iconHoverClass), this.iconClassNames);
+ this.replaceClasses(labl, this.hoverLabelClassNames.concat(labelHoverClass), this.labelClassNames);
}
- RichFaces.Menu.Item._createOrInitHiddenInput(paramName, paramValue, objectsCreated, oldValues, form);
- }
- }
+};
+RichFaces.Menu.isWithin = function (event, element) {
+ var within = false;
+ Event.extend(event);
+ var targetElement = event.relatedTarget;
+ var srcElement = Event.element(event);
+
+ if (targetElement) {
+ within = targetElement == element ||
+ $(targetElement).descendantOf(element);
}
- var l = objectsCreated.length;
+ return within;
+};
- for (var i = 0; i < l; i++) {
- var kid = objectsCreated[i];
- form.appendChild(kid);
- }
+RichFaces.Menu.Item = Class.create({
+ initialize: function(id, menu, options) {
+ this.options = options;
+ this.id = id;
+ this.menu = menu;
+ this.mouseOver = false;
+
- var targ = form.target;
- if (target) {
- form.target = target;
- }
+ var binding;
- form.submit();
+ binding = new RichFaces.Menu.Layer.Binding (
+ id,
+ "mouseover",
+ this.onmouseover.bindAsEventListener(this));
+ menu.bindings.push(binding);
+ binding.refresh();
+
+ binding = new RichFaces.Menu.Layer.Binding (
+ id,
+ "mouseout",
+ this.onmouseout.bindAsEventListener(this));
+ menu.bindings.push(binding);
+ binding.refresh();
- form.target = targ;
+ binding = new RichFaces.Menu.Layer.Binding (
+ id,
+ "click",
+ this.onclick.bindAsEventListener(this));
+ menu.bindings.push(binding);
+ binding.refresh();
+ },
- for (var j = 0; j < l; j++) {
- var kid = objectsCreated[j];
- if (form && kid) {
- form.removeChild(kid);
+
+ onclick: function(e){
+ if (this.options.closeOnClick == 1) {
+ var menuLayer = this.menu;
+ while (menuLayer.level > 0) {
+ menuLayer = RichFaces.Menu.Layers.layers[(RichFaces.Menu.Layers.father[menuLayer.id])];
}
+ if (menuLayer && menuLayer.eventOnItemSelect) menuLayer.eventOnItemSelect();
+ RichFaces.Menu.Layers.shutdown();
}
+ RichFaces.Menu.Items.onmouseout(this);
+ },
+ getElement: function() {
+ return $(this.id);
+ },
+ getIcon: function() {
+ return $(this.id + ":icon");
+ },
+ getLabel: function() {
+ return $(this.id + ":anchor");
+ },
+ getInlineStyle: function() {
+ return this.options.style || "";
+ },
+ getHoverStyle: function() {
+ return this.options.selectStyle || "";
+ },
+ getHoverClasses: function() {
+ return $A(this.options.selectClass).compact();
+ },
+ getIconHoverClasses : function() {
+ return $A(this.options.iconHoverClass).compact();
+ },
+ getLabelHoverClasses : function() {
+ return $A(this.options.labelHoverClass).compact();
+ },
- for (var key in oldValues) {
- var value = oldValues[key];
- if (typeof(value) != 'function') {
- ($(key) || form[key]).value = value;
+ isDisabled : function() {
+ //console.log(this.id + (this.options.disabled));
+ return this.options.disabled || false;
+ },
+ onmouseover : function(event) {
+ var element = this.getElement();
+
+ if (this.options.onmouseover) {
+ if (this.options.onmouseover.call(element, event) == false) {
+ Event.stop(event);
+ return;
+ };
+ }
+ if (RichFaces.Menu.isWithin(event, element)) {
+ return;
+ }
+ this.menu.closeMinors(this.id);
+ if (this.isDisabled()) {
+ return;
+ }
+ if (this.options.flagGroup == 1) {
+ this.mouseOver = true;
+ this.highLightGroup(true);
+ }
+ RichFaces.Menu.Items.onmouseover(this);
+ },
+ onmouseout : function(event) {
+ Event.extend(event);
+ //window.status = $(event.relatedTarget).inspect();
+ if (this.options.onmouseout) {
+ if (this.options.onmouseover.call(element, event) == false) {
+ Event.stop(event);
+ return;
+ };
}
+ var element = this.getElement();
+ if (RichFaces.Menu.isWithin(event, element)) {
+ return;
+ }
+ if (this.isDisabled()) {
+ return;
+ }
+ if (this.options.flagGroup == 1) {
+ this.mouseOver = false;
+ this.highLightGroup(false);
}
+ RichFaces.Menu.Items.onmouseout(this);
+ },
+ highLightGroup: function(light) {
+ if (light) {
+ Element.removeClassName(this.id,"dr-menu-item-enabled");
+ Element.addClassName(this.id,"dr-menu-item-hover");
+ Element.addClassName(this.id,"rich-menu-group-hover");
+ if (this.options.selectClass) {
+ Element.addClassName(this.id, this.options.selectClass);
}
-RichFaces.Menu.Item._createOrInitHiddenInput = function(name, value, list, oldValues, form) {
- var hiddenObj = $(name) || form[name];
-
- if (!hiddenObj) {
- hiddenObj = document.createElement('input');
- hiddenObj.setAttribute('type', 'hidden');
- hiddenObj.setAttribute('name', name);
- hiddenObj.setAttribute('id', name);
- list.push(hiddenObj);
- } else {
- oldValues[name] = hiddenObj.value;
+ Element.addClassName(this.id+":icon","rich-menu-item-icon-selected");
+ Element.addClassName(this.id+":anchor","rich-menu-item-label");
+ } else if (!this.mouseOver) {
+ Element.removeClassName(this.id,"dr-menu-item-hover");
+ Element.removeClassName(this.id,"rich-menu-group-hover");
+ Element.addClassName(this.id,"dr-menu-item-enabled");
+ if (this.options.selectClass) {
+ Element.removeClassName(this.id, this.options.selectClass);
+ }
+ Element.removeClassName(this.id+":icon","rich-menu-item-icon-selected");
+ Element.removeClassName(this.id+":anchor","rich-menu-item-label");
}
- hiddenObj.value = value;
}
+});
Modified: trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
===================================================================
--- trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-01-17 01:29:42 UTC (rev 5441)
+++ trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-01-17 02:44:42 UTC (rev 5442)
@@ -62,7 +62,7 @@
$('#{clientId}:icon').className='dr-menu-icon dr-menu-icon-selected rich-menu-item-icon rich-menu-item-icon-selected #{component.attributes['iconClass']}';
$('#{clientId}:anchor').className='rich-menu-item-label rich-menu-item-label-selected';"
style="#{component.attributes['style']}"
- onclick="this.className='dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled #{component.attributes['styleClass']}'; #{onselect} #{onclick}; Event.stop(event);"
+ onclick="this.className='dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled #{component.attributes['styleClass']}'; #{onselect} #{onclick}; Event.stop(event);"
onmouseup="Event.stop(event); #{component.attributes['onmouseup']}">
<f:call name="utils.encodeAttributes">
<f:parameter value="onmousedown,onmousemove" />
16 years, 12 months
JBoss Rich Faces SVN: r5441 - in trunk: framework/impl/src/main/javascript/ajaxjsf and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-01-16 20:29:42 -0500 (Wed, 16 Jan 2008)
New Revision: 5441
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/util/LRUMap.java
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java
Log:
Fix call parameters for a oncomplete function. Change jsFunction declaration for namespace-enabled function names
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/util/LRUMap.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/util/LRUMap.java 2008-01-16 19:13:04 UTC (rev 5440)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/util/LRUMap.java 2008-01-17 01:29:42 UTC (rev 5441)
@@ -13,7 +13,7 @@
* @author asmirnov
*
*/
-public class LRUMap extends LinkedHashMap implements Serializable {
+public class LRUMap<K,V> extends LinkedHashMap<K,V> implements Serializable {
/**
*
@@ -31,7 +31,7 @@
}
- protected boolean removeEldestEntry(Entry entry) {
+ protected boolean removeEldestEntry(Entry<K,V> entry) {
// Remove last entry if size exceeded.
return size()>capacity;
}
@@ -41,7 +41,7 @@
* @return the most Recent value
*/
public Object getMostRecent() {
- Iterator iterator = values().iterator();
+ Iterator<V> iterator = values().iterator();
Object mostRecent=null;
while (iterator.hasNext()) {
mostRecent = iterator.next();
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-16 19:13:04 UTC (rev 5440)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-17 01:29:42 UTC (rev 5441)
@@ -988,28 +988,20 @@
var options = request.options;
// we can set listener for complete request - for example,
// it can shedule next request for update page.
- var oncomplete = request.getElementById('org.ajax4jsf.oncomplete');
- if(oncomplete) {
+ var oncomp = request.getElementById('org.ajax4jsf.oncomplete');
+ if(oncomp) {
LOG.debug( "Call request oncomplete function after processing updates" );
window.setTimeout(function(){
var event = request.domEvt;
var data = request.getJSON('_ajax:data');
try {
- var newscript = Sarissa.getText(oncomplete,true);
- if (!window.data) {
- window.data = data;
- } else {
- for (property in data) {
- window.data[property] = data[property];
- }
- }
+ var newscript = Sarissa.getText(oncomp,true);
+ var oncomplete = new Function("request","event","data",newscript);
+ var target = null;
if (event) {
- var target = event.target ? event.target : event.srcElement;
- new Function(newscript).apply(target);
- } else {
- window.eval(newscript);
- }
-
+ target = event.target ? event.target : event.srcElement;
+ };
+ oncomplete.call(target,request,event,data);
} catch(e){
LOG.error('Error evaluate oncomplete function '+e.Message);
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java 2008-01-16 19:13:04 UTC (rev 5440)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java 2008-01-17 01:29:42 UTC (rev 5441)
@@ -52,9 +52,9 @@
}
public String getFunction(FacesContext context, UIAjaxFunction component) {
- StringBuffer script = new StringBuffer();
+ StringBuffer script = new StringBuffer(component.getName()).append("=");
JSFunctionDefinition func = new JSFunctionDefinition();
- func.setName(component.getName());
+ //func.setName(component.getName());
// Create AJAX Submit function.
JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(
component, context,AjaxRendererUtils.AJAX_FUNCTION_NAME);
16 years, 12 months
JBoss Rich Faces SVN: r5440 - trunk/sandbox/samples/combobox-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-16 14:13:04 -0500 (Wed, 16 Jan 2008)
New Revision: 5440
Modified:
trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp
Log:
Modified: trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp 2008-01-16 19:11:55 UTC (rev 5439)
+++ trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp 2008-01-16 19:13:04 UTC (rev 5440)
@@ -57,9 +57,14 @@
<h:inputText value="#{bean.onitemselectedScript}" />
</h:panelGrid>
- <h:commandButton action="none" value="apply"></h:commandButton>
- </h:form>
- <h:form>
+
+ <cmb:comboBox disabled="false">
+ <f:selectItem itemValue="Oregon"/>
+ <f:selectItem itemValue="Pennsylvania"/>
+ <f:selectItem itemValue="Rhode Island"/>
+ <f:selectItem itemValue="South Carolina"/>
+ </cmb:comboBox>
+
<cmb:comboBox
disabled="#{bean.disabled}"
inputClass="inputClass"
@@ -81,19 +86,18 @@
onchange="#{bean.onchangeScript}"
onlistcall="#{bean.onlistcallScript}"
onitemselected="#{bean.onitemselectedScript}">
-
<f:selectItems value="#{bean.selectItems}"/>
<f:selectItem itemValue="Oregon"/>
<f:selectItem itemValue="Pennsylvania"/>
<f:selectItem itemValue="Rhode Island"/>
<f:selectItem itemValue="South Carolina"/>
</cmb:comboBox>
- <cmb:comboBox>
+ <cmb:comboBox disabled="false">
<f:selectItem itemValue="Oregon"/>
<f:selectItem itemValue="Pennsylvania"/>
<f:selectItem itemValue="Rhode Island"/>
<f:selectItem itemValue="South Carolina"/>
- </cmb:comboBox>
+ </cmb:comboBox>
<br/>
<h:commandButton action="none" value="submit"></h:commandButton>
<br>
16 years, 12 months
JBoss Rich Faces SVN: r5439 - in branches/3.1.x: ui/drag-drop/src/main/java/org/richfaces/renderkit/html and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-01-16 14:11:55 -0500 (Wed, 16 Jan 2008)
New Revision: 5439
Modified:
branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java
branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/html/DragSupportRenderer.java
branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/html/DropSupportRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-1678
Modified: branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java
===================================================================
--- branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java 2008-01-16 18:58:28 UTC (rev 5438)
+++ branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java 2008-01-16 19:11:55 UTC (rev 5439)
@@ -27,10 +27,13 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import org.ajax4jsf.org.w3c.tidy.EntityTable;
import org.ajax4jsf.renderkit.AjaxChildrenRenderer;
import org.ajax4jsf.resource.InternetResource;
@@ -236,4 +239,21 @@
encoder.doEncode(context, component);
}
}
+
+ protected String escapeHtmlEntities(CharSequence orig) {
+ StringBuffer buff = new StringBuffer(orig);
+ EntityTable defaultEntityTable = EntityTable.getDefaultEntityTable();
+ Matcher matcher = Pattern.compile("\\&\\w+\\;").matcher(orig);
+ int delta = 0;
+ while (matcher.find()) {
+ String name = matcher.group().substring(0, matcher.group().length() - 1);
+ int code = defaultEntityTable.entityCode(name);
+ if (0 != code) {
+ String replacement = "&#" + code + ";";
+ buff.replace(matcher.start() - delta, matcher.end() - delta, replacement);
+ delta = delta + matcher.group().length() - replacement.length();
+ }
+ }
+ return buff.toString();
+ }
}
Modified: branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/html/DragSupportRenderer.java
===================================================================
--- branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/html/DragSupportRenderer.java 2008-01-16 18:58:28 UTC (rev 5438)
+++ branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/html/DragSupportRenderer.java 2008-01-16 19:11:55 UTC (rev 5439)
@@ -106,7 +106,7 @@
writer.startElement(HTML.SCRIPT_ELEM, component);
writer.writeAttribute("id", component.getClientId(context), "id");
- writer.write(buffer.toString());
+ writer.write(escapeHtmlEntities(buffer));
writer.endElement(HTML.SCRIPT_ELEM);
}
}
Modified: branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/html/DropSupportRenderer.java
===================================================================
--- branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/html/DropSupportRenderer.java 2008-01-16 18:58:28 UTC (rev 5438)
+++ branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/html/DropSupportRenderer.java 2008-01-16 19:11:55 UTC (rev 5439)
@@ -107,7 +107,7 @@
writer.startElement(HTML.SCRIPT_ELEM, component);
writer.writeAttribute("id", component.getClientId(context), "id");
- writer.write(buffer.toString());
+ writer.write(escapeHtmlEntities(buffer));
writer.endElement(HTML.SCRIPT_ELEM);
}
}
16 years, 12 months
JBoss Rich Faces SVN: r5438 - in trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui: component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-16 13:58:28 -0500 (Wed, 16 Jan 2008)
New Revision: 5438
Added:
trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/component/ComboBoxComponentTest.java
trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/renderkit/
trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/renderkit/ComboBoxRendererTest.java
Log:
JUNITS
Added: trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/component/ComboBoxComponentTest.java
===================================================================
--- trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/component/ComboBoxComponentTest.java (rev 0)
+++ trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/component/ComboBoxComponentTest.java 2008-01-16 18:58:28 UTC (rev 5438)
@@ -0,0 +1,160 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.sandbox.ui.component;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.UISelectItem;
+import javax.faces.component.UISelectItems;
+import javax.faces.component.html.HtmlForm;
+import javax.faces.model.SelectItem;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
+import org.richfaces.component.UIComboBox;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
+
+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();
+
+
+ private static Set javaScripts = new HashSet();
+
+ static {
+ javaScripts.add("a4j_3_2_0-SNAPSHOTorg.ajax4jsf.javascript.PrototypeScript");
+ javaScripts.add("a4j_3_2_0-SNAPSHOTscripts/comboboxUtils.js");
+ javaScripts.add("a4j_3_2_0-SNAPSHOTscripts/combobox.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);
+ 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();}
+ 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"));
+ }
+ }
+
+ 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 testComponent() {
+ assertTrue( true );
+ }
+}
Added: trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/renderkit/ComboBoxRendererTest.java
===================================================================
--- trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/renderkit/ComboBoxRendererTest.java (rev 0)
+++ trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/renderkit/ComboBoxRendererTest.java 2008-01-16 18:58:28 UTC (rev 5438)
@@ -0,0 +1,117 @@
+/**
+ *
+ */
+package org.richfaces.sandbox.ui.renderkit;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+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;
+import org.richfaces.component.UIComboBox;
+import org.richfaces.renderkit.html.ComboBoxRenderer;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlSelect;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+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 static Set javaScripts = new HashSet();
+
+ static {
+ javaScripts.add("org/richfaces/renderkit/html/scripts/combobox.js");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/comboboxUtils.js");
+ javaScripts.add("prototype.js");
+ }
+
+
+ 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);
+
+ }
+
+ public void itemsTextAsJSArrayTest() {
+ String script = renderer.getItemsTextAsJSArray(facesContext, comboBox);
+ assertNotNull(script);
+ }
+
+ public void testRender(){
+
+ try {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ HtmlElement elem = page.getHtmlElementById(comboBox.getClientId(facesContext));
+ assertNotNull(elem);
+ assertEquals(elem.getTagName(), "div");
+ renderer.doEncodeEnd(writer, facesContext, comboBox);
+
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ renderer = null;
+ }
+
+
+
+ public ComboBoxRendererTest(String name) {
+ super(name);
+ }
+}
16 years, 12 months
JBoss Rich Faces SVN: r5437 - in trunk/samples/richfaces-demo/src/main: webapp/WEB-INF and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-01-16 13:57:55 -0500 (Wed, 16 Jan 2008)
New Revision: 5437
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
Log:
http://jira.jboss.com/jira/browse/RF-1758
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2008-01-16 18:57:13 UTC (rev 5436)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2008-01-16 18:57:55 UTC (rev 5437)
@@ -25,7 +25,7 @@
private static int DECIMALS = 1;
private static int ROUNDING_MODE = BigDecimal.ROUND_HALF_UP;
- private List <DemoInventoryItem> allCars = null;
+ private static List <DemoInventoryItem> allCars = null;
public List <DemoInventoryItem> getAllCars() {
synchronized (this) {
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-01-16 18:57:13 UTC (rev 5436)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-01-16 18:57:55 UTC (rev 5437)
@@ -73,7 +73,7 @@
<managed-bean>
<managed-bean-name>dataTableScrollerBean</managed-bean-name>
<managed-bean-class>org.richfaces.datatablescroller.DataTableScrollerBean</managed-bean-class>
- <managed-bean-scope>application</managed-bean-scope>
+ <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>toggleBean</managed-bean-name>
16 years, 12 months
JBoss Rich Faces SVN: r5436 - trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-16 13:57:13 -0500 (Wed, 16 Jan 2008)
New Revision: 5436
Removed:
trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/component/JSFComponentTest.java
Log:
Deleted: trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/component/JSFComponentTest.java
===================================================================
--- trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/component/JSFComponentTest.java 2008-01-16 18:55:44 UTC (rev 5435)
+++ trunk/sandbox/ui/combobox/src/test/java/org/richfaces/sandbox/ui/component/JSFComponentTest.java 2008-01-16 18:57:13 UTC (rev 5436)
@@ -1,53 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.sandbox.ui.component;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import javax.faces.component.UIComponent;
-
-/**
- * Unit test for simple Component.
- */
-public class JSFComponentTest
- extends TestCase
-{
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public JSFComponentTest( String testName )
- {
- super( testName );
- }
-
-
- /**
- * Rigourous Test :-)
- */
- public void testComponent()
- {
- assertTrue( true );
- }
-}
16 years, 12 months
JBoss Rich Faces SVN: r5435 - branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-01-16 13:55:44 -0500 (Wed, 16 Jan 2008)
New Revision: 5435
Modified:
branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
http://jira.jboss.com/jira/browse/RF-1456 - move all changes to branch.
Modified: branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-01-16 17:42:51 UTC (rev 5434)
+++ branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-01-16 18:55:44 UTC (rev 5435)
@@ -332,7 +332,7 @@
e = window.event;
}
//Event.stop(e);
- this.event = e;
+ this.event = Object.clone(e);
this.element = Event.element(e);
this.layer = $(layer);
this.show = function() {
16 years, 12 months