JBoss Rich Faces SVN: r20597 - in trunk/ui/output/ui/src: main/java/org/richfaces/renderkit/html and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-15 18:03:53 -0500 (Wed, 15 Dec 2010)
New Revision: 20597
Added:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanel.java
Removed:
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanel.java
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java
Log:
UIPanel refactoring & added missing attributes
Copied: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanel.java (from rev 20595, trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanel.java)
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanel.java (rev 0)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanel.java 2010-12-15 23:03:53 UTC (rev 20597)
@@ -0,0 +1,51 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
+
+/**
+ * JSF component class
+ *
+ */
+@JsfComponent(tag = @Tag(type = TagType.Facelets),
+ renderer = @JsfRenderer(type = "org.richfaces.PanelRenderer"),
+ attributes = {"core-props.xml", "events-props.xml"}
+)
+public abstract class AbstractPanel extends UIComponentBase {
+
+ private static final String COMPONENT_FAMILY = "org.richfaces.Panel";
+
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+}
Deleted: trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanel.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanel.java 2010-12-15 23:02:43 UTC (rev 20596)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanel.java 2010-12-15 23:03:53 UTC (rev 20597)
@@ -1,49 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import javax.faces.component.UIComponentBase;
-
-import org.richfaces.cdk.annotations.JsfComponent;
-import org.richfaces.cdk.annotations.JsfRenderer;
-import org.richfaces.cdk.annotations.Tag;
-import org.richfaces.cdk.annotations.TagType;
-
-/**
- * JSF component class
- *
- */
-@JsfComponent(tag = @Tag(type = TagType.Facelets),
- renderer = @JsfRenderer(type = "org.richfaces.PanelRenderer")
- )
-public class UIPanel extends UIComponentBase {
- private static final String COMPONENT_FAMILY = "org.richfaces.Panel";
-
- public boolean getRendersChildren() {
- return true;
- }
-
- @Override
- public String getFamily() {
- return COMPONENT_FAMILY;
- }
-}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java 2010-12-15 23:02:43 UTC (rev 20596)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java 2010-12-15 23:03:53 UTC (rev 20597)
@@ -21,7 +21,7 @@
package org.richfaces.renderkit.html;
-import org.richfaces.component.UIPanel;
+import org.richfaces.component.AbstractPanel;
import org.richfaces.renderkit.RendererBase;
import javax.faces.application.ResourceDependency;
@@ -46,6 +46,6 @@
@Override
protected Class<? extends UIComponent> getComponentClass() {
- return UIPanel.class;
+ return AbstractPanel.class;
}
}
Modified: trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java 2010-12-15 23:02:43 UTC (rev 20596)
+++ trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java 2010-12-15 23:03:53 UTC (rev 20597)
@@ -37,7 +37,7 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.richfaces.component.UIPanel;
+import org.richfaces.component.AbstractPanel;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
@@ -83,10 +83,10 @@
public final void testGetComponentClass() throws IOException {
FacesRequest facesRequest = startFacesRequest();
FacesContext facesContext = FacesContext.getCurrentInstance();
- UIPanel component = (UIPanel) facesContext.getViewRoot().findComponent("panelWithFacet");
+ AbstractPanel component = (AbstractPanel) facesContext.getViewRoot().findComponent("panelWithFacet");
PanelRenderer renderer = (PanelRenderer) FacesContext.getCurrentInstance()
.getRenderKit().getRenderer(component.getFamily(), component.getRendererType());
- assertEquals(UIPanel.class, renderer.getComponentClass());
+ assertEquals(AbstractPanel.class, renderer.getComponentClass());
facesRequest.release();
}
14 years
JBoss Rich Faces SVN: r20596 - trunk/examples/dnd-demo/src/main/java/org/demo.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-15 18:02:43 -0500 (Wed, 15 Dec 2010)
New Revision: 20596
Modified:
trunk/examples/dnd-demo/src/main/java/org/demo/DataBean.java
Log:
Fixed compilation error in dnd-demo
Modified: trunk/examples/dnd-demo/src/main/java/org/demo/DataBean.java
===================================================================
--- trunk/examples/dnd-demo/src/main/java/org/demo/DataBean.java 2010-12-15 22:07:06 UTC (rev 20595)
+++ trunk/examples/dnd-demo/src/main/java/org/demo/DataBean.java 2010-12-15 23:02:43 UTC (rev 20596)
@@ -54,7 +54,7 @@
}
public void processEvent(DropEvent event) {
- String value = (String)event.getDragSource().getDragValue();
+ String value = (String)event.getDragValue();
dropValues.add(value);
System.out.println("DataBean.processEvent()");
}
14 years
JBoss Rich Faces SVN: r20595 - trunk/core/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-15 17:07:06 -0500 (Wed, 15 Dec 2010)
New Revision: 20595
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
Removed unnecessary calls to jQuery.end() in richfaces.js
Modified: trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-12-15 19:30:32 UTC (rev 20594)
+++ trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-12-15 22:07:06 UTC (rev 20595)
@@ -350,7 +350,6 @@
var getJSONData = function(extensionElement, elementName) {
var dataString = jQuery.trim(extensionElement.children(elementName).text());
- extensionElement.end();
return richfaces.parseJSON(dataString);
};
@@ -463,7 +462,6 @@
var xml = getExtensionResponseElement(event.responseXML);
var serverHandler = createEventHandler(xml.children(event.type).text());
- xml.end();
if (clientHandler) {
clientHandler.call(window, event);
14 years
JBoss Rich Faces SVN: r20594 - trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-15 14:30:32 -0500 (Wed, 15 Dec 2010)
New Revision: 20594
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss
Log:
small fix
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss 2010-12-15 19:06:55 UTC (rev 20593)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss 2010-12-15 19:30:32 UTC (rev 20594)
@@ -78,9 +78,9 @@
.rf-insl-tt {
position: absolute;
display: none;
- /* TODO padding: 2px;
+ padding: 2px;
border: 1px solid '#{richSkin.tipBorderColor}';
- background-color: '#{richSkin.tipBackgroundColor}';*/
+ background-color: '#{richSkin.tipBackgroundColor}';
}
.rf-insl-trc {
14 years
JBoss Rich Faces SVN: r20593 - in trunk/ui/dnd: ui/src/main/java/org/richfaces/renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-12-15 14:06:55 -0500 (Wed, 15 Dec 2010)
New Revision: 20593
Modified:
trunk/ui/dnd/api/src/main/java/org/richfaces/event/DropEvent.java
trunk/ui/dnd/ui/src/main/java/org/richfaces/renderkit/DropBehaviorRendererBase.java
Log:
fix possible issue with drag drop columns in the dataTable
Modified: trunk/ui/dnd/api/src/main/java/org/richfaces/event/DropEvent.java
===================================================================
--- trunk/ui/dnd/api/src/main/java/org/richfaces/event/DropEvent.java 2010-12-15 17:57:11 UTC (rev 20592)
+++ trunk/ui/dnd/api/src/main/java/org/richfaces/event/DropEvent.java 2010-12-15 19:06:55 UTC (rev 20593)
@@ -37,23 +37,65 @@
private static final long serialVersionUID = 3717071628237886288L;
- private ClientDragBehavior dragSource;
+ private ClientDragBehavior dragBehavior;
private UIComponent dragComponent;
+ private ClientDropBehavior dropBehavior;
+
+ private UIComponent dropComponent;
+
+ private Object dropValue;
+
+ private Object dragValue;
+
public DropEvent(UIComponent component, ClientDropBehavior behavior) {
super(component, behavior);
+ this.dropComponent = component;
+ this.dropBehavior = behavior;
}
- public ClientDragBehavior getDragSource() {
- return dragSource;
+
+ public void setDropBehavior(ClientDropBehavior dropBehavior) {
+ this.dropBehavior = dropBehavior;
}
+
+ public ClientDropBehavior getDropBehavior() {
+ return this.dropBehavior;
+ }
+
+ public void setDropComponent(UIComponent dropComponent) {
+ this.dropComponent = dropComponent;
+ }
+
+ public UIComponent getDropComponent() {
+ return this.dropComponent;
+ }
+ public Object getDropValue() {
+ return dropValue;
+ }
- public void setDragSource(ClientDragBehavior dragSource) {
- this.dragSource = dragSource;
+ public void setDropValue(Object dropValue) {
+ this.dropValue = dropValue;
}
+ public Object getDragValue() {
+ return dragValue;
+ }
+
+ public void setDragValue(Object dragValue) {
+ this.dragValue = dragValue;
+ }
+
+ public ClientDragBehavior getDragBehavior() {
+ return dragBehavior;
+ }
+
+ public void setDragBehavior(ClientDragBehavior dragBehavior) {
+ this.dragBehavior = dragBehavior;
+ }
+
public UIComponent getDragComponent() {
return dragComponent;
}
@@ -61,16 +103,7 @@
public void setDragComponent(UIComponent dragComponent) {
this.dragComponent = dragComponent;
}
-
- public ClientDropBehavior getDropSource() {
- return (ClientDropBehavior)getBehavior();
- }
- public UIComponent getDropComponent() {
- return getComponent();
- }
-
-
@Override
public boolean isAppropriateListener(FacesListener listener) {
return (listener instanceof DropListener);
@@ -80,5 +113,4 @@
public void processListener(FacesListener listener) {
((DropListener) listener).processDrop(this);
}
-
}
\ No newline at end of file
Modified: trunk/ui/dnd/ui/src/main/java/org/richfaces/renderkit/DropBehaviorRendererBase.java
===================================================================
--- trunk/ui/dnd/ui/src/main/java/org/richfaces/renderkit/DropBehaviorRendererBase.java 2010-12-15 17:57:11 UTC (rev 20592)
+++ trunk/ui/dnd/ui/src/main/java/org/richfaces/renderkit/DropBehaviorRendererBase.java 2010-12-15 19:06:55 UTC (rev 20593)
@@ -76,7 +76,19 @@
Map<String, String> requestParamMap = facesContext.getExternalContext().getRequestParameterMap();
String dragSource = (String) requestParamMap.get("dragSource");
- facesContext.getViewRoot().invokeOnComponent(facesContext, dragSource, new DropBehaviorContextCallBack(component, (ClientDropBehavior)behavior));
+
+ DragBehaviorContextCallBack dragBehaviorContextCallBack = new DragBehaviorContextCallBack();
+ facesContext.getViewRoot().invokeOnComponent(facesContext, dragSource, dragBehaviorContextCallBack);
+
+ if(behavior instanceof ClientDropBehavior) {
+ ClientDropBehavior dropBehavior = (ClientDropBehavior)behavior;
+ DropEvent dropEvent = new DropEvent(component, dropBehavior);
+ dropEvent.setDropValue(dropBehavior.getDropValue());
+ dropEvent.setDragComponent(dragBehaviorContextCallBack.getDragComponent());
+ dropEvent.setDragBehavior(dragBehaviorContextCallBack.getDragBehavior());
+ dropEvent.setDragValue(dragBehaviorContextCallBack.getDragValue());
+ queueEvent(dropEvent);
+ }
}
@Override
@@ -91,67 +103,36 @@
ClientDropBehavior dropBehavior = (ClientDropBehavior)behavior;
options.put("acceptedTypes", dropBehavior.getAcceptedTypes());
}
-
return options;
}
- private final class DropBehaviorContextCallBack implements ContextCallback {
+ private final class DragBehaviorContextCallBack implements ContextCallback {
- private ClientDropBehavior dropBehavior;
+ private Object dragValue;
- private UIComponent dropSource;
+ private ClientDragBehavior dragBehavior;
- public DropBehaviorContextCallBack(UIComponent dropSource, ClientDropBehavior dropBehavior) {
- this.dropSource = dropSource;
- this.dropBehavior = dropBehavior;
- }
+ private UIComponent dragComponent;
public void invokeContextCallback(FacesContext context, UIComponent target) {
ClientDragBehavior dragBehavior = getDragBehavior(target, "mouseover");
- if(dragBehavior != null) {
- DropEvent dropEvent = new DropEvent(dropSource, dropBehavior);
- dropEvent.setDragSource(dragBehavior);
- dropEvent.setDragComponent(target);
- queueDropEvent(dropEvent);
- } else {
- //TODO: log
- }
+ this.dragValue = dragBehavior.getDragValue();
+ this.dragBehavior = dragBehavior;
+ this.dragComponent = target;
}
- private void queueDropEvent(DropEvent event) {
- PhaseId phaseId = PhaseId.INVOKE_APPLICATION;
-
- if (isImmediate()) {
- phaseId = PhaseId.APPLY_REQUEST_VALUES;
- } else if (isBypassUpdates()) {
- phaseId = PhaseId.PROCESS_VALIDATIONS;
- }
+ public Object getDragValue() {
+ return dragValue;
+ }
- event.setPhaseId(phaseId);
- this.dropSource.queueEvent(event);
+ public ClientDragBehavior getDragBehavior() {
+ return dragBehavior;
}
-
- private boolean isImmediate(){
- boolean immediate = this.dropBehavior.isImmediate();
- if(!immediate) {
- if (dropSource instanceof EditableValueHolder) {
- immediate = ((EditableValueHolder) dropSource).isImmediate();
- } else if (dropSource instanceof ActionSource) {
- immediate = ((ActionSource) dropSource).isImmediate();
- }
- }
-
- return immediate;
+
+ public UIComponent getDragComponent() {
+ return dragComponent;
}
- private boolean isBypassUpdates(){
- boolean bypassUpdates = this.dropBehavior.isBypassUpdates();
- if (!bypassUpdates) {
- bypassUpdates = getUtils().isBooleanAttribute(this.dropSource, "bypassUpdates");
- }
- return bypassUpdates;
- }
-
private ClientDragBehavior getDragBehavior(UIComponent parent, String event) {
if(parent instanceof ClientBehaviorHolder) {
Map<String, List<ClientBehavior>> behaviorsMap = ((ClientBehaviorHolder)parent).getClientBehaviors();
@@ -173,5 +154,43 @@
}
}
+
+ protected void queueEvent(DropEvent dropEvent){
+ UIComponent component = dropEvent.getComponent();
+ ClientDropBehavior dropBehavior = dropEvent.getDropBehavior();
+
+ if(component != null && dropBehavior != null) {
+ PhaseId phaseId = PhaseId.INVOKE_APPLICATION;
+ if (isImmediate(component, dropBehavior)) {
+ phaseId = PhaseId.APPLY_REQUEST_VALUES;
+ } else if (isBypassUpdates(component, dropBehavior)) {
+ phaseId = PhaseId.PROCESS_VALIDATIONS;
+ }
+
+ dropEvent.setPhaseId(phaseId);
+ component.queueEvent(dropEvent);
+ }
+ }
+
+ private boolean isImmediate(UIComponent component, ClientDropBehavior dropBehavior){
+ boolean immediate = dropBehavior.isImmediate();
+ if(!immediate) {
+ if (component instanceof EditableValueHolder) {
+ immediate = ((EditableValueHolder) component).isImmediate();
+ } else if (component instanceof ActionSource) {
+ immediate = ((ActionSource) component).isImmediate();
+ }
+ }
+ return immediate;
+ }
+
+ private boolean isBypassUpdates(UIComponent component, ClientDropBehavior dropBehavior){
+ boolean bypassUpdates = dropBehavior.isBypassUpdates();
+ if (!bypassUpdates) {
+ bypassUpdates = getUtils().isBooleanAttribute(component, "bypassUpdates");
+ }
+ return bypassUpdates;
+ }
+
}
14 years
JBoss Rich Faces SVN: r20592 - trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-15 12:57:11 -0500 (Wed, 15 Dec 2010)
New Revision: 20592
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js
Log:
RF-9900
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js 2010-12-15 17:32:52 UTC (rev 20591)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js 2010-12-15 17:57:11 UTC (rev 20592)
@@ -46,8 +46,11 @@
this.handle = this.track.children(".rf-insl-hnd, .rf-insl-hnd-dis");
this.tooltip = this.element.children(".rf-insl-tt");
- var proxy = jQuery.proxy(this.__inputHandler, this);
- jQuery(document).ready(proxy);
+ var value = Number(this.input.val());
+ if (isNaN(value)) {
+ value = this.minValue;
+ }
+ this.__setValue(value, null, true);
if (!this.disabled) {
this.decreaseButton = this.element.children(".rf-insl-dec");
@@ -58,6 +61,7 @@
for (var i in selectedClasses) {
this[i] += " " + selectedClasses[i];
}
+ var proxy = jQuery.proxy(this.__inputHandler, this);
this.input.change(proxy);
this.input.submit(proxy);
this.track.keydown(jQuery.proxy(this.__keydownHandler, this));
@@ -81,7 +85,7 @@
}
},
- __setValue: function (value, event) {
+ __setValue: function (value, event, skipOnchange) {
if (!isNaN(value)) {
value = Math.round(value / this.step) * this.step; //TODO Add normal support of float values. E.g. '0.3' should be instead of '0.30000000000000004'.
if (value > this.maxValue) {
@@ -94,9 +98,9 @@
var left = (value - this.minValue) * (this.track.width() - this.handle.width()) / this.range;
this.handle.css("margin-left", left + "px");
this.tooltip.text(value);
- this.tooltip.setPosition(this.handle,{from: 'LT', offset: [0, -3]}); //TODO Seems offset doesn't work now.
+ this.tooltip.setPosition(this.handle,{from: 'LT', offset: [0, 5]}); //TODO Seems offset doesn't work now.
this.value = value;
- if (this.onchange && (!event || event.type)) {
+ if (this.onchange && !skipOnchange) {
this.onchange.call(this.element[0], event);
}
}
@@ -174,6 +178,11 @@
this.handle.removeClass(this.handleSelectedClass);
this.tooltip.hide();
jQuery(document).unbind("mousemove", this.__mousemoveHandler);
+ },
+
+ destroy: function (event) {
+ jQuery(document).unbind("mousemove", this.__mousemoveHandler);
+ $super.destroy.call(this);
}
});
}(window.RichFaces, jQuery));
\ No newline at end of file
14 years
JBoss Rich Faces SVN: r20591 - in trunk/ui/iteration/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-12-15 12:32:52 -0500 (Wed, 15 Dec 2010)
New Revision: 20591
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.ecss
Log:
RF-9930, RF-9826
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java 2010-12-15 17:13:15 UTC (rev 20590)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java 2010-12-15 17:32:52 UTC (rev 20591)
@@ -109,7 +109,7 @@
public void encodeFirstRowStart(ResponseWriter writer, FacesContext context, String parentId, int currentRow, UIComponent component) throws IOException {
writer.startElement(HtmlConstants.TR_ELEMENT, component);
- String styleClass = getFirstRowClass(context, parentId);
+ String styleClass = concatClasses(getRowClass(context, parentId), getFirstRowClass(context, parentId));
encodeStyleClass(writer, context, component, HtmlConstants.STYLE_CLASS_ATTR, styleClass);
}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-12-15 17:13:15 UTC (rev 20590)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-12-15 17:32:52 UTC (rev 20591)
@@ -164,14 +164,17 @@
int columns = getColumnsCount(dataTableBase.columns());
writer.startElement(HtmlConstants.TR_ELEMENT, dataTableBase);
+ String styleClass = (String) dataTableBase.getAttributes().get("noDataStyleClass");
+ styleClass = concatClasses(getNoDataClass(), styleClass);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, styleClass, null);
+
writer.startElement(HtmlConstants.TD_ELEM, dataTableBase);
writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
- String styleClass = (String) dataTableBase.getAttributes().get("noDataStyleClass");
- styleClass = styleClass != null ? getNoDataClass() + " " + styleClass : getNoDataClass();
+ String cellStyleClass = (String) dataTableBase.getAttributes().get("noDataCellStyleClass");
+ cellStyleClass = concatClasses( getNoDataCellClass(), cellStyleClass);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, cellStyleClass, null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, styleClass, null);
-
UIComponent noDataFacet = dataTableBase.getNoData();
if (noDataFacet != null && noDataFacet.isRendered()) {
noDataFacet.encodeAll(facesContext);
@@ -244,7 +247,7 @@
String clientId = (dataTableBase.getRelativeRowIndex() < 0) ? dataTableBase.getClientId(facesContext) : dataTableBase.getRelativeClientId(facesContext);
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, clientId + ":tb", null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, getTableSkinClass(), null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, getTableBodySkinClass(), null);
encodeStyle(writer, facesContext, dataTableBase, null);
}
@@ -272,7 +275,7 @@
writer.startElement(HtmlConstants.TFOOT_ELEMENT, dataTable);
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, footerClientId, null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rd-dt-tfoot", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dt-tft", null);
}
int columns = getColumnsCount(dataTable);
@@ -369,7 +372,7 @@
writer.startElement(HtmlConstants.THEAD_ELEMENT, dataTable);
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, headerClientId, null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dt-thead", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-dt-thd", null);
}
int columns = getColumnsCount(dataTable);
@@ -538,6 +541,8 @@
public abstract String getTableSkinClass();
+ public abstract String getTableBodySkinClass();
+
public abstract String getFirstRowSkinClass();
public abstract String getRowSkinClass();
@@ -569,6 +574,8 @@
public abstract String getCellSkinClass();
public abstract String getNoDataClass();
+
+ public abstract String getNoDataCellClass();
protected abstract void setupTableStartElement(FacesContext context, UIComponent component);
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableRenderer.java 2010-12-15 17:13:15 UTC (rev 20590)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableRenderer.java 2010-12-15 17:32:52 UTC (rev 20591)
@@ -367,10 +367,21 @@
}
public String getNoDataClass() {
+ return "rf-cst-nd";
+ }
+
+ @Override
+ public String getNoDataCellClass() {
return "rf-cst-nd-c";
}
@Override
+ public String getTableBodySkinClass() {
+ // AbstractSubTable doesn't have tbody
+ return null;
+ }
+
+ @Override
public void encodeMetaComponent(FacesContext facesContext, UIComponent component, String metaComponentId)
throws IOException {
AbstractCollapsibleSubTable subTable = (AbstractCollapsibleSubTable)component;
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-12-15 17:13:15 UTC (rev 20590)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-12-15 17:32:52 UTC (rev 20591)
@@ -378,8 +378,18 @@
}
public String getNoDataClass() {
- return "rf-dt-ndt";
+ return "rf-dt-nd";
}
+
+ @Override
+ public String getNoDataCellClass() {
+ return "rf-dt-nd-c";
+ }
+
+ @Override
+ public String getTableBodySkinClass() {
+ return "rf-dt-b";
+ }
protected void setupTableStartElement(FacesContext context, UIComponent component) {
setupTableStartElement(context, component, HtmlConstants.TH_ELEM);
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.ecss
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.ecss 2010-12-15 17:13:15 UTC (rev 20590)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.ecss 2010-12-15 17:32:52 UTC (rev 20591)
@@ -32,7 +32,7 @@
padding:4px;
}
-.rf-dt-ndt{
+.rf-dt-nd{
border-bottom-width:'#{richSkin.tableBorderWidth}';
border-bottom-style:solid;
border-bottom-color:'#{richSkin.tableBorderColor}';
14 years
JBoss Rich Faces SVN: r20590 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richTree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-15 12:13:15 -0500 (Wed, 15 Dec 2010)
New Revision: 20590
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
Log:
rich:tree - added toggleNodeEvent attribute sample (RF-9730, RF-9827)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2010-12-15 17:12:33 UTC (rev 20589)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2010-12-15 17:13:15 UTC (rev 20590)
@@ -90,6 +90,7 @@
attributes.setAttribute("nodeClass", null);
attributes.setAttribute("execute", null);
attributes.setAttribute("render", null);
+ attributes.setAttribute("toggleNodeEvent", null);
// hidden attributes
attributes.remove("selectionChangeListener");
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 17:12:33 UTC (rev 20589)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 17:13:15 UTC (rev 20590)
@@ -89,6 +89,7 @@
toggleListener="#{richTreeListenerBean.processToggle}"
render="#{richTreeBean.attributes['render'].value}"
execute="#{richTreeBean.attributes['execute'].value}"
+ toggleNodeEvent="#{richTreeBean.attributes['toggleNodeEvent'].value}"
>
<rich:treeNode type="country"
@@ -188,6 +189,7 @@
toggleListener="#{richTreeListenerBean.processToggle}"
render="#{richTreeBean.attributes['render'].value}"
execute="#{richTreeBean.attributes['execute'].value}"
+ toggleNodeEvent="#{richTreeBean.attributes['toggleNodeEvent'].value}"
>
</rich:tree>
</p>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-15 17:12:33 UTC (rev 20589)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-15 17:13:15 UTC (rev 20590)
@@ -84,6 +84,7 @@
toggleListener="#{richTreeListenerBean.processToggle}"
render="#{richTreeBean.attributes['render'].value}"
execute="#{richTreeBean.attributes['execute'].value}"
+ toggleNodeEvent="#{richTreeBean.attributes['toggleNodeEvent'].value}"
>
<rich:treeModelRecursiveAdaptor
14 years
JBoss Rich Faces SVN: r20589 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richTree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-15 12:12:33 -0500 (Wed, 15 Dec 2010)
New Revision: 20589
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
Log:
rich:tree - sample supporting execute/render (RF-9719, RF-9827)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2010-12-15 17:11:51 UTC (rev 20588)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2010-12-15 17:12:33 UTC (rev 20589)
@@ -88,6 +88,8 @@
attributes.setAttribute("iconClass", null);
attributes.setAttribute("labelClass", null);
attributes.setAttribute("nodeClass", null);
+ attributes.setAttribute("execute", null);
+ attributes.setAttribute("render", null);
// hidden attributes
attributes.remove("selectionChangeListener");
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 17:11:51 UTC (rev 20588)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 17:12:33 UTC (rev 20589)
@@ -87,7 +87,8 @@
nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
toggleListener="#{richTreeListenerBean.processToggle}"
- render="@this treeInfo"
+ render="#{richTreeBean.attributes['render'].value}"
+ execute="#{richTreeBean.attributes['execute'].value}"
>
<rich:treeNode type="country"
@@ -185,6 +186,8 @@
nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
toggleListener="#{richTreeListenerBean.processToggle}"
+ render="#{richTreeBean.attributes['render'].value}"
+ execute="#{richTreeBean.attributes['execute'].value}"
>
</rich:tree>
</p>
@@ -193,7 +196,7 @@
<ui:define name="outOfTemplateAfter">
- <a4j:outputPanel id="treeInfo">
+ <a4j:outputPanel ajaxRendered="true">
<h:panelGrid columns="2">
<h:outputLabel value="Test Loading Facet:" />
<h:selectBooleanCheckbox value="#{richTreeBean.testLoadingFacet}">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-15 17:11:51 UTC (rev 20588)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-15 17:12:33 UTC (rev 20589)
@@ -27,6 +27,7 @@
-->
<ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richTree" />
<ui:define name="head">
<f:metadata>
@@ -80,8 +81,10 @@
labelClass="#{richTreeBean.attributes['labelClass'].value}"
nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
- toggleListener="#{richTreeListenerBean.processToggle}">
- >
+ toggleListener="#{richTreeListenerBean.processToggle}"
+ render="#{richTreeBean.attributes['render'].value}"
+ execute="#{richTreeBean.attributes['execute'].value}"
+ >
<rich:treeModelRecursiveAdaptor
roots="#{richTreeModelRecursiveAdaptorBean.rootNodes}"
14 years
JBoss Rich Faces SVN: r20588 - in modules/tests/metamer/trunk/application/src/main: webapp/templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-15 12:11:51 -0500 (Wed, 15 Dec 2010)
New Revision: 20588
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
modules/tests/metamer/trunk/application/src/main/webapp/templates/template.xhtml
Log:
added executeChecker as component logging the execution when execute of some other component is set with executeChecker's id
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-12-15 17:11:08 UTC (rev 20587)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-12-15 17:11:51 UTC (rev 20588)
@@ -410,4 +410,12 @@
public void valueChangeListener(ValueChangeEvent event) {
logToPage("* value changed: " + event.getOldValue() + " -> " + event.getNewValue());
}
+
+ public boolean getExecuteChecker() {
+ return true;
+ }
+
+ public void setExecuteChecker(boolean executeChecker) {
+ logToPage("* executeChecker");
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/templates/template.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/templates/template.xhtml 2010-12-15 17:11:08 UTC (rev 20587)
+++ modules/tests/metamer/trunk/application/src/main/webapp/templates/template.xhtml 2010-12-15 17:11:51 UTC (rev 20588)
@@ -38,6 +38,8 @@
</h:head>
<h:body>
+ <h:selectBooleanCheckbox id="executeChecker" value="#{richBean.executeChecker}" style="display: none" />
+
<div class="header"><ui:decorate template="/templates/header.xhtml" /></div>
<div class="content">
14 years