JBoss Rich Faces SVN: r897 - trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:11:04 -0400 (Mon, 28 May 2007)
New Revision: 897
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-05-28 18:10:54 UTC (rev 896)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-05-28 18:11:04 UTC (rev 897)
@@ -325,15 +325,19 @@
public String onSortAjaxUpdate(FacesContext context, UIScrollableGrid grid){
- JSReference index = new JSReference("index");
- JSReference order = new JSReference("order");
+ JSReference sortColumn = new JSReference("sortEvent.column");
+ JSReference sortOrder = new JSReference("sortEvent.order");
+ JSReference sortStartRow = new JSReference("sortEvent.startRow");
+ JSReference sortIndex = new JSReference("sortEvent.index");
+
Map options = AjaxRendererUtils.buildEventOptions(context, grid);
Map parametersMap = (Map)options.get("parameters");
String id = grid.getClientId(context);
- parametersMap.put(id + ":index", index);
- parametersMap.put(id + ":order", order);
-
+ parametersMap.put(id + ":sortColumn", sortColumn);
+ parametersMap.put(id + ":sortOrder", sortOrder);
+ parametersMap.put(id + ":sortStartRow", sortStartRow);
+ parametersMap.put(id + ":sortIndex", sortIndex);
options.put("parameters", parametersMap);
JSFunction function = AjaxRendererUtils.buildAjaxFunction(grid, context);
@@ -355,15 +359,22 @@
Map parameters = externalContext.getRequestParameterMap();
- if(parameters.containsKey(clientId + ":order") && parameters.containsKey(clientId + ":index")){
+ if(parameters.containsKey(clientId + ":sortColumn") &&
+ parameters.containsKey(clientId + ":sortStartRow") &&
+ parameters.containsKey(clientId + ":sortIndex") &&
+ parameters.containsKey(clientId + ":sortOrder")){
- boolean isAsc = false;
- String order = (String)parameters.get(clientId + ":order");
- int index = Integer.parseInt((String)parameters.get(clientId + ":index"));
- if(order.equals("asc")){
- isAsc = true;
+ int sortColumn = Integer.parseInt((String)parameters.get(clientId + ":sortColumn"));
+ int sortStartRow = Integer.parseInt((String)parameters.get(clientId + ":sortStartRow"));
+ int sortIndex = Integer.parseInt((String)parameters.get(clientId + ":sortIndex"));
+ String sortOrder = (String)parameters.get(clientId + ":sortOrder");
+
+ boolean asc = true;
+ if(!sortOrder.equals("asc")){
+ asc = false;
}
- SortEvent sortEvent = new SortEvent(grid,index, isAsc);
+
+ SortEvent sortEvent = new SortEvent(grid,sortColumn, sortStartRow, sortIndex, asc );
grid.queueEvent(sortEvent);
}
@@ -397,13 +408,14 @@
grid.setDataIndex(new Integer(0));
grid.setStartRow(new Integer(grid.getFirst()));
}
+
System.out.println("");
System.out.println("row count: " + grid.getRow_count());
System.out.println("data index: " + grid.getDataIndex());
System.out.println("start row: " + grid.getStartRow());
}
-
+
public void renderAjaxChildren(FacesContext context, UIComponent component)throws IOException{
UIScrollableGrid grid = (UIScrollableGrid)component;
@@ -411,7 +423,8 @@
grid.setFirst(grid.getDataIndex().intValue());
int old = grid.getRows();
state.setLoadedRowsCount(old);
- grid.setRows(grid.getRow_count().intValue() + 1);
+ grid.setRows(grid.getRow_count().intValue());
+// grid.setRows(grid.getRow_count().intValue() + 1);
int start_row = grid.getStartRow().intValue();
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
17 years, 7 months
JBoss Rich Faces SVN: r896 - trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:10:54 -0400 (Mon, 28 May 2007)
New Revision: 896
Added:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/DataCash.js
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader2.js
Log:
Added: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/DataCash.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/DataCash.js (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/DataCash.js 2007-05-28 18:10:54 UTC (rev 896)
@@ -0,0 +1,29 @@
+/*
+ * TODO: Copyright (c) 2007 Denis Morozov <dmorozov(a)exadel.com>
+ *
+ * ...
+ */
+ClientUILib.declarePackage("ClientUI.controls.grid.DataCash");
+
+/*
+ * DataCash.js - Implements client side data cashing
+ * by Denis Morozov <dmorozov(a)exadel.com> distributed under the BSD license.
+ *
+ */
+ClientUI.controls.grid.DataCash = Class.create({
+ CLASSDEF: {
+ name: 'ClientUI.controls.grid.DataCash'
+ },
+
+ PKG_SIZE: 20
+});
+
+Object.extend(ClientUI.controls.grid.DataCash.prototype, {
+ initialize: function(cashSize) {
+ var count = cashSize/PKG_SIZE + 1;
+ this.cash = new Array(count);
+ for(var i=0; i<count; i++) {
+ this.cash[i] = new Array(PKG_SIZE);
+ }
+ }
+});
\ No newline at end of file
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader2.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader2.js 2007-05-28 18:10:45 UTC (rev 895)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader2.js 2007-05-28 18:10:54 UTC (rev 896)
@@ -153,7 +153,7 @@
columns[i].object = new ClientUI.common.box.InlineBox(cell, null, true);
columns[i].sortDesc = document.getElementsByClassName("sort-desc", cell)[0];
columns[i].sortAsc = document.getElementsByClassName("sort-asc", cell)[0];
- if(ClientUILib.isIE) {
+ if(ClientUILib.isIE && columns[i].sortDesc) {
Element.setStyle(columns[i].sortDesc, {left: "-10px"});
Element.setStyle(columns[i].sortAsc, {left: "-10px"});
}
@@ -185,13 +185,14 @@
columns[i].object = new ClientUI.common.box.InlineBox(cell, null, true);
columns[i].sortDesc = document.getElementsByClassName("sort-desc", cell)[0];
columns[i].sortAsc = document.getElementsByClassName("sort-asc", cell)[0];
- if(ClientUILib.isIE) {
+ if(ClientUILib.isIE && columns[i].sortDesc) {
Element.setStyle(columns[i].sortDesc, {left: "-10px"});
Element.setStyle(columns[i].sortAsc, {left: "-10px"});
}
i++;
});
+ columns.pop(); // remove last fake column
this._columns = columns;
this.defaultHeight = defaultHeight;
this.defaultWidth = defaultWidth;
@@ -343,9 +344,9 @@
if(el) {
var index = parseInt(el.getAttribute("columnIndex"));
if(index>=0) {
- var order = this.getColumns()[index].sorted;
- order = (order == "asc") ? "desc" : "asc";
- this.getColumns()[index].sorted = order;
+ var dir = this.getColumns()[index].sorted;
+ dir = (dir == "asc") ? "desc" : "asc";
+ this.getColumns()[index].sorted = dir;
for(var i = 0, len = this.getColumns().length; i < len; i++) {
var h = this.getColumns()[i];
@@ -353,12 +354,17 @@
Element.setStyle(h.sortDesc, {display: 'none'});
Element.setStyle(h.sortAsc, {display: 'none'});
} else{
- Element.setStyle(h.sortDesc, {display: (order == 'desc' ? 'block' : 'none')});
- Element.setStyle(h.sortAsc, {display: (order == 'asc' ? 'block' : 'none')});
+ Element.setStyle(h.sortDesc, {display: (dir == 'desc' ? 'block' : 'none')});
+ Element.setStyle(h.sortAsc, {display: (dir == 'asc' ? 'block' : 'none')});
}
}
- this.grid.eventOnSort.fire(index, order);
+ this.grid.eventOnSort.fire({
+ column: index,
+ order: dir,
+ startRow: this.grid.getBody().templFrozen.getElement().rows[0].index,
+ index: this.grid.getBody().currRange.start
+ });
Event.stop(event);
}
}
17 years, 7 months
JBoss Rich Faces SVN: r895 - trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:10:45 -0400 (Mon, 28 May 2007)
New Revision: 895
Modified:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx 2007-05-28 16:23:13 UTC (rev 894)
+++ trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx 2007-05-28 18:10:45 UTC (rev 895)
@@ -11,7 +11,7 @@
component="javax.faces.component.UIComponent"
>
- <td class="ClientUI_Grid_HC" id="#{client_id}:hc_#{cell_index}" columnIndex="#{cell_index}">
+ <td class="ClientUI_Grid_HC" id="#{client_id}:hc_#{cell_index}" columnIndex="#{cell_index}" sortable="#{component.attributes['sortable']}">
<span style="width: #{component.attributes['width']}" id="#{client_id}:hcc_#{cell_index}" class="ClientUI_Grid_HCBody1">
<span id="#{clientId}:hcb_#{cell_index}" class="ClientUI_Grid_HCBody">
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
Modified: trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-05-28 16:23:13 UTC (rev 894)
+++ trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-05-28 18:10:45 UTC (rev 895)
@@ -206,8 +206,8 @@
var rows_count = $(clientId + "_rows_input").value;
var columns_count = '#{columns_count}';
- function onSorted(index, order) {
- alert("onSorted column: " + index + " by order: " + order);
+ function onSorted(sortEvent) {
+ alert("onSorted column: " + sortEvent.column + " by order: " + sortEvent.order + ", row:" + sortEvent.startRow + ", index:" + sortEvent.index);
var event = null;
#{this:onSortAjaxUpdate(context,component)}
}
17 years, 7 months
JBoss Rich Faces SVN: r894 - in trunk/richfaces/panelmenu/src/main: java/org/richfaces/component/panelmenu and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-05-28 12:23:13 -0400 (Mon, 28 May 2007)
New Revision: 894
Modified:
trunk/richfaces/panelmenu/src/main/config/component/panelMenu.xml
trunk/richfaces/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java
Log:
Use UIInput as a base class for UIPanelMenuGroup
Modified: trunk/richfaces/panelmenu/src/main/config/component/panelMenu.xml
===================================================================
--- trunk/richfaces/panelmenu/src/main/config/component/panelMenu.xml 2007-05-28 15:36:06 UTC (rev 893)
+++ trunk/richfaces/panelmenu/src/main/config/component/panelMenu.xml 2007-05-28 16:23:13 UTC (rev 894)
@@ -329,17 +329,17 @@
</description>
<defaultvalue>false</defaultvalue>
</property>
- <property>
+ <!--property>
<name>value</name>
<classname>java.lang.Object</classname>
<description>Defines representation text for menuItem.</description>
- </property>
+ </property-->
&listeners;
- <property>
+ <!--property>
<name>action</name>
<classname>java.lang.String</classname>
<description>The action method binding expression.</description>
- </property>
+ </property-->
<property>
<name>target</name>
<classname>java.lang.String</classname>
Modified: trunk/richfaces/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java
===================================================================
--- trunk/richfaces/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java 2007-05-28 15:36:06 UTC (rev 893)
+++ trunk/richfaces/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java 2007-05-28 16:23:13 UTC (rev 894)
@@ -1,74 +1,137 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - 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.component.panelmenu;
-
-import javax.faces.component.UICommand;
-
-import org.richfaces.component.UISwitchablePanel;
-
-public abstract class UIPanelMenuGroup extends UICommand {
-
- public static final String COMPONENT_TYPE = "org.richfaces.panelMenuGroup";
-
- public abstract String getStyleClass();
-
- public abstract void setStyleClass(String styleClass);
-
- public abstract String getMode();
- public abstract void setMode(String mode);
- public abstract String getIconExpanded();
- public abstract void setIconExpanded(String expanded);
-
- public abstract boolean isExpanded();
- public abstract void setExpanded(boolean expanded);
-
- public abstract String getIconCollapsed();
- public abstract void setIconCollapsed(String iconCollapsed);
- public abstract String getIconDisabled();
- public abstract void setIconDisabled(String iconDisabled);
- public abstract boolean isDisabled();
- public abstract void setDisabled(boolean disabled);
- public abstract Object getValue();
- public abstract void setValue(Object value);
- public abstract String getTarget();
- public abstract void setTarget(String target);
- public abstract String getHoverClass();
- public abstract void setHoverClass(String hoverClass);
- public abstract String getHoverStyle();
- public abstract void setHoverStyle(String hoverStyle);
- public abstract String getDisabledClass();
- public abstract void setDisabledClass(String disabledClass);
- public abstract String getDisabledStyle();
- public abstract void setDisabledStyle(String disabledStyle);
- public abstract String getStyle();
- public abstract void setStyle(String style);
- public abstract String getIconClass();
- public abstract void setIconClass(String iconClass);
- public abstract String getIconStyle();
- public abstract void setIconStyle(String iconStyle);
- public abstract String getOncollapse();
- public abstract void setOncollapse(String ongroupcollapse);
- public abstract String getOnexpand();
- public abstract void setOnexpand(String ongroupexpand);
-
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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.component.panelmenu;
+
+import javax.faces.component.ActionSource;
+import javax.faces.component.UICommand;
+import javax.faces.component.UIInput;
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.ActionListener;
+
+import org.richfaces.component.UISwitchablePanel;
+
+public abstract class UIPanelMenuGroup extends UIInput implements ActionSource{
+
+ public static final String COMPONENT_TYPE = "org.richfaces.panelMenuGroup";
+
+ private MethodBinding actionListener = null;
+ private MethodBinding action = null;
+
+ public abstract String getStyleClass();
+ public abstract void setStyleClass(String styleClass);
+
+ public abstract String getMode();
+ public abstract void setMode(String mode);
+ public abstract String getIconExpanded();
+ public abstract void setIconExpanded(String expanded);
+
+ public abstract boolean isExpanded();
+ public abstract void setExpanded(boolean expanded);
+
+ public abstract String getIconCollapsed();
+ public abstract void setIconCollapsed(String iconCollapsed);
+ public abstract String getIconDisabled();
+ public abstract void setIconDisabled(String iconDisabled);
+ public abstract boolean isDisabled();
+ public abstract void setDisabled(boolean disabled);
+ public abstract Object getValue();
+ public abstract void setValue(Object value);
+ public abstract String getTarget();
+ public abstract void setTarget(String target);
+ public abstract String getHoverClass();
+ public abstract void setHoverClass(String hoverClass);
+ public abstract String getHoverStyle();
+ public abstract void setHoverStyle(String hoverStyle);
+ public abstract String getDisabledClass();
+ public abstract void setDisabledClass(String disabledClass);
+ public abstract String getDisabledStyle();
+ public abstract void setDisabledStyle(String disabledStyle);
+ public abstract String getStyle();
+ public abstract void setStyle(String style);
+ public abstract String getIconClass();
+ public abstract void setIconClass(String iconClass);
+ public abstract String getIconStyle();
+ public abstract void setIconStyle(String iconStyle);
+ public abstract String getOncollapse();
+ public abstract void setOncollapse(String ongroupcollapse);
+ public abstract String getOnexpand();
+ public abstract void setOnexpand(String ongroupexpand);
+
+
+ public void addActionListener(ActionListener listener) {
+ // TODO Auto-generated method stub
+ addFacesListener(listener);
+ }
+
+ public MethodBinding getAction() {
+ // TODO Auto-generated method stub
+ return action;
+ }
+
+ public MethodBinding getActionListener() {
+ // TODO Auto-generated method stub
+ return (this.actionListener);
+ }
+
+ public ActionListener[] getActionListeners() {
+ // TODO Auto-generated method stub
+ ActionListener al[] = (ActionListener [])
+ getFacesListeners(ActionListener.class);
+ return (al);
+
+ }
+
+ public void removeActionListener(ActionListener listener) {
+ // TODO Auto-generated method stub
+ removeFacesListener(listener);
+ }
+
+ public void setAction(MethodBinding action) {
+ // TODO Auto-generated method stub
+ this.action = action;
+ }
+
+
+ public void setActionListener(MethodBinding actionListener) {
+ // TODO Auto-generated method stub
+ this.actionListener = actionListener;
+ }
+ public void restoreState(FacesContext context, Object state) {
+ Object values[] = (Object[]) state;
+ super.restoreState(context, values[0]);
+ action = (MethodBinding) restoreAttachedState(context, values[1]);
+ actionListener = (MethodBinding) restoreAttachedState(context,
+ values[2]);
+ }
+
+
+ public Object saveState(FacesContext context) {
+ Object values[] = new Object[3];
+ values[0] = super.saveState(context);
+ values[1] = saveAttachedState(context, action);
+ values[2] = saveAttachedState(context, actionListener);
+ return values;
+ }
+
+
+}
17 years, 7 months
JBoss Rich Faces SVN: r893 - in trunk/richfaces/panelmenu/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-05-28 11:36:06 -0400 (Mon, 28 May 2007)
New Revision: 893
Modified:
trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java
trunk/richfaces/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
Log:
Panel menu: fix expand/collapse behaviour for groups containing disabled elements.
Modified: trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java
===================================================================
--- trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java 2007-05-28 14:20:48 UTC (rev 892)
+++ trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java 2007-05-28 15:36:06 UTC (rev 893)
@@ -78,7 +78,7 @@
for (Iterator iter = flatList.iterator(); iter.hasNext();) {
UIComponent child = (UIComponent) iter.next();
if ((child instanceof UIPanelMenuItem)||(child instanceof UIPanelMenuGroup)) {
- Object childDisabled = child.getAttributes().get("disabled");
+ boolean childDisabled = child instanceof UIPanelMenuGroup ? ((UIPanelMenuGroup)child).isDisabled() : ((UIPanelMenuItem)child).isDisabled();
boolean childRendered = child instanceof UIPanelMenuGroup ? ((UIPanelMenuGroup)child).isRendered() : ((UIPanelMenuItem)child).isRendered();
boolean parentRendered = true;
if (! (child.getParent() instanceof UIPanelMenu))
@@ -121,8 +121,7 @@
if (childRendered && parentRendered){
- if ( ( childDisabled==null || !childDisabled.toString().equals("true") ) &&
- !isParentDisabled(child)){
+ if ( !isParentDisabled(child) ){
buffer
.append("new PanelMenuItem({myId:'")
.append((String) child.getClientId(context))
@@ -133,6 +132,8 @@
.append(",event:\"" + event + "\"")
.append(",mode:\"" + mode + "\"")
.append(",target:\"" + targetString + "\"")
+ .append(",disabled:" +
+ new Boolean(childDisabled).toString())
.append("},{");
Modified: trunk/richfaces/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
===================================================================
--- trunk/richfaces/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2007-05-28 14:20:48 UTC (rev 892)
+++ trunk/richfaces/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2007-05-28 15:36:06 UTC (rev 893)
@@ -7,15 +7,21 @@
}
var PanelMenuStorage = new Object();
+
PanelMenu = Class.create();
+
PanelMenu.prototype = {
initialize: function(myId,so){
this.childObj = new Array();
this.expandSingle = so;
this.lastExpanded = null;
this.is = 'panelMenu';
- PanelMenuStorage[myId] = this;}};
+ PanelMenuStorage[myId] = this;
+ }
+};
+
PanelMenuItem = Class.create();
+
PanelMenuItem.prototype = {
initialize: function(ids, options, hoveredStyles, hoveredClasses, level, haveDynamicIcon, action, opened, ajaxFunction, iconAlign, iconExpanded, iconCollapsed, iconSpacer){
if (!ids.parentId){return};
@@ -23,6 +29,7 @@
this.onopen = options.onopen;
this.onclose = options.onclose;
this.event = options.event;
+ this.disabled = options.disabled;
this.mode = options.mode;
if (!this.mode)
@@ -92,64 +99,70 @@
},
collapse: function(){
- if (this.expanded){
- if (this._getDirectChildrenByTag(this.content,"INPUT")[0]!=null){
- this._getDirectChildrenByTag(this.content,"INPUT")[0].value="closed";}
- for (var i = 0; i < this.childObj.length; i++){
- if (this.childObj[i]._getDirectChildrenByTag(this.childObj[i].content,"INPUT")[0]!=null){
- this.childObj[i]._getDirectChildrenByTag(this.childObj[i].content,"INPUT")[0].value="";}
- if (this.haveDynamicIcon){
- var img = null
- if (this.iconAlign=="right"){
- img = this._getDirectChildrenByTag(this.iconswitcher.nextSibling,"IMG")[0];
- } else {
- img = this._getDirectChildrenByTag(this.iconswitcher.previousSibling,"IMG")[0];
- }
- if (img!=null){
- if (this.iconCollapsed!="none"){
- if (this.iconCollapsed!=null) {
- img.src = this.iconCollapsed;
- } else {
- img.src = this.iconSpacer;
+ if (!this.disabled) {
+ if (this.expanded){
+ if (this._getDirectChildrenByTag(this.content,"INPUT")[0]!=null){
+ this._getDirectChildrenByTag(this.content,"INPUT")[0].value="closed";}
+ for (var i = 0; i < this.childObj.length; i++){
+ if (this.childObj[i]._getDirectChildrenByTag(this.childObj[i].content,"INPUT")[0]!=null){
+ this.childObj[i]._getDirectChildrenByTag(this.childObj[i].content,"INPUT")[0].value="";}
+ if (this.haveDynamicIcon){
+ var img = null
+ if (this.iconAlign=="right"){
+ img = this._getDirectChildrenByTag(this.iconswitcher.nextSibling,"IMG")[0];
+ } else {
+ img = this._getDirectChildrenByTag(this.iconswitcher.previousSibling,"IMG")[0];
+ }
+ if (img!=null){
+ if (this.iconCollapsed!="none"){
+ if (this.iconCollapsed!=null) {
+ img.src = this.iconCollapsed;
+ } else {
+ img.src = this.iconSpacer;
+ }
}
}
- }
+ }
+ this.childObj[i].collapse();
+ this.childObj[i].hide();
+ this.childObj[i].tdhider.style.display="none";
+ this.childObj[i].tablehider.style.display="none";
}
- this.childObj[i].collapse();
- this.childObj[i].hide();
- this.childObj[i].tdhider.style.display="none";
- this.childObj[i].tablehider.style.display="none";
}
+ this.expanded = false;
}
- this.expanded = false;
},
+
hide: function(){
this.obj.style.display = 'none';
this.inputState.value="closed";
},
+
expand: function(){
- if (!this.expanded){
- if (this._getDirectChildrenByTag(this.content,"INPUT")[0]!=null){
- this.inputState.value="opened";
- }
- if (this.haveDynamicIcon){
- var img = null
- if (this.iconAlign=="right"){
- img = this._getDirectChildrenByTag(this.iconswitcher.nextSibling,"IMG")[0];
- } else {
- img = this._getDirectChildrenByTag(this.iconswitcher.previousSibling,"IMG")[0];
+ if (!this.disabled) {
+ if (!this.expanded) {
+ if (this._getDirectChildrenByTag(this.content,"INPUT")[0]!=null){
+ this.inputState.value="opened";
}
- if (img!=null){
- if (this.iconExpanded!="none"){
- if (this.iconExpanded!=null) {
- img.src = this.iconExpanded;
- } else {
- img.src = this.iconSpacer;}}}}
- for (var i = 0; i < this.childObj.length; i++){
- this.childObj[i].show();
+ if (this.haveDynamicIcon){
+ var img = null
+ if (this.iconAlign=="right"){
+ img = this._getDirectChildrenByTag(this.iconswitcher.nextSibling,"IMG")[0];
+ } else {
+ img = this._getDirectChildrenByTag(this.iconswitcher.previousSibling,"IMG")[0];
+ }
+ if (img!=null){
+ if (this.iconExpanded!="none"){
+ if (this.iconExpanded!=null) {
+ img.src = this.iconExpanded;
+ } else {
+ img.src = this.iconSpacer;}}}}
+ for (var i = 0; i < this.childObj.length; i++){
+ this.childObj[i].show();
+ }
}
+ this.expanded = true;
}
- this.expanded = true;
},
show: function(){
@@ -160,11 +173,11 @@
this.obj.style.display = "";
},
- preTrigger:function(e){
+ preTrigger: function(e){
this.inputAction.setAttribute('value', this.obj.id);
},
- trigger:function(e){
+ trigger: function(e){
if ("none" == this.mode)
return;
if (this.action !="panelMenuItemAction"){
@@ -310,12 +323,14 @@
},
_attachBehaviors: function() {
- if (this.event)
- Event.observe(this.obj, this.event, this.itemClicked.bindAsEventListener(this), false);
- else
- Event.observe(this.obj, "click", this.itemClicked.bindAsEventListener(this), false);
- Event.observe(this.obj, "mouseover", this.addHoverStyles.bindAsEventListener(this), false);
- Event.observe(this.obj, "mouseout", this.removeHoverStyles.bindAsEventListener(this), false);
+ if (!this.disabled) {
+ if (this.event)
+ Event.observe(this.obj, this.event, this.itemClicked.bindAsEventListener(this), false);
+ else
+ Event.observe(this.obj, "click", this.itemClicked.bindAsEventListener(this), false);
+ Event.observe(this.obj, "mouseover", this.addHoverStyles.bindAsEventListener(this), false);
+ Event.observe(this.obj, "mouseout", this.removeHoverStyles.bindAsEventListener(this), false);
+ }
}
};
17 years, 7 months
JBoss Rich Faces SVN: r892 - trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-05-28 10:20:48 -0400 (Mon, 28 May 2007)
New Revision: 892
Modified:
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
RF-228 fixed
Modified: trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-05-28 12:54:30 UTC (rev 891)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-05-28 14:20:48 UTC (rev 892)
@@ -765,10 +765,10 @@
Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
}
- if(window.A4J && A4J.AJAX ){
+/* if(window.A4J && A4J.AJAX ){
var listener = new A4J.AJAX.Listener(this.rebind.bindAsEventListener(this));
A4J.AJAX.AddListener(listener);
- }
+ } */
},
17 years, 7 months
JBoss Rich Faces SVN: r891 - trunk/docs/userguide/en/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-05-28 08:54:30 -0400 (Mon, 28 May 2007)
New Revision: 891
Modified:
trunk/docs/userguide/en/modules/RFCtechreqs.xml
Log:
changed IE version
Modified: trunk/docs/userguide/en/modules/RFCtechreqs.xml
===================================================================
--- trunk/docs/userguide/en/modules/RFCtechreqs.xml 2007-05-28 12:21:04 UTC (rev 890)
+++ trunk/docs/userguide/en/modules/RFCtechreqs.xml 2007-05-28 12:54:30 UTC (rev 891)
@@ -127,7 +127,7 @@
<title>Supported Browsers</title>
<itemizedlist>
- <listitem>Internet Explorer 5.0 - 7.0</listitem>
+ <listitem>Internet Explorer 5.5 - 7.0</listitem>
<listitem>Firefox 1.5 - 2.0</listitem>
17 years, 7 months
JBoss Rich Faces SVN: r890 - trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-05-28 08:21:04 -0400 (Mon, 28 May 2007)
New Revision: 890
Modified:
trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
http://jira.jboss.com/jira/browse/RF-235
Modified: trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-05-28 11:41:31 UTC (rev 889)
+++ trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-05-28 12:21:04 UTC (rev 890)
@@ -139,6 +139,7 @@
show: function() {
if ("SAFARI" == RichFaces.navigatorType()) {
this.wasScroll = false;
+ this.wasBlur = false;
if (!this.overflow)
this.overflow = document.getElementsByClassName("dr-sb-overflow", this.update)[0];
Event.observe(this.overflow, "scroll", this.onScrollListener);
@@ -160,6 +161,8 @@
if (Element.getStyle(this.update, 'display')
!= 'none') this.options.onHide(this.element, this.update, this.options);
this.enableSubmit();
+ this.hasFocus = false;
+ this.active = false;
},
startIndicator: function() {
@@ -199,6 +202,7 @@
}
if (this.active) {
this.wasScroll = false;
+ this.wasBlur = false;
switch (event.keyCode) {
case Event.KEY_TAB:
case Event.KEY_RETURN:
@@ -293,6 +297,7 @@
onClick: function(event) {
this.wasScroll = false;
+ this.wasBlur = false;
var element = Event.findElement(event, 'TR');
this.index = element.autocompleteIndex;
this.selectEntry(event);
@@ -317,15 +322,15 @@
}
// needed to make click events working
setTimeout(this.hide.bind(this), 250);
- this.hasFocus = false;
- this.active = false;
+ this.wasBlur = true;
},
onScroll: function(event) {
- if ("SAFARI" == RichFaces.navigatorType()) {
+ if ("SAFARI" == RichFaces.navigatorType() && this.wasBlur ) {
if(this.element) {
this.element.focus();
this.wasScroll = true;
+ this.wasBlur = false;
}
}
},
@@ -554,8 +559,8 @@
if (this.onsubmitFunction && ! this.onsubmitFunction()) {
return;
- }
- if (this.oldValue != this.element.value && this.element.value.length > 0) {
+ }
+ if (this.oldValue != this.element.value && this.element.value.length > 0) {
A4J.AJAX.Submit(this.containerId, this.actionUrl, event, this.options);
}
return;
17 years, 7 months
JBoss Rich Faces SVN: r889 - trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-05-28 07:41:31 -0400 (Mon, 28 May 2007)
New Revision: 889
Modified:
trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java
Log:
Improper variable names fixed
Modified: trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java 2007-05-28 10:24:46 UTC (rev 888)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java 2007-05-28 11:41:31 UTC (rev 889)
@@ -121,17 +121,17 @@
draggable = (Draggable) target;
dropzone = (Dropzone) component;
- acceptedTypes = type;
- dragType = eventInfo.type;
+ acceptedTypes = eventInfo.type;
+ dragType = type;
} else {
draggable = (Draggable) component;
dropzone = (Dropzone) target;
- acceptedTypes = eventInfo.type;
- dragType = type;
+ acceptedTypes = type;
+ dragType = eventInfo.type;
}
- DnDValidator.validateAcceptTypes(facesContext, draggable, dropzone, acceptedTypes, dragType);
+ DnDValidator.validateAcceptTypes(facesContext, draggable, dropzone, dragType, acceptedTypes);
processEvent(target, facesContext, eventInfo.facesEvent, eventInfo.eventCallback,
type, value);
17 years, 7 months
JBoss Rich Faces SVN: r888 - trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-05-28 06:24:46 -0400 (Mon, 28 May 2007)
New Revision: 888
Modified:
trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java
trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuItemRenderer.java
trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-239
Modified: trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java
===================================================================
--- trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java 2007-05-25 15:59:38 UTC (rev 887)
+++ trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java 2007-05-28 10:24:46 UTC (rev 888)
@@ -116,15 +116,13 @@
}
int h = 16; //width(context);
- writer.startElement("img", component);
- writer.writeAttribute("src", source, null);
- writer.writeAttribute("alt","",null);
- writer.writeAttribute("vspace", "0", null);
- writer.writeAttribute("hspace", "0", null);
- writer.writeAttribute("style","display:block;",null);
- writer.writeAttribute("width", String.valueOf(h), null);
- writer.writeAttribute("height",String.valueOf(h), null);
- writer.endElement("img");
+ StringBuffer imageBuffer = new StringBuffer();
+ imageBuffer.append("<img src=\"" + source + "\" ");
+ imageBuffer.append("alt=\"\" vspace=\"0\" hspace=\"0\" ");
+ imageBuffer.append("style=\"display:block;\" ");
+ imageBuffer.append("width=\"" + String.valueOf(h) + "\" ");
+ imageBuffer.append("height=\"" + String.valueOf(h) + "\" />");
+ writer.write(imageBuffer.toString());
}
public String getFullStyleClass(FacesContext context, UIComponent component) {
Modified: trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuItemRenderer.java
===================================================================
--- trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuItemRenderer.java 2007-05-25 15:59:38 UTC (rev 887)
+++ trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuItemRenderer.java 2007-05-28 10:24:46 UTC (rev 888)
@@ -119,15 +119,13 @@
if (!iconType.equals("none")){
int h = 16; //width(context);
- writer.startElement("img",component);
- writer.writeAttribute("src",source,null);
- writer.writeAttribute("alt","",null);
- writer.writeAttribute("vspace","0",null);
- writer.writeAttribute("hspace","0",null);
- writer.writeAttribute("style","display:block;",null);
- writer.writeAttribute("width",String.valueOf(h),null);
- writer.writeAttribute("height",String.valueOf(h),null);
- writer.endElement("img");
+ StringBuffer imageBuffer = new StringBuffer();
+ imageBuffer.append("<img src=\"" + source + "\" ");
+ imageBuffer.append("alt=\"\" vspace=\"0\" hspace=\"0\" ");
+ imageBuffer.append("style=\"display:block;\" ");
+ imageBuffer.append("width=\"" + String.valueOf(h) + "\" ");
+ imageBuffer.append("height=\"" + String.valueOf(h) + "\" />");
+ writer.write(imageBuffer.toString());
}
}
Modified: trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java
===================================================================
--- trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java 2007-05-25 15:59:38 UTC (rev 887)
+++ trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java 2007-05-28 10:24:46 UTC (rev 888)
@@ -60,7 +60,7 @@
String src = getIconByType("custom",false,context,component);
int w = 16; //width(context);
for (int i=0;i<level;i++){
- buffer.append("<td><img src=\"" + src + "\" alt=\"\" hspace=\"0\" vspace=\"0\" height=\""+w+"\" width=\""+w+"\" style=\"display:block;\"></td>\n");
+ buffer.append("<td><img src=\"" + src + "\" alt=\"\" hspace=\"0\" vspace=\"0\" height=\""+w+"\" width=\""+w+"\" style=\"display:block;\" /></td>\n");
}
writer.write(buffer.toString());
}
17 years, 7 months