JBoss Rich Faces SVN: r21245 - 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: 2011-01-26 14:22:32 -0500 (Wed, 26 Jan 2011)
New Revision: 21245
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelItem.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelTitledItem.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelItemRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanelItem.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tab.js
Log:
https://issues.jboss.org/browse/RF-10211
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2011-01-26 19:04:15 UTC (rev 21244)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2011-01-26 19:22:32 UTC (rev 21245)
@@ -46,12 +46,19 @@
import org.richfaces.application.MessageFactory;
import org.richfaces.application.ServiceTracker;
import org.richfaces.appplication.FacesMessages;
-import org.richfaces.cdk.annotations.*;
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
import org.richfaces.component.util.MessageUtil;
import org.richfaces.event.ItemChangeEvent;
import org.richfaces.event.ItemChangeListener;
import org.richfaces.event.ItemChangeSource;
+import com.google.common.base.Strings;
+
/**
* @author akolonitsky
* @version 1.0
@@ -146,7 +153,13 @@
@Override
public void encodeBegin(FacesContext context) throws IOException {
- AbstractTogglePanelItem item = this.getItem(getActiveItem());
+ AbstractTogglePanelItem item = null;
+ String activeItem = getActiveItem();
+
+ if (!Strings.isNullOrEmpty(activeItem)) {
+ item = this.getItem(activeItem);
+ }
+
if (item == null || !item.isRendered()) {
List<AbstractTogglePanelItem> renderedItems = this.getRenderedItems();
if (!renderedItems.isEmpty()) {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelItem.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelItem.java 2011-01-26 19:04:15 UTC (rev 21244)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelItem.java 2011-01-26 19:22:32 UTC (rev 21245)
@@ -22,16 +22,13 @@
package org.richfaces.component;
-import org.richfaces.cdk.annotations.*;
-import org.richfaces.renderkit.html.TogglePanelItemRenderer;
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.event.PreRenderComponentEvent;
-import javax.faces.render.Renderer;
-import java.io.IOException;
-import java.util.Map;
-
/**
* @author akolonitsky
* @version 1.0
@@ -70,64 +67,6 @@
return getParentPanel().isActiveItem(this);
}
- @Override
- public Renderer getRenderer(FacesContext context) {
- return super.getRenderer(context);
- }
-
- @Override
- public void encodeAll(FacesContext context) throws IOException {
- if (isActive()) {
- super.encodeAll(context);
- } else {
- switch (getSwitchType()) {
- case client:
- hidePanelItem(this);
-
- super.encodeAll(context);
- break;
-
- case ajax:
- case server:
- this.encodePlaceHolderWithJs(context);
- break;
-
- default:
- throw new IllegalStateException("Unknown switch type : " + getSwitchType());
- }
- }
- }
-
- public void encodePlaceHolderWithJs(FacesContext context) throws IOException {
- if (context == null) {
- throw new IllegalArgumentException();
- }
-
- if (!isRendered()) {
- return;
- }
-
- pushComponentToEL(context, null);
-
- context.getApplication().publishEvent(context, PreRenderComponentEvent.class, this);
-
- if (this.getRendererType() != null) {
- TogglePanelItemRenderer renderer = (TogglePanelItemRenderer) this.getRenderer(context);
- if (renderer != null) {
- renderer.encodePlaceHolderWithJs(context, this);
- }
- }
-
- popComponentFromEL(context);
- }
-
- protected static void hidePanelItem(UIComponent item) {
- // TODO move to renderer
- Map<String,Object> attrs = item.getAttributes();
- Object style = attrs.get("style");
- attrs.put("style", "display:none; " + style);
- }
-
// ------------------------------------------------ Component Attributes
@Attribute(defaultValue = "getId()", generate = false)
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelTitledItem.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelTitledItem.java 2011-01-26 19:04:15 UTC (rev 21244)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelTitledItem.java 2011-01-26 19:22:32 UTC (rev 21245)
@@ -22,15 +22,13 @@
package org.richfaces.component;
-import org.richfaces.cdk.annotations.*;
-import org.richfaces.renderkit.html.DivPanelRenderer;
+import static org.richfaces.renderkit.html.DivPanelRenderer.capitalize;
import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import java.io.IOException;
-import java.util.Properties;
-import static org.richfaces.renderkit.html.DivPanelRenderer.capitalize;
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.renderkit.html.DivPanelRenderer;
/**
* @author akolonitsky
@@ -67,26 +65,6 @@
return COMPONENT_FAMILY;
}
- @Override
- public void encodeAll(FacesContext context) throws IOException {
- if (!isRendered()) {
- return;
- }
-
- encodeBegin(context);
- if (!isDisabled()) {
- if (getRendersChildren()) {
- encodeChildren(context);
- } else if (this.getChildCount() > 0) {
- for (UIComponent kid : getChildren()) {
- kid.encodeAll(context);
- }
- }
- }
-
- encodeEnd(context);
- }
-
public UIComponent getHeaderFacet(Enum<?> state) {
return getHeaderFacet(this, state);
}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java 2011-01-26 19:04:15 UTC (rev 21244)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java 2011-01-26 19:22:32 UTC (rev 21245)
@@ -71,25 +71,52 @@
private final TableIconsRendererHelper<AbstractAccordionItem> headerRenderer = new AccordionItemHeaderRenderer();
+ public AccordionItemRenderer() {
+ super(false);
+ }
+
@Override
protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
- super.doEncodeBegin(writer, context, component);
+ doEncodeItemBegin(writer, context, component);
+ }
+ @Override
+ protected void doEncodeItemBegin(ResponseWriter writer, FacesContext context, UIComponent component)
+ throws IOException {
+
+ super.doEncodeItemBegin(writer, context, component);
encodeHeader(context, (AbstractAccordionItem) component);
-
encodeContentBegin(context, component);
}
-
+
@Override
protected String getStyleClass(UIComponent component) {
return concatClasses("rf-ac-itm", attributeAsString(component, "styleClass"));
}
@Override
+ protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component)
+ throws IOException {
+
+ AbstractAccordionItem item = (AbstractAccordionItem) component;
+
+ if (!item.isDisabled()) {
+ super.doEncodeChildren(writer, context, item);
+ }
+ }
+
+ @Override
protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ doEncodeItemEnd(writer, context, component);
+ }
+
+ @Override
+ protected void doEncodeItemEnd(ResponseWriter writer, FacesContext context, UIComponent component)
+ throws IOException {
+
encodeContentEnd(writer, component);
- super.doEncodeEnd(writer, context, component);
+ super.doEncodeItemEnd(writer, context, component);
}
private void encodeContentBegin(FacesContext context, UIComponent component) throws IOException {
@@ -141,5 +168,6 @@
protected Class<? extends UIComponent> getComponentClass() {
return AbstractTogglePanelTitledItem.class;
}
+
}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java 2011-01-26 19:04:15 UTC (rev 21244)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java 2011-01-26 19:22:32 UTC (rev 21245)
@@ -101,10 +101,6 @@
}
};
- public TableIconsRendererHelper getHeaderRenderer() {
- return headerRenderer;
- }
-
@Override
protected void doDecode(FacesContext context, UIComponent component) {
AbstractTogglePanel panel = (AbstractTogglePanel) component;
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java 2011-01-26 19:04:15 UTC (rev 21244)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java 2011-01-26 19:22:32 UTC (rev 21245)
@@ -22,21 +22,22 @@
package org.richfaces.renderkit.html;
-import static org.richfaces.renderkit.HtmlConstants.*;
+import static org.richfaces.renderkit.HtmlConstants.CLASS_ATTRIBUTE;
+import static org.richfaces.renderkit.HtmlConstants.ID_ATTRIBUTE;
+import static org.richfaces.renderkit.RenderKitUtils.attributes;
+import static org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributes;
-import org.richfaces.component.AbstractDivPanel;
-import org.richfaces.renderkit.HtmlConstants;
-import org.richfaces.renderkit.RenderKitUtils;
-import org.richfaces.renderkit.RendererBase;
+import java.io.IOException;
+import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import java.io.IOException;
-import java.util.Map;
-import static org.richfaces.renderkit.RenderKitUtils.attributes;
-import static org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributes;
+import org.richfaces.component.AbstractDivPanel;
+import org.richfaces.renderkit.HtmlConstants;
+import org.richfaces.renderkit.RenderKitUtils;
+import org.richfaces.renderkit.RendererBase;
/**
* @author akolonitsky
@@ -97,8 +98,10 @@
@Override
protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
- super.doEncodeBegin(writer, context, component);
-
+ doEncodeItemBegin(writer, context, component);
+ }
+
+ protected void doEncodeItemBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
writer.startElement(HtmlConstants.DIV_ELEM, component);
writer.writeAttribute(ID_ATTRIBUTE, component.getClientId(context), "clientId");
writer.writeAttribute(CLASS_ATTRIBUTE, getStyleClass(component), null);
@@ -124,8 +127,10 @@
@Override
protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
- super.doEncodeEnd(writer, context, component);
-
+ doEncodeItemEnd(writer, context, component);
+ }
+
+ protected void doEncodeItemEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
writeJavaScript(writer, context, component);
writer.endElement(HtmlConstants.DIV_ELEM);
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java 2011-01-26 19:04:15 UTC (rev 21244)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java 2011-01-26 19:22:32 UTC (rev 21245)
@@ -25,7 +25,6 @@
import static org.richfaces.renderkit.HtmlConstants.CLASS_ATTRIBUTE;
import static org.richfaces.renderkit.HtmlConstants.DIV_ELEM;
import static org.richfaces.renderkit.HtmlConstants.ID_ATTRIBUTE;
-import static org.richfaces.renderkit.HtmlConstants.STYLE_ATTRIBUTE;
import java.io.IOException;
import java.util.Map;
@@ -59,25 +58,38 @@
public class TabRenderer extends TogglePanelItemRenderer {
@Override
- protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
- super.doEncodeBegin(writer, context, component);
+ protected void doEncodeItemBegin(ResponseWriter writer, FacesContext context, UIComponent component)
+ throws IOException {
+ super.doEncodeItemBegin(writer, context, component);
encodeContentBegin(context, component, writer);
}
-
+
@Override
protected String getStyleClass(UIComponent component) {
return concatClasses("rf-tb", attributeAsString(component, "styleClass"));
}
@Override
- protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
- encodeContentEnd(component, writer);
+ protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component)
+ throws IOException {
- super.doEncodeEnd(writer, context, component);
+ AbstractTab tab = (AbstractTab) component;
+
+ if (!tab.isDisabled()) {
+ super.doEncodeChildren(writer, context, tab);
+ }
}
@Override
+ protected void doEncodeItemEnd(ResponseWriter writer, FacesContext context, UIComponent component)
+ throws IOException {
+
+ encodeContentEnd(component, writer);
+ super.doEncodeItemEnd(writer, context, component);
+ }
+
+ @Override
protected void writeJavaScript(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
Object script = getScriptObject(context, component);
if (script == null) {
@@ -94,11 +106,6 @@
writer.startElement(DIV_ELEM, component);
writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses("rf-tb-cnt", attributeAsString(component, "contentClass")), null);
writer.writeAttribute(ID_ATTRIBUTE, component.getClientId(context) + ":content", null);
-
- AbstractTogglePanelTitledItem item = (AbstractTogglePanelTitledItem) component;
- if (!item.isActive() || item.isDisabled()) {
- writer.writeAttribute(STYLE_ATTRIBUTE, "display: none", null);
- }
}
private void encodeContentEnd(UIComponent component, ResponseWriter responseWriter) throws IOException {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelItemRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelItemRenderer.java 2011-01-26 19:04:15 UTC (rev 21244)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelItemRenderer.java 2011-01-26 19:22:32 UTC (rev 21245)
@@ -36,6 +36,8 @@
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.component.AbstractTogglePanel;
import org.richfaces.component.AbstractTogglePanelItem;
+import org.richfaces.component.SwitchType;
+import org.richfaces.component.util.HtmlUtil;
/**
* @author akolonitsky
@@ -54,6 +56,16 @@
private static final String LEAVE = "leave";
private static final String ENTER = "enter";
+ private final boolean hideInactiveItems;
+
+ public TogglePanelItemRenderer() {
+ this(true);
+ }
+
+ protected TogglePanelItemRenderer(boolean hideInactiveItems) {
+ this.hideInactiveItems = hideInactiveItems;
+ }
+
@Override
protected String getStyleClass(UIComponent component) {
return concatClasses("rf-tgp-itm", attributeAsString(component, "styleClass"));
@@ -89,7 +101,12 @@
return AbstractTogglePanelItem.class;
}
- public void encodePlaceHolderWithJs(FacesContext context, AbstractTogglePanelItem item) throws IOException {
+ @Override
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+ protected void encodePlaceHolderWithJs(FacesContext context, AbstractTogglePanelItem item) throws IOException {
ResponseWriter writer = context.getResponseWriter();
writer.startElement("div", null);
@@ -100,5 +117,50 @@
writer.endElement("div");
}
+
+ private boolean shouldEncodeItem(FacesContext context, AbstractTogglePanelItem item) {
+ return item.isActive() || item.getSwitchType() == SwitchType.client;
+ }
+
+ @Override
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ AbstractTogglePanelItem item = (AbstractTogglePanelItem) component;
+
+ if (shouldEncodeItem(context, item)) {
+ doEncodeItemBegin(writer, context, component);
+ }
+ }
+
+ @Override
+ protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component)
+ throws IOException {
+
+ AbstractTogglePanelItem item = (AbstractTogglePanelItem) component;
+
+ if (shouldEncodeItem(context, item)) {
+ renderChildren(context, component);
+ }
+ }
+
+ @Override
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ AbstractTogglePanelItem item = (AbstractTogglePanelItem) component;
+
+ if (shouldEncodeItem(context, item)) {
+ doEncodeItemEnd(writer, context, component);
+ } else {
+ encodePlaceHolderWithJs(context, item);
+ }
+ }
+
+ @Override
+ protected String getStyle(UIComponent component) {
+ String attributeStyle = super.getStyle(component);
+ if (hideInactiveItems && !((AbstractTogglePanelItem) component).isActive()) {
+ return HtmlUtil.concatStyles(attributeStyle, "display: none");
+ } else {
+ return attributeStyle;
+ }
+ }
}
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanelItem.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanelItem.js 2011-01-26 19:04:15 UTC (rev 21244)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanelItem.js 2011-01-26 19:22:32 UTC (rev 21245)
@@ -24,10 +24,12 @@
rf.ui = rf.ui || {};
+ var DEFAULT_OPTIONS = {switchMode: 'ajax'};
+
rf.ui.CollapsiblePanelItem = rf.ui.TogglePanelItem.extendClass({
init : function (componentId, options) {
- rf.ui.TogglePanelItem.call(this, componentId, options);
+ rf.ui.TogglePanelItem.call(this, componentId, $.extend({}, DEFAULT_OPTIONS, options));
this.headerClass = "rf-cp-hdr-" + this.__state();
},
@@ -41,7 +43,10 @@
__leave : function () {
this.__content().hide();
- this.__header().removeClass(this.headerClass);
+
+ if (this.options.switchMode == 'client') {
+ this.__header().removeClass(this.headerClass);
+ }
return true;
},
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tab.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tab.js 2011-01-26 19:04:15 UTC (rev 21244)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tab.js 2011-01-26 19:22:32 UTC (rev 21245)
@@ -72,7 +72,7 @@
* */
__content : function () {
if (!this.__content_) {
- this.__content_ = $(rf.getDomElement(this.id + ":content"));
+ this.__content_ = $(rf.getDomElement(this.id));
}
return this.__content_;
},
13 years, 11 months
JBoss Rich Faces SVN: r21244 - trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-01-26 14:04:15 -0500 (Wed, 26 Jan 2011)
New Revision: 21244
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
Log:
RF-10196
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2011-01-26 18:42:49 UTC (rev 21243)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2011-01-26 19:04:15 UTC (rev 21244)
@@ -68,7 +68,7 @@
this.id = id;
jQuery.extend(this, options);
if (this.acceptedTypes) {
- this.acceptedTypes = jQuery.trim(this.acceptedTypes).split(/\s*,\s*/);
+ this.acceptedTypes = jQuery.trim(this.acceptedTypes).toUpperCase().split(/\s*,\s*/);
}
this.element = jQuery(this.attachToDom());
this.form = this.element.parents("form:first");
@@ -212,6 +212,7 @@
},
__accept: function(fileName) {
+ fileName = fileName.toUpperCase();
var result = !this.acceptedTypes;
for (var i = 0; !result && i < this.acceptedTypes.length; i++) {
var extension = this.acceptedTypes[i];
13 years, 11 months
JBoss Rich Faces SVN: r21243 - in trunk/examples/output-demo/src/main/webapp: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-26 13:42:49 -0500 (Wed, 26 Jan 2011)
New Revision: 21243
Modified:
trunk/examples/output-demo/src/main/webapp/examples/collapsiblePanel.xhtml
trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml
trunk/examples/output-demo/src/main/webapp/examples/tabPanel.xhtml
trunk/examples/output-demo/src/main/webapp/examples/togglePanel-client.xhtml
trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
Log:
output-demo updated
Modified: trunk/examples/output-demo/src/main/webapp/examples/collapsiblePanel.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/collapsiblePanel.xhtml 2011-01-26 18:34:44 UTC (rev 21242)
+++ trunk/examples/output-demo/src/main/webapp/examples/collapsiblePanel.xhtml 2011-01-26 18:42:49 UTC (rev 21243)
@@ -29,7 +29,7 @@
<pn:collapsiblePanel id="panel2" expanded="false" switchType="ajax" toggleListener="#{collapsiblePanel.action}" >
<f:facet name="headerExpanded" >
- header exanded
+ header expanded
</f:facet>
<f:facet name="headerCollapsed" >
header collapsed
@@ -41,7 +41,7 @@
<pn:collapsiblePanel id="panel3" expanded="false" switchType="client">
<f:facet name="headerExpanded" >
- header exanded
+ header expanded
</f:facet>
<f:facet name="headerCollapsed" >
header collapsed
Modified: trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml 2011-01-26 18:34:44 UTC (rev 21242)
+++ trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml 2011-01-26 18:42:49 UTC (rev 21243)
@@ -23,28 +23,49 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:pn="http://richfaces.org/output">
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:rich="http://richfaces.org/output">
<body>
<ui:composition template="/templates/template.xhtml">
- <ui:define name="scripts">
- <h:outputScript name="PanelMenu.js" />
- </ui:define>
+ <ui:define name="scripts">
+ </ui:define>
- <ui:define name="title">PANEL MENU JS Development</ui:define>
- <ui:define name="body_head">PANEL MENU JS Development</ui:define>
+ <ui:define name="title">PANEL MENU JS Development</ui:define>
+ <ui:define name="body_head">PANEL MENU JS Development</ui:define>
- <ui:define name="body">
- <h:form id="f" style="border:blue solid thin;">
- <pn:panelMenu id="panelMenu">
- <!-- TODO -->
- </pn:panelMenu>
- </h:form>
- </ui:define>
+ <ui:define name="body">
+ <h:form id="f">
+
+ <rich:panelMenu id="panelMenu"
+ itemLeftIcon="grid"
+ groupLeftIconCollapsed="grid"
+ topGroupLeftIconCollapsed="grid"
+ topGroupLeftIconExpanded="chevronLeft"
+ topGroupLeftIconDisabled="disc"
+ itemLeftIconDisabled="triangleLeft"
+ topItemLeftIconDisabled="triangleUp"
+ topItemLeftIcon="triangleDown"
+ groupMode="client">
+ <rich:panelMenuGroup id="group1" label="Group 1" disabled="true">
+ <rich:panelMenuItem id="item11" label="Item 1.1" />
+ <rich:panelMenuItem id="item12" label="Item 1.2" />
+ </rich:panelMenuGroup>
+ <rich:panelMenuItem id="item2" label="Item 2" disabled="true" />
+ <rich:panelMenuItem id="item3" label="Item 3" />
+ <rich:panelMenuGroup id="group4" label="Group 4">
+ <rich:panelMenuItem id="item41" label="Item 4.1" />
+ <rich:panelMenuItem id="item42" label="Item 4.2" disabled="true" />
+ <rich:panelMenuGroup id="group43" label="Group 4.1" disabled="true">
+ <rich:panelMenuItem id="item431" label="Item 4.1.1" />
+ </rich:panelMenuGroup>
+ </rich:panelMenuGroup>
+ </rich:panelMenu>
+ </h:form>
+ </ui:define>
</ui:composition>
</body>
</html>
Modified: trunk/examples/output-demo/src/main/webapp/examples/tabPanel.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/tabPanel.xhtml 2011-01-26 18:34:44 UTC (rev 21242)
+++ trunk/examples/output-demo/src/main/webapp/examples/tabPanel.xhtml 2011-01-26 18:42:49 UTC (rev 21243)
@@ -19,6 +19,9 @@
<pn:tab header="tab1 header" headerClassDisabled="myClass_02" onenter="alert('onenter 01')">
Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here.
</pn:tab>
+ <pn:tab header="tab 1a (disabled) header" disabled="true">
+ Disabled tab content
+ </pn:tab>
<pn:tab header="tab2 header" onenter="alert('onenter 02')">
He he
</pn:tab>
Modified: trunk/examples/output-demo/src/main/webapp/examples/togglePanel-client.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/togglePanel-client.xhtml 2011-01-26 18:34:44 UTC (rev 21242)
+++ trunk/examples/output-demo/src/main/webapp/examples/togglePanel-client.xhtml 2011-01-26 18:42:49 UTC (rev 21243)
@@ -13,7 +13,7 @@
<ui:define name="body">
<h:form id="f">
- <pn:togglePanel id="panel" switchType="null" lang="en">
+ <pn:togglePanel id="panel" switchType="client" lang="en">
<pn:togglePanelItem name="name1">hello name1</pn:togglePanelItem>
<pn:togglePanelItem name="name2">hello name2</pn:togglePanelItem>
<pn:togglePanelItem name="name3">hello name3</pn:togglePanelItem>
Modified: trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2011-01-26 18:34:44 UTC (rev 21242)
+++ trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2011-01-26 18:42:49 UTC (rev 21243)
@@ -61,16 +61,16 @@
<li>
<p>Examples</p>
<ul>
- <li><h:commandLink value="togglePanel" action="togglePanel" /></li>
- <li><h:commandLink value="togglePanel Ajax" action="togglePanel/ajax" /></li>
- <li><h:commandLink value="togglePanel Client" action="togglePanel/client" /></li>
- <li><h:commandLink value="togglePanel Server" action="togglePanel/server" /></li>
- <li><h:commandLink value="togglePanel Mixed" action="togglePanel/mixed" /></li>
+ <li><h:link value="togglePanel" outcome="togglePanel" /></li>
+ <li><h:link value="togglePanel Ajax" outcome="togglePanel/ajax" /></li>
+ <li><h:link value="togglePanel Client" outcome="togglePanel/client" /></li>
+ <li><h:link value="togglePanel Server" outcome="togglePanel/server" /></li>
+ <li><h:link value="togglePanel Mixed" outcome="togglePanel/mixed" /></li>
</ul>
<p>QUnit</p>
<ul>
- <li><h:commandLink value="togglePanel" action="qunit/togglePanel" /></li>
- <li><h:commandLink value="togglePanelItem" action="qunit/togglePanelItem" /></li>
+ <li><h:link value="togglePanel" outcome="qunit/togglePanel" /></li>
+ <li><h:link value="togglePanelItem" outcome="qunit/togglePanelItem" /></li>
</ul>
</li>
</ul>
@@ -81,21 +81,21 @@
<li>
<p>Examples</p>
<ul>
- <li><h:commandLink value="accordion" action="accordion" /></li>
+ <li><h:link value="accordion" outcome="accordion" /></li>
</ul>
</li>
<li>
<p>QUnit</p>
<ul>
- <li><h:commandLink value="accordion" action="qunit/accordion" /></li>
- <li><h:commandLink value="accordionHeaders" action="qunit/accordionHeaders" /></li>
+ <li><h:link value="accordion" outcome="qunit/accordion" /></li>
+ <li><h:link value="accordionHeaders" outcome="qunit/accordionHeaders" /></li>
</ul>
</li>
<li>
<p>Bugs</p>
<ul>
- <li><h:commandLink value="RF-9364" action="RF-9364" /></li>
- <li><h:commandLink value="RF-9851" action="RF-9851" /></li>
+ <li><h:link value="RF-9364" outcome="RF-9364" /></li>
+ <li><h:link value="RF-9851" outcome="RF-9851" /></li>
</ul>
</li>
</ul>
@@ -105,11 +105,11 @@
<li>
<p>Examples</p>
<ul>
- <li><h:commandLink value="Collapsible Panel" action="collapsiblePanel" /></li>
+ <li><h:link value="Collapsible Panel" outcome="collapsiblePanel" /></li>
</ul>
<p>QUnit</p>
<ul>
- <li><h:commandLink value="tabPanel" action="qunit/tabPanel" /></li>
+ <li><h:link value="tabPanel" outcome="qunit/tabPanel" /></li>
</ul>
</li>
</ul>
@@ -119,11 +119,11 @@
<li>
<p>Examples</p>
<ul>
- <li><h:commandLink value="Tab Panel" action="tabPanel" /></li>
+ <li><h:link value="Tab Panel" outcome="tabPanel" /></li>
</ul>
<p>QUnit</p>
<ul>
- <li><h:commandLink value="tabPanel" action="qunit/tabPanel" /></li>
+ <li><h:link value="tabPanel" outcome="qunit/tabPanel" /></li>
</ul>
</li>
</ul>
@@ -133,11 +133,11 @@
<li>
<p>Examples</p>
<ul>
- <li><h:commandLink value="Panel Menu" action="panelMenu" /></li>
+ <li><h:link value="Panel Menu" outcome="panelMenu" /></li>
</ul>
<p>QUnit</p>
<ul>
- <li><h:commandLink value="Panel Menu" action="qunit/panelMenu" /></li>
+ <li><h:link value="Panel Menu" outcome="qunit/panelMenu" /></li>
</ul>
</li>
</ul>
@@ -148,13 +148,13 @@
<p>Examples</p>
<ul>
<li>
- <h:commandLink value="Tooltip" action="tooltip"/>
+ <h:link value="Tooltip" outcome="tooltip"/>
</li>
</ul>
<p>QUnit</p>
<ul>
<li>
- <h:commandLink value="Tooltip" action="qunit/tooltip"/>
+ <h:link value="Tooltip" outcome="qunit/tooltip"/>
</li>
</ul>
</li>
@@ -166,7 +166,7 @@
<p>Examples</p>
<ul>
<li>
- <h:commandLink value="Toolbar" action="toolbar"/>
+ <h:link value="Toolbar" outcome="toolbar"/>
</li>
</ul>
</li>
@@ -178,7 +178,7 @@
<p>Examples</p>
<ul>
<li>
- <h:commandLink value="DropDown Menu" action="dropDownMenu"/>
+ <h:link value="DropDown Menu" outcome="dropDownMenu"/>
</li>
</ul>
</li>
13 years, 11 months
JBoss Rich Faces SVN: r21242 - trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-01-26 13:34:44 -0500 (Wed, 26 Jan 2011)
New Revision: 21242
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml
Log:
RF-10294
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml 2011-01-26 18:10:37 UTC (rev 21241)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml 2011-01-26 18:34:44 UTC (rev 21242)
@@ -67,7 +67,6 @@
<a4j:jsFunction name="remove" action="#{carsBean.remove}"
render="table" execute="@this"
oncomplete="#{rich:component('confirmPane')}.hide();" />
- </h:form>
<rich:popupPanel id="statPane" autosized="true">
<h:graphicImage value="/images/ai.gif" />
@@ -81,8 +80,7 @@
<a4j:commandButton value="Delete" onclick="remove(); return false;" />
</rich:popupPanel>
- <rich:popupPanel header="Edit Car Details" id="editPane">
- <h:form>
+ <rich:popupPanel header="Edit Car Details" id="editPane" domElementAttachment="parent">
<h:panelGrid columns="3" id="editGrid">
<h:outputText value="Vendor" />
<h:outputText value="#{carsBean.editedCar.vendor}" />
@@ -112,6 +110,6 @@
oncomplete="if (#{facesContext.maximumSeverity==null}) {#{rich:component('editPane')}.hide();}" />
<a4j:commandButton value="Cancel"
onclick="#{rich:component('editPane')}.hide(); return false;" />
- </h:form>
</rich:popupPanel>
+ </h:form>
</ui:composition>
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r21241 - in trunk: examples/input-demo/src/main/webapp/examples and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2011-01-26 13:10:37 -0500 (Wed, 26 Jan 2011)
New Revision: 21241
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
trunk/examples/input-demo/src/main/webapp/examples/autocomplete.xhtml
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
Log:
http://jira.jboss.com/jira/browse/RF-9722
Modified: trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2011-01-26 16:19:34 UTC (rev 21240)
+++ trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2011-01-26 18:10:37 UTC (rev 21241)
@@ -595,4 +595,92 @@
window.attachEvent("onunload", richfaces.cleanDom);
}
}(jQuery, RichFaces));
+
+// RichFaces.utils
+// RichFaces.utils.cache
+(function ($, rf) {
+ rf.utils = rf.utils || {};
+ rf.utils.Cache = function (key, items, values, useCache) {
+ this.key = key.toLowerCase();
+ this.cache = {};
+ this.cache[this.key] = items || [];
+ this.originalValues = typeof values == "function" ? values(items) : values || this.cache[this.key];
+ this.values = processValues(this.originalValues);
+ this.useCache = useCache || checkValuesPrefix.call(this);
+ };
+
+ var processValues = function (values) {
+ var processedValues = [];
+ for (var i = 0; i<values.length; i++) {
+ processedValues.push(values[i].toLowerCase());
+ }
+ return processedValues;
+ };
+
+ var checkValuesPrefix = function () {
+ var result = true;
+ for (var i = 0; i<this.values.length; i++) {
+ if (this.values[i].indexOf(this.key)!=0) {
+ result = false;
+ break;
+ }
+ }
+ return result;
+ };
+
+ var getItems = function (key, filterFunction) {
+ key = key.toLowerCase();
+ var newCache = [];
+
+ if (key.length < this.key.length) {
+ return newCache;
+ }
+
+ if (this.cache[key]) {
+ newCache = this.cache[key];
+ } else {
+ var useCustomFilterFunction = typeof filterFunction == "function";
+ var itemsCache = this.cache[this.key];
+ for (var i = 0; i<this.values.length; i++) {
+ var value = this.values[i];
+ if (useCustomFilterFunction && filterFunction(key, value)) {
+ newCache.push(itemsCache[i]);
+ } else {
+ var p = value.indexOf(key);
+ if (p == 0) {
+ newCache.push(itemsCache[i]);
+ }
+ }
+ }
+
+ if ((!this.lastKey || key.indexOf(this.lastKey)!=0) && newCache.length > 0) {
+ this.cache[key] = newCache;
+ if (newCache.length==1) {
+ this.lastKey = key;
+ }
+ }
+ }
+
+ return newCache;
+ };
+
+ var getItemValue = function (item) {
+ return this.originalValues[this.cache[this.key].index(item)];
+ };
+
+ var isCached = function (key) {
+ key = key.toLowerCase();
+ return this.cache[key] || this.useCache && key.indexOf(this.key)==0;
+ };
+
+ $.extend(rf.utils.Cache.prototype, (function () {
+ return {
+ getItems: getItems,
+ getItemValue: getItemValue,
+ isCached: isCached
+ };
+ })());
+
+})(jQuery, RichFaces);
+
Modified: trunk/examples/input-demo/src/main/webapp/examples/autocomplete.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/examples/autocomplete.xhtml 2011-01-26 16:19:34 UTC (rev 21240)
+++ trunk/examples/input-demo/src/main/webapp/examples/autocomplete.xhtml 2011-01-26 18:10:37 UTC (rev 21241)
@@ -68,7 +68,7 @@
</script>
<br />
<select style="width: 200px" name="select">
- <option>ccccc</option>
+ <option>option 0</option><option>option 1</option><option>option 2</option><option>option 3</option><option>option 4</option><option>option 5</option><option>option 6</option><option>option 7</option><option>option 8</option><option>option 9</option><option>option 10</option><option>option 11</option><option>option 12</option><option>option 13</option><option>option 14</option><option>option 15</option><option>option 16</option><option>option 17</option><option>option 18</option><option>option 19</option><option>option 20</option><option>option 21</option><option>option 22</option><option>option 23</option><option>option 24</option><option>option 25</option><option>option 26</option><option>option 27</option><option>option 28</option><option>option 29</option><option>option 30</option><option>option 31</option><option>option 32</option><option>option 33</option><option>option 34</option><option>option 35</option><option>option 36</option><option>option 37</option><option!
>option 38</option><option>option 39</option><option>option 40</option><option>option 41</option><option>option 42</option><option>option 43</option><option>option 44</option><option>option 45</option><option>option 46</option><option>option 47</option><option>option 48</option><option>option 49</option><option>option 50</option><option>option 51</option><option>option 52</option><option>option 53</option><option>option 54</option><option>option 55</option><option>option 56</option><option>option 57</option><option>option 58</option><option>option 59</option><option>option 60</option><option>option 61</option><option>option 62</option><option>option 63</option><option>option 64</option><option>option 65</option><option>option 66</option><option>option 67</option><option>option 68</option><option>option 69</option><option>option 70</option><option>option 71</option><option>option 72</option><option>option 73</option><option>option 74</option><option>option 75</option><option!
>option 76</option><option>option 77</option><option>option 78!
</option
><option>option 79</option><option>option 80</option><option>option 81</option><option>option 82</option><option>option 83</option><option>option 84</option><option>option 85</option><option>option 86</option><option>option 87</option><option>option 88</option><option>option 89</option><option>option 90</option><option>option 91</option><option>option 92</option><option>option 93</option><option>option 94</option><option>option 95</option><option>option 96</option><option>option 97</option><option>option 98</option><option>option 99</option>
</select> text block text block text block text block text block text
block text block text block text block text block text block text
block text block text block text block text block text block text
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2011-01-26 16:19:34 UTC (rev 21240)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2011-01-26 18:10:37 UTC (rev 21241)
@@ -1,91 +1,5 @@
(function ($, rf) {
- rf.utils = rf.utils || {};
- rf.utils.Cache = function (key, items, values, useCache) {
- this.key = key.toLowerCase();
- this.cache = {};
- this.cache[this.key] = items || [];
- this.originalValues = typeof values == "function" ? values(items) : values || this.cache[this.key];
- this.values = processValues(this.originalValues);
- this.useCache = useCache || checkValuesPrefix.call(this);
- };
-
- var processValues = function (values) {
- var processedValues = [];
- for (var i = 0; i<values.length; i++) {
- processedValues.push(values[i].toLowerCase());
- }
- return processedValues;
- };
-
- var checkValuesPrefix = function () {
- var result = true;
- for (var i = 0; i<this.values.length; i++) {
- if (this.values[i].indexOf(this.key)!=0) {
- result = false;
- break;
- }
- }
- return result;
- };
-
- var getItems = function (key, filterFunction) {
- key = key.toLowerCase();
- var newCache = [];
-
- if (key.length < this.key.length) {
- return newCache;
- }
-
- if (this.cache[key]) {
- newCache = this.cache[key];
- } else {
- var useCustomFilterFunction = typeof filterFunction == "function";
- var itemsCache = this.cache[this.key];
- for (var i = 0; i<this.values.length; i++) {
- var value = this.values[i];
- if (useCustomFilterFunction && filterFunction(key, value)) {
- newCache.push(itemsCache[i]);
- } else {
- var p = value.indexOf(key);
- if (p == 0) {
- newCache.push(itemsCache[i]);
- }
- }
- }
-
- if ((!this.lastKey || key.indexOf(this.lastKey)!=0) && newCache.length > 0) {
- this.cache[key] = newCache;
- if (newCache.length==1) {
- this.lastKey = key;
- }
- }
- }
-
- return newCache;
- };
-
- var getItemValue = function (item) {
- return this.originalValues[this.cache[this.key].index(item)];
- };
-
- var isCached = function (key) {
- key = key.toLowerCase();
- return this.cache[key] || this.useCache && key.indexOf(this.key)==0;
- };
-
- $.extend(rf.utils.Cache.prototype, (function () {
- return {
- getItems: getItems,
- getItemValue: getItemValue,
- isCached: isCached
- };
- })());
-
-})(jQuery, RichFaces);
-
-(function ($, rf) {
-
/*
* TODO: add user's event handlers call from options
* TODO: add fire events
@@ -103,6 +17,8 @@
this.value = "";
this.index = null;
this.isFirstAjax = true;
+ this.lastMouseX = null;
+ this.lastMouseY = null;
updateTokenOptions.call(this);
bindEventHandlers.call(this);
updateItemsList.call(this, "");
@@ -158,16 +74,42 @@
};
var bindEventHandlers = function () {
- rf.Event.bind(rf.getDomElement(this.id+ID.ITEMS).parentNode, "click"+this.namespace+" mouseover"+this.namespace, onMouseAction, this);
+ var handlers = {};
+ handlers["click"+this.namespace] = handlers["mouseover"+this.namespace] = onMouseAction;
+ if (!$.browser.msie && !$.browser.opera) {
+ handlers["mouseenter"+this.namespace] = onMouseEnter;
+ handlers["mouseleave"+this.namespace] = onMouseLeave;
+ }
+ rf.Event.bind(rf.getDomElement(this.id+ID.ITEMS).parentNode, handlers, this);
};
+
+ var onMouseLeave = function(event) {
+ rf.Event.unbind(rf.getDomElement(this.id+ID.ITEMS).parentNode, "mousemove"+this.namespace);
+ this.lastMouseX = null;
+ this.lastMouseY = null;
+ };
+
+ var onMouseMove = function(event) {
+ this.lastMouseX = event.pageX; this.lastMouseY = event.pageY;
+ };
+
+ var onMouseEnter = function(event) {
+ this.lastMouseX = event.pageX; this.lastMouseY = event.pageY;
+ rf.Event.bind(rf.getDomElement(this.id+ID.ITEMS).parentNode, "mousemove"+this.namespace, onMouseMove, this);
+ };
var onMouseAction = function(event) {
var element = $(event.target).closest("."+this.options.itemClass, event.currentTarget).get(0);
if (element) {
if (event.type=="mouseover") {
- var index = this.items.index(element);
- selectItem.call(this, event, index);
+ if (this.lastMouseX==null || this.lastMouseX!=event.pageX || this.lastMouseY!=event.pageY)
+ {
+ //window.console && console.log && console.log("[mouseover] lastMouseX:" + this.lastMouseX+" lastMouseY:" + this.lastMouseY);
+ //window.console && console.log && console.log("[mouseover] pageX:" + event.pageX+" pageY:" + event.pageY);
+ var index = this.items.index(element);
+ selectItem.call(this, event, index);
+ }
} else {
this.__onEnter(event);
rf.Selection.setCaretTo(rf.getDomElement(this.fieldId));
@@ -296,7 +238,6 @@
this.items = $(newItems);
//TODO: works only with simple markup, not with <tr>
$(rf.getDomElement(this.id+ID.ITEMS)).empty().append(this.items);
- window.console && console.log && console.log("updateItemsFromCache");
};
var clearItems = function () {
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2011-01-26 16:19:34 UTC (rev 21240)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2011-01-26 18:10:37 UTC (rev 21241)
@@ -3,6 +3,7 @@
rf.ui = rf.ui || {};
rf.ui.PopupList = function(id, listener, options) {
+ this.namespace = this.namespace || "."+rf.Event.createNamespace(this.name, id);
var mergedOptions = $.extend({}, defaultOptions, options);
$super.constructor.call(this, id, mergedOptions);
this.selectListener = listener;
@@ -11,9 +12,10 @@
this.itemCss = mergedOptions.itemCss;
this.listCss = mergedOptions.listCss;
this.index = -1;
- this.popup.bind("mouseover", $.proxy(this.__onMouseOver, this));
- this.popup.bind("click", $.proxy(this.__onClick, this));
+ this.lastMouseX = null;
+ this.lastMouseY = null;
+ bindEventHandlers.call(this);
this.__updateItemsList();
};
@@ -25,7 +27,48 @@
positionType: "DROPDOWN",
positionOffset: [0,0]
};
-
+
+ var bindEventHandlers = function () {
+ var handlers = {};
+ handlers["click"+this.namespace] = onClick;
+ handlers["mouseover"+this.namespace] = onMouseOver;
+ if (!$.browser.msie && !$.browser.opera) {
+ handlers["mouseenter"+this.namespace] = onMouseEnter;
+ handlers["mouseleave"+this.namespace] = onMouseLeave;
+ }
+ rf.Event.bind(this.popup, handlers, this);
+ };
+
+ var onMouseLeave = function(e) {
+ rf.Event.unbind(this.popup, "mousemove"+this.namespace);
+ this.lastMouseX = null;
+ this.lastMouseY = null;
+ };
+
+ var onMouseMove = function(e) {
+ this.lastMouseX = e.pageX; this.lastMouseY = e.pageY;
+ };
+
+ var onMouseEnter = function(e) {
+ this.lastMouseX = e.pageX; this.lastMouseY = e.pageY;
+ rf.Event.bind(this.popup, "mousemove"+this.namespace, onMouseMove, this);
+ };
+
+ var onMouseOver = function(e) {
+ if (this.lastMouseX==null || this.lastMouseX!=e.pageX || this.lastMouseY!=e.pageY)
+ {
+ var item = this.__getItem(e);
+ if(item) {
+ this.__select(item);
+ }
+ }
+ };
+
+ var onClick = function(e) {
+ var item = this.__getItem(e);
+ this.processItem(item);
+ this.__select(item);
+ };
$.extend(rf.ui.PopupList.prototype, ( function () {
@@ -145,19 +188,6 @@
__selectNext: function() {
this.__selectByIndex(1, true);
},
-
- __onMouseOver: function(e) {
- var item = this.__getItem(e);
- if(item) {
- this.__select(item);
- }
- },
-
- __onClick: function(e) {
- var item = this.__getItem(e);
- this.processItem(item);
- this.__select(item);
- },
__getItem: function(e) {
return $(e.target).closest("."+this.itemCss, e.currentTarget).get(0);
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2011-01-26 16:19:34 UTC (rev 21240)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2011-01-26 18:10:37 UTC (rev 21241)
@@ -1,99 +1,5 @@
-//TODO anton -> Cache impl should be moved to the utils
-
(function ($, rf) {
- rf.utils = rf.utils || {};
-
- rf.utils.Cache = function (key, items, values, useCache) {
- this.key = key.toLowerCase();
- this.cache = {}
- this.cache[this.key] = items || [];
- this.originalValues = typeof values == "function" ? values(items) : values || this.cache[this.key];
- this.values = processValues(this.originalValues);
- this.useCache = useCache || checkValuesPrefix.call(this);
- };
- var processValues = function (values) {
- var processedValues = [];
- for (var i = 0; i<values.length; i++) {
- processedValues.push(values[i].toLowerCase());
- }
- return processedValues;
- }
-
- var checkValuesPrefix = function () {
- var result = true;
- for (var i = 0; i<this.values.length; i++) {
- if (this.values[i].indexOf(this.key)!=0) {
- result = false; break;
- }
- }
- return result;
- }
-
- var getItems = function (key, filterFunction) {
- key = key.toLowerCase();
- var newCache = [];
-
- if (key.length < this.key.length) {
- return newCache;
- }
-
- if (this.cache[key]) {
- newCache = this.cache[key];
- } else {
-
- var useCustomFilterFunction = typeof filterFunction == "function";
- var itemsCache = this.cache[this.key];
-
- for (var i = 0; i<this.values.length; i++) {
- var value = this.values[i];
-
- if (useCustomFilterFunction && filterFunction(key, value)) {
- newCache.push(itemsCache[i]);
- } else {
- var p = value.indexOf(key);
- if (p == 0) {
- newCache.push(itemsCache[i]);
- }
- }
- }
-
- if ((!this.lastKey || key.indexOf(this.lastKey)!=0) && newCache.length > 0) {
- this.cache[key] = newCache;
-
- if (newCache.length==1) {
- this.lastKey = key;
- }
- }
- }
-
- return newCache;
- };
-
- var getItemValue = function (item) {
- return this.originalValues[this.cache[this.key].index(item)];
- };
-
- var isCached = function (key) {
- key = key.toLowerCase();
- return this.cache[key] || this.useCache && key.indexOf(this.key)==0;
- };
-
- $.extend(rf.utils.Cache.prototype, (function () {
- return {
- getItems: getItems,
- getItemValue: getItemValue,
- isCached: isCached
- };
- })());
-
-
-})(jQuery, RichFaces);
-
-//-->
-
-(function ($, rf) {
-
rf.ui = rf.ui || {};
rf.ui.Select = function(id, options) {
13 years, 11 months
JBoss Rich Faces SVN: r21240 - in modules/tests/metamer/trunk/application/src/main: java/org/richfaces/tests/metamer/model/drag and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-26 11:19:34 -0500 (Wed, 26 Jan 2011)
New Revision: 21240
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css
Log:
drag-n-drop: pre-automation activities (RFPL-992)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java 2011-01-26 16:18:40 UTC (rev 21239)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java 2011-01-26 16:19:34 UTC (rev 21240)
@@ -67,9 +67,9 @@
attributes = Attributes.getComponentAttributesFromFacesConfig(UIDropTarget.class, getClass());
attributes.setAttribute("acceptedTypes", "drg1, drg2");
- attributes.setAttribute("render", "droppedValues");
+ attributes.setAttribute("render", "droppable");
+ attributes.setAttribute("rendered", true);
- attributes.remove("event");
attributes.remove("actionExpression");
attributes.remove("action");
attributes.remove("actionListener");
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java 2011-01-26 16:18:40 UTC (rev 21239)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java 2011-01-26 16:19:34 UTC (rev 21240)
@@ -35,6 +35,10 @@
public DragValue(int number) {
this.number = number;
}
+
+ public int getNumber() {
+ return number;
+ }
@Override
public String toString() {
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java 2011-01-26 16:18:40 UTC (rev 21239)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java 2011-01-26 16:19:34 UTC (rev 21240)
@@ -35,6 +35,10 @@
public DropValue(int number) {
this.number = number;
}
+
+ public int getNumber() {
+ return number;
+ }
@Override
public String toString() {
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml 2011-01-26 16:18:40 UTC (rev 21239)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml 2011-01-26 16:19:34 UTC (rev 21240)
@@ -60,39 +60,58 @@
<tr>
<td>
<a4j:outputPanel id="draggable1" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[0]}" />
- <rich:dragSource event="mouseover"
+ <h:outputText value="#1: type=#{richDragSourceBean.attributes['type'].value}" />
+ <rich:dragSource
dragValue="#{richDragSourceBean.dragValues[0]}"
type="drg1" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable2" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[1]}" />
- <rich:dragSource event="mouseover" type="drg2" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[1]}" />
+ <h:outputText value="#2: type=drg2" />
+ <rich:dragSource type="drg2" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[1]}" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable3" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[2]}" />
- <rich:dragSource event="mouseover" type="drg3" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[2]}" />
+ <h:outputText value="#3: type=drg3" />
+ <rich:dragSource type="drg3" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[2]}" />
</a4j:outputPanel>
</td>
</tr>
</table>
<a4j:outputPanel id="droppable" layout="block" styleClass="droppable">
- <rich:dropTarget event="mouseover"
+ <rich:dropTarget
+ id="richDropTarget"
dropValue="#{richDropTargetBean.dropValue}"
dropListener="#{richDropListenerBean.processDragging}"
acceptedTypes="drg1, drg2"
- render="droppedValues"
+ render="droppable"
/>
+ <h:outputText value="Accepts: drg1, drg2" />
+ <br />
+
+ <h:outputText id="dropNumber" value="Drops: #{richDropTargetBean.dropValue.number}" />
+ <br />
+
+
+
<h:dataTable id="droppedValues" var="droppedValue" value="#{richDropTargetBean.droppedEntries}">
<h:column>
- <h:outputText value="#{droppedValue}" />
+ <f:facet name="header">
+ Dragged
+ </f:facet>
+ <h:outputText value="##{droppedValue.value.number}" />
</h:column>
+ <h:column>
+ <f:facet name="header">
+ Dropped
+ </f:facet>
+ <h:outputText value="#{droppedValue.key.number}" />
+ </h:column>
+
</h:dataTable>
</a4j:outputPanel>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml 2011-01-26 16:18:40 UTC (rev 21239)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml 2011-01-26 16:19:34 UTC (rev 21240)
@@ -54,45 +54,61 @@
<table>
<tr>
<td>
- <a4j:outputPanel id="draggable1" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[0]}" />
- <rich:dragSource event="mouseover"
+ <a4j:outputPanel id="draggable1" layout="block" styleClass="draggable" style="border: 3px solid red">
+ <h:outputText value="#1: type=#{richDragSourceBean.attributes['type'].value}" />
+ <rich:dragSource
dragValue="#{richDragSourceBean.dragValues[0]}"
-
dragIndicator="#{richDragSourceBean.attributes['dragIndicator'].value}"
type="#{richDragSourceBean.attributes['type'].value}" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable2" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[1]}" />
- <rich:dragSource event="mouseover" type="drg2" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[1]}" />
+ <h:outputText value="#2: type=drg2" />
+ <rich:dragSource type="drg2" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[1]}" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable3" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[2]}" />
- <rich:dragSource event="mouseover" type="drg3" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[2]}" />
+ <h:outputText value="#3: type=drg3" />
+ <rich:dragSource type="drg3" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[2]}" />
</a4j:outputPanel>
</td>
</tr>
</table>
<a4j:outputPanel id="droppable" layout="block" styleClass="droppable">
- <rich:dropTarget event="mouseover"
- dropValue="#{richDropTargetBean.dropValue}"
- dropListener="#{richDropListenerBean.processDragging}"
- acceptedTypes="drg1, drg2"
- render="droppedValues"
- />
+
+ <rich:dropTarget
+ id="richDropTarget"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg1, drg2"
+ render="droppable"
+ />
+
+ <h:outputText value="Accepts: drg1, drg2" />
+ <br />
+ <h:outputText id="dropNumber" value="Drops: #{richDropTargetBean.dropValue.number}" />
+ <br />
+
+
+
<h:dataTable id="droppedValues" var="droppedValue" value="#{richDropTargetBean.droppedEntries}">
<h:column>
- <h:outputText value="#{droppedValue.key}" />
+ <f:facet name="header">
+ Dragged
+ </f:facet>
+ <h:outputText value="##{droppedValue.value.number}" />
</h:column>
<h:column>
- <h:outputText value="#{droppedValue.value}" />
+ <f:facet name="header">
+ Dropped
+ </f:facet>
+ <h:outputText value="#{droppedValue.key.number}" />
</h:column>
+
</h:dataTable>
</a4j:outputPanel>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml 2011-01-26 16:18:40 UTC (rev 21239)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml 2011-01-26 16:19:34 UTC (rev 21240)
@@ -55,29 +55,31 @@
<tr>
<td>
<a4j:outputPanel id="draggable1" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[0]}" />
- <rich:dragSource event="mouseover"
+ <h:outputText value="#1: type=#{richDragSourceBean.attributes['type'].value}" />
+ <rich:dragSource
+ dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[0]}"
type="drg1" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable2" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[1]}" />
- <rich:dragSource event="mouseover" type="drg2" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[1]}" />
+ <h:outputText value="#2: type=drg2" />
+ <rich:dragSource type="drg2" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[1]}" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable3" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[2]}" />
- <rich:dragSource event="mouseover" type="drg3" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[2]}" />
+ <h:outputText value="#3: type=drg3" />
+ <rich:dragSource type="drg3" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[2]}" />
</a4j:outputPanel>
</td>
</tr>
</table>
- <a4j:outputPanel id="droppable" layout="block" styleClass="droppable">
- <rich:dropTarget event="mouseover"
+ <a4j:outputPanel id="droppable" layout="block" styleClass="droppable" style="border: 3px solid red">
+ <rich:dropTarget
+ id="richDropTarget"
dropValue="#{richDropTargetBean.dropValue}"
dropListener="#{richDropListenerBean.processDragging}"
action="#{richBean.dummyAction}"
@@ -90,11 +92,27 @@
rendered="#{richDragSourceBean.attributes['rendered'].value}"
value="#{richDragSourceBean.attributes['value'].value}"
/>
+
+ <h:outputText value="Accepts: drg1, drg2" />
+ <br />
+ <h:outputText id="dropNumber" value="Drops: #{richDropTargetBean.dropValue.number}" />
+ <br />
+
<h:dataTable id="droppedValues" var="droppedValue" value="#{richDropTargetBean.droppedEntries}">
<h:column>
- <h:outputText value="#{droppedValue}" />
+ <f:facet name="header">
+ Dragged
+ </f:facet>
+ <h:outputText value="##{droppedValue.value.number}" />
</h:column>
+ <h:column>
+ <f:facet name="header">
+ Dropped
+ </f:facet>
+ <h:outputText value="#{droppedValue.key.number}" />
+ </h:column>
+
</h:dataTable>
</a4j:outputPanel>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css 2011-01-26 16:18:40 UTC (rev 21239)
+++ modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css 2011-01-26 16:19:34 UTC (rev 21240)
@@ -1,22 +1,23 @@
.droppable {
border: 1px solid blue;
- margin: 4px;
- height: 300px;
- width: 350px;
+ margin: 1em;
+ padding: 1em;
+ height: 15em;
+ width: 15em;
background-color: yellow;
overflow: auto;
}
.draggable {
border: 1px solid #000000;
- background-color: grey;
- opacity: 0.3;
+ background-color: silver;
margin: 2px;
- height: 50px;
- width: 100px;
+ width: 8em;
+ padding: 1em;
}
.rf-ind {
+ opacity: 0.5;
height: 20px;
width: 20px;
border: 1px dotted red;
@@ -24,15 +25,9 @@
}
.rf-ind-acpt {
- height: 20px;
- width: 20px;
- border: 1px dotted red;
background-color: green;
}
.rf-ind-rejt {
- height: 20px;
- width: 20px;
- border: 1px dotted green;
background-color: red;
}
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r21239 - in modules/tests/metamer/trunk/application/src/main: resources/org/richfaces/tests/metamer/bean and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-26 11:18:40 -0500 (Wed, 26 Jan 2011)
New Revision: 21239
Added:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.properties
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.properties
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml
Log:
rich:panelMenuGroup and rich:panelMenuItem - pre-automation activities (RFPL-950)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java 2011-01-26 16:17:34 UTC (rev 21238)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java 2011-01-26 16:18:40 UTC (rev 21239)
@@ -61,13 +61,7 @@
// already defined in source directly
attributes.remove("name");
attributes.remove("label");
-
- // attributes should be hidden
- attributes.remove("panelMenu");
- attributes.remove("parentItem");
- attributes.remove("topItem");
- attributes.remove("submittedExpanded");
- attributes.remove("value");
+ attributes.remove("changeExpandListener");
}
public Attributes getAttributes() {
@@ -79,7 +73,6 @@
}
public void changeExpandListener(Object event) {
- // TODO ajax or server expansion doesn't work yet
- throw new UnsupportedOperationException("needs to be implemented in Metamer");
+ RichBean.logToPage("* group expanded");
}
}
Added: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.properties (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.properties 2011-01-26 16:18:40 UTC (rev 21239)
@@ -0,0 +1,58 @@
+attr.mode.client=client
+attr.mode.ajax=ajax
+attr.mode.server=server
+attr.mode.null=
+attr.leftIconCollapsed.grid=grid
+attr.leftIconCollapsed.disc=disc
+attr.leftIconCollapsed.chevronUp=chevronUp
+attr.leftIconCollapsed.chevronDown=chevronDown
+attr.leftIconCollapsed.triangle=triangle
+attr.leftIconCollapsed.triangleUp=triangleUp
+attr.leftIconCollapsed.triangleDown=triangleDown
+attr.leftIconCollapsed.customURL=/resources/images/loading.gif
+attr.leftIconCollapsed.null=
+attr.leftIconExpanded.grid=grid
+attr.leftIconExpanded.disc=disc
+attr.leftIconExpanded.chevronUp=chevronUp
+attr.leftIconExpanded.chevronDown=chevronDown
+attr.leftIconExpanded.triangle=triangle
+attr.leftIconExpanded.triangleUp=triangleUp
+attr.leftIconExpanded.triangleDown=triangleDown
+attr.leftIconExpanded.customURL=/resources/images/loading.gif
+attr.leftIconExpanded.null=
+attr.leftIconDisabled.grid=grid
+attr.leftIconDisabled.disc=disc
+attr.leftIconDisabled.chevronUp=chevronUp
+attr.leftIconDisabled.chevronDown=chevronDown
+attr.leftIconDisabled.triangle=triangle
+attr.leftIconDisabled.triangleUp=triangleUp
+attr.leftIconDisabled.triangleDown=triangleDown
+attr.leftIconDisabled.customURL=/resources/images/loading.gif
+attr.leftIconDisabled.null=
+attr.rightIconCollapsed.grid=grid
+attr.rightIconCollapsed.disc=disc
+attr.rightIconCollapsed.chevronUp=chevronUp
+attr.rightIconCollapsed.chevronDown=chevronDown
+attr.rightIconCollapsed.triangle=triangle
+attr.rightIconCollapsed.triangleUp=triangleUp
+attr.rightIconCollapsed.triangleDown=triangleDown
+attr.rightIconCollapsed.customURL=/resources/images/loading.gif
+attr.rightIconCollapsed.null=
+attr.rightIconExpanded.grid=grid
+attr.rightIconExpanded.disc=disc
+attr.rightIconExpanded.chevronUp=chevronUp
+attr.rightIconExpanded.chevronDown=chevronDown
+attr.rightIconExpanded.triangle=triangle
+attr.rightIconExpanded.triangleUp=triangleUp
+attr.rightIconExpanded.triangleDown=triangleDown
+attr.rightIconExpanded.customURL=/resources/images/loading.gif
+attr.rightIconExpanded.null=
+attr.rightIconDisabled.grid=grid
+attr.rightIconDisabled.disc=disc
+attr.rightIconDisabled.chevronUp=chevronUp
+attr.rightIconDisabled.chevronDown=chevronDown
+attr.rightIconDisabled.triangle=triangle
+attr.rightIconDisabled.triangleUp=triangleUp
+attr.rightIconDisabled.triangleDown=triangleDown
+attr.rightIconDisabled.customURL=/resources/images/loading.gif
+attr.rightIconDisabled.null=
\ No newline at end of file
Added: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.properties (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.properties 2011-01-26 16:18:40 UTC (rev 21239)
@@ -0,0 +1,40 @@
+attr.mode.client=client
+attr.mode.ajax=ajax
+attr.mode.server=server
+attr.mode.null=
+attr.leftIcon.grid=grid
+attr.leftIcon.disc=disc
+attr.leftIcon.chevronUp=chevronUp
+attr.leftIcon.chevronDown=chevronDown
+attr.leftIcon.triangle=triangle
+attr.leftIcon.triangleUp=triangleUp
+attr.leftIcon.triangleDown=triangleDown
+attr.leftIcon.customURL=/resources/images/loading.gif
+attr.leftIcon.null=
+attr.leftIconDisabled.grid=grid
+attr.leftIconDisabled.disc=disc
+attr.leftIconDisabled.chevronUp=chevronUp
+attr.leftIconDisabled.chevronDown=chevronDown
+attr.leftIconDisabled.triangle=triangle
+attr.leftIconDisabled.triangleUp=triangleUp
+attr.leftIconDisabled.triangleDown=triangleDown
+attr.leftIconDisabled.customURL=/resources/images/loading.gif
+attr.leftIconDisabled.null=
+attr.rightIcon.grid=grid
+attr.rightIcon.disc=disc
+attr.rightIcon.chevronUp=chevronUp
+attr.rightIcon.chevronDown=chevronDown
+attr.rightIcon.triangle=triangle
+attr.rightIcon.triangleUp=triangleUp
+attr.rightIcon.triangleDown=triangleDown
+attr.rightIcon.customURL=/resources/images/loading.gif
+attr.rightIcon.null=
+attr.rightIconDisabled.grid=grid
+attr.rightIconDisabled.disc=disc
+attr.rightIconDisabled.chevronUp=chevronUp
+attr.rightIconDisabled.chevronDown=chevronDown
+attr.rightIconDisabled.triangle=triangle
+attr.rightIconDisabled.triangleUp=triangleUp
+attr.rightIconDisabled.triangleDown=triangleDown
+attr.rightIconDisabled.customURL=/resources/images/loading.gif
+attr.rightIconDisabled.null=
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml 2011-01-26 16:17:34 UTC (rev 21238)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml 2011-01-26 16:18:40 UTC (rev 21239)
@@ -40,10 +40,7 @@
<ui:define name="component">
- <rich:panelMenu id="panelMenu" style="width: 250px; "
- action="#{richBean.dummyAction}"
- actionListener="#{richBean.dummyActionListener}"
- activeItem="#{richPanelMenuBean.attributes['activeItem'].value}"
+ <rich:panelMenu id="panelMenu" style="width: 250px;"
itemChangeListener="#{richPanelMenuBean.itemChangeListener}">
<rich:panelMenuGroup id="group1" name="group1" label="Group 1">
@@ -69,13 +66,14 @@
expanded="#{richPanelMenuGroupBean.attributes['expanded'].value}"
hoverClass="#{richPanelMenuGroupBean.attributes['hoverClass'].value}"
iconLeftClass="#{richPanelMenuGroupBean.attributes['iconLeftClass'].value}"
- iconLeftCollapsed="#{richPanelMenuGroupBean.attributes['iconLeftCollapsed'].value}"
- iconLeftDisabled="#{richPanelMenuGroupBean.attributes['iconLeftDisabled'].value}"
- iconLeftExpanded="#{richPanelMenuGroupBean.attributes['iconLeftExpanded'].value}"
- iconRightClass="#{richPanelMenuGroupBean.attributes['iconRightClass'].value}"
- iconRightCollapsed="#{richPanelMenuGroupBean.attributes['iconRightCollapsed'].value}"
- iconRightDisabled="#{richPanelMenuGroupBean.attributes['iconRightDisabled'].value}"
- iconRightExpanded="#{richPanelMenuGroupBean.attributes['iconRightExpanded'].value}"
+ leftIcon="#{richPanelMenuGroupBean.attributes['leftIcon'].value}"
+ leftIconCollapsed="#{richPanelMenuGroupBean.attributes['leftIconCollapsed'].value}"
+ leftIconDisabled="#{richPanelMenuGroupBean.attributes['leftIconDisabled'].value}"
+ leftIconExpanded="#{richPanelMenuGroupBean.attributes['leftIconExpanded'].value}"
+ rightIcon="#{richPanelMenuGroupBean.attributes['rightIcon'].value}"
+ rightIconCollapsed="#{richPanelMenuGroupBean.attributes['rightIconCollapsed'].value}"
+ rightIconDisabled="#{richPanelMenuGroupBean.attributes['rightIconDisabled'].value}"
+ rightIconExpanded="#{richPanelMenuGroupBean.attributes['rightIconExpanded'].value}"
immediate="#{richPanelMenuGroupBean.attributes['immediate'].value}"
limitRender="#{richPanelMenuGroupBean.attributes['limitRender'].value}"
mode="#{richPanelMenuGroupBean.attributes['mode'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml 2011-01-26 16:17:34 UTC (rev 21238)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml 2011-01-26 16:18:40 UTC (rev 21239)
@@ -57,12 +57,12 @@
disabledClass="#{richPanelMenuItemBean.attributes['disabledClass'].value}"
execute="#{richPanelMenuItemBean.attributes['disabledClass'].value}"
hoverClass="#{richPanelMenuItemBean.attributes['hoverClass'].value}"
- iconLeft="#{richPanelMenuItemBean.attributes['iconLeft'].value}"
- iconLeftClass="#{richPanelMenuItemBean.attributes['iconLeftClass'].value}"
- iconLeftDisabled="#{richPanelMenuItemBean.attributes['iconLeftDisabled'].value}"
- iconRight="#{richPanelMenuItemBean.attributes['iconRight'].value}"
- iconRightClass="#{richPanelMenuItemBean.attributes['iconRightClass'].value}"
- iconRightDisabled="#{richPanelMenuItemBean.attributes['iconRightDisabled'].value}"
+ leftIcon="#{richPanelMenuItemBean.attributes['leftIcon'].value}"
+ leftIconClass="#{richPanelMenuItemBean.attributes['leftIconClass'].value}"
+ leftIconDisabled="#{richPanelMenuItemBean.attributes['leftIconDisabled'].value}"
+ rightIcon="#{richPanelMenuItemBean.attributes['rightIcon'].value}"
+ rightIconClass="#{richPanelMenuItemBean.attributes['rightIconClass'].value}"
+ rightIconDisabled="#{richPanelMenuItemBean.attributes['rightIconDisabled'].value}"
immediate="#{richPanelMenuItemBean.attributes['immediate'].value}"
limitRender="#{richPanelMenuItemBean.attributes['limitRender'].value}"
mode="#{richPanelMenuItemBean.attributes['mode'].value}"
13 years, 11 months
JBoss Rich Faces SVN: r21238 - modules/tests/metamer/trunk/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-26 11:17:34 -0500 (Wed, 26 Jan 2011)
New Revision: 21238
Added:
modules/tests/metamer/trunk/ftest/find-new-issues.sh
modules/tests/metamer/trunk/ftest/issue-tracking-query.sh
Log:
added script for managing issue tracking
Added: modules/tests/metamer/trunk/ftest/find-new-issues.sh
===================================================================
--- modules/tests/metamer/trunk/ftest/find-new-issues.sh (rev 0)
+++ modules/tests/metamer/trunk/ftest/find-new-issues.sh 2011-01-26 16:17:34 UTC (rev 21238)
@@ -0,0 +1,4 @@
+#!/bin/bash
+echo "####################### NOT TRACKED ISSUES ###########################"
+find -name "stacktrace.txt" | sed -r 's#stacktrace.txt$#issues.txt#' | xargs ls 2>&1 | grep "cannot access" | sed -r 's#ls: cannot access \.\/target\/failures\/##' | sed -r 's#\/[^\/]+\/issues\.txt: No such file or directory$##'
+echo "######################################################################"
Added: modules/tests/metamer/trunk/ftest/issue-tracking-query.sh
===================================================================
--- modules/tests/metamer/trunk/ftest/issue-tracking-query.sh (rev 0)
+++ modules/tests/metamer/trunk/ftest/issue-tracking-query.sh 2011-01-26 16:17:34 UTC (rev 21238)
@@ -0,0 +1,13 @@
+#!/bin/bash
+issues=`find -name "issues.txt" -exec cat {} \; -exec echo '' \; | sed -r 's# #\n#' | sort | uniq | grep RF- | sed -r 's#.*/(RF-[0-9]+)#\1,#'`
+issues=`echo $issues | sed -r 's#,[^A-Z]*$##'`
+
+echo "===================================================================="
+echo "=============== ALL TRACKED ISSUES ================================="
+echo "===================================================================="
+echo "project = RF AND key in ($issues) AND status != Closed ORDER BY status DESC, key DESC"
+echo "===================================================================="
+echo "=============== ISSUES WHICH ARE NOT LABELED IN JIRA ==============="
+echo "===================================================================="
+echo "project = RF AND key in ($issues) AND status != Closed AND labels != "metamer-ftest-tracked" ORDER BY status DESC, key DESC"
+echo "===================================================================="
13 years, 11 months
JBoss Rich Faces SVN: r21237 - in trunk/ui/input/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-01-26 11:10:10 -0500 (Wed, 26 Jan 2011)
New Revision: 21237
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss
Log:
RF-9737 Select: attributes listHeight and listWidth ignored
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java 2011-01-26 15:32:15 UTC (rev 21236)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java 2011-01-26 16:10:10 UTC (rev 21237)
@@ -40,8 +40,4 @@
@Attribute()
public abstract String getMaxListHeight();
-
- @Attribute()
- public abstract String getListHeight();
-
}
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss 2011-01-26 15:32:15 UTC (rev 21236)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss 2011-01-26 16:10:10 UTC (rev 21237)
@@ -87,8 +87,6 @@
overflow: auto;
overflow-x: hidden;
width: 200px;
- max-height: 100px;
- min-height: 20px;
}
.rf-sel-opt{
13 years, 11 months
JBoss Rich Faces SVN: r21236 - in trunk/examples/richfaces-showcase/src/main: resources/org/richfaces/demo/data/common and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-01-26 10:32:15 -0500 (Wed, 26 Jan 2011)
New Revision: 21236
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsfValidators.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsr303.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsfValidators-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsr303-sample.xhtml
Removed:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml
Modified:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
Log:
CSV updates
Modified: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java 2011-01-26 15:24:37 UTC (rev 21235)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java 2011-01-26 15:32:15 UTC (rev 21236)
@@ -2,17 +2,37 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
+import javax.validation.constraints.AssertTrue;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Pattern;
+import org.hibernate.validator.constraints.Length;
+
@ManagedBean
@RequestScoped
public class ValidationBean {
+ @Length(min = 3, max = 12)
private String name = null;
+ @Pattern(regexp = "^[\\w\\-]([\\.\\w])+[\\w]+(a)([\\w\\-]+\\.)+[a-zA-Z]{2,4}$")
private String email = null;
+ @Min(value = 18)
+ @Max(value = 99)
private Integer age;
private String country;
private String jobTitle;
+ @AssertTrue
+ private boolean agreed;
+ public boolean isAgreed() {
+ return agreed;
+ }
+
+ public void setAgreed(boolean agreed) {
+ this.agreed = agreed;
+ }
+
public String getName() {
return name;
}
Modified: trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2011-01-26 15:24:37 UTC (rev 21235)
+++ trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2011-01-26 15:32:15 UTC (rev 21236)
@@ -177,12 +177,16 @@
<demos>
<demo new="true">
<id>clientValidation</id>
- <name>Ajax/Client Validation</name>
+ <name>Client Side Validation</name>
<samples>
<sample>
- <id>simple</id>
- <name>Simple Ajax Validation</name>
+ <id>jsfValidators</id>
+ <name>Standard JSF Validators</name>
</sample>
+ <sample>
+ <id>jsr303</id>
+ <name>JSR-303 Validators</name>
+ </sample>
</samples>
</demo>
</demos>
Copied: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsfValidators.xhtml (from rev 21226, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml)
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsfValidators.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsfValidators.xhtml 2011-01-26 15:32:15 UTC (rev 21236)
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition>
+ <p><b>RichFaces Client Validation</b> feature allows you to add
+ client side validation without writing any line of JavaScript!</p>
+ <p>All the JSF validators and JSR-303 standard validators will be
+ available on client side after just <b><rich:validator/></b> to
+ the inputs which you want to be validated at client side. If you using
+ any custom validators or some additional for example hibernate
+ validators which we not implemented in first version - Ajax fallback
+ mechanism will be used. It means that behavior will try to execute all
+ client vlidators available and then send Ajax request for unknown to
+ get results from server side.</p>
+ <p>In that sample - pay attention that no requests fired when
+ typing wrong values in first two fields. And Ajax request used to
+ validate the last one.</p>
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+ <fieldset>
+ <legend><b>Notes:</b></legend>
+ <ul>
+ <li>Some validators still not implemented. Them will start work transparently for you after new snapshots with implementations added</li>
+ <li>We will provide information about how to provide client validation for custom validators soon!</li>
+ </ul>
+ </fieldset>
+ <fieldset>
+ <legend><b>What to expect additionally:</b></legend>
+ After we will complete all standard validators migration and instructions for custom ones we plan to work on next features:
+ <ul>
+ <li>Client Validation for submit components to perform bulk form validation.</li>
+ <li>Ways of default validation definitions without usage of <b><rich:validator/></b> tag for every input.</li>
+ </ul>
+ </fieldset>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsr303.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsr303.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsr303.xhtml 2011-01-26 15:32:15 UTC (rev 21236)
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition>
+ <p><b>RichFaces Client Validation</b> feature allows you to add
+ client side validation without writing any line of JavaScript!</p>
+ <p>All the JSF validators and JSR-303 standard validators will be
+ available on client side after just <b><rich:validator/></b> to
+ the inputs which you want to be validated at client side. If you using
+ any custom validators or some additional for example hibernate
+ validators which we not implemented in first version - Ajax fallback
+ mechanism will be used. It means that behavior will try to execute all
+ client vlidators available and then send Ajax request for unknown to
+ get results from server side.</p>
+ <p>In that sample - pay attention that no requests fired when
+ typing wrong values in first two fields. And Ajax request used to
+ validate the last one.</p>
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+ <fieldset>
+ <legend><b>Notes:</b></legend>
+ <ul>
+ <li>Some validators still not implemented. Them will start work transparently for you after new snapshots with implementations added</li>
+ <li>We will provide information about how to provide client validation for custom validators soon!</li>
+ </ul>
+ </fieldset>
+ <fieldset>
+ <legend><b>What to expect additionally:</b></legend>
+ After we will complete all standard validators migration and instructions for custom ones we plan to work on next features:
+ <ul>
+ <li>Client Validation for submit components to perform bulk form validation.</li>
+ <li>Ways of default validation definitions without usage of <b><rich:validator/></b> tag for every input.</li>
+ </ul>
+ </fieldset>
+</ui:composition>
+</html>
\ No newline at end of file
Copied: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsfValidators-sample.xhtml (from rev 21226, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml)
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsfValidators-sample.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsfValidators-sample.xhtml 2011-01-26 15:32:15 UTC (rev 21236)
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <h:form>
+ <rich:panel>
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="User information" />
+ <a4j:status>
+ <f:facet name="start">
+ <h:graphicImage value="/images/ai.gif" style="height:12px;width:12px;"/>
+ </f:facet>
+ </a4j:status>
+ </h:panelGroup>
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{userBean.name}" id="name">
+ <f:validateLength minimum="3" maximum="8"/>
+ <f:validateRequired />
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="name" />
+ <h:outputText value="Email" />
+ <h:inputText value="#{userBean.email}" id="email" validatorMessage="bad email">
+ <f:validateRegex pattern="^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\-\.]+)(a)([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$" ></f:validateRegex>
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="email" />
+ <h:outputText value="Age" />
+ <h:inputText value="#{userBean.age}" id="age">
+ <f:validateLongRange minimum="3" maximum="18"/>
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="age" />
+ </h:panelGrid>
+ </rich:panel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsr303-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsr303-sample.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsr303-sample.xhtml 2011-01-26 15:32:15 UTC (rev 21236)
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <h:form>
+ <rich:panel>
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="User information" />
+ <a4j:status>
+ <f:facet name="start">
+ <h:graphicImage value="/images/ai.gif" style="height:12px;width:12px;"/>
+ </f:facet>
+ </a4j:status>
+ </h:panelGroup>
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}" id="name">
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="name" />
+ <h:outputText value="Email" />
+ <h:inputText value="#{validationBean.email}" id="email" validatorMessage="bad email">
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="email" />
+ <h:outputText value="Age" />
+ <h:inputText value="#{validationBean.age}" id="age">
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="age" />
+ <h:outputText value="I agree the terms" />
+ <h:selectBooleanCheckbox value="#{validationBean.agreed}" id="agreed">
+ <rich:validator/>
+ </h:selectBooleanCheckbox>
+ <rich:message for="agreed" />
+ </h:panelGrid>
+ </rich:panel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Deleted: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml 2011-01-26 15:24:37 UTC (rev 21235)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml 2011-01-26 15:32:15 UTC (rev 21236)
@@ -1,43 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich">
- <h:form>
- <rich:panel>
- <f:facet name="header">
- <h:panelGroup>
- <h:outputText value="User information" />
- <a4j:status>
- <f:facet name="start">
- <h:graphicImage value="/images/ai.gif" style="height:12px;width:12px;"/>
- </f:facet>
- </a4j:status>
- </h:panelGroup>
- </f:facet>
- <h:panelGrid columns="3">
- <h:outputText value="Name:" />
- <h:inputText value="#{validationBean.name}" id="name">
- <f:validateLength minimum="3" maximum="8"/>
- <f:validateRequired />
- <rich:validator />
- </h:inputText>
- <rich:message for="name" />
- <h:outputText value="Email" />
- <h:inputText value="#{validationBean.email}" id="email" validatorMessage="bad email">
- <f:validateRegex pattern="^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\-\.]+)(a)([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$" ></f:validateRegex>
- <rich:validator />
- </h:inputText>
- <rich:message for="email" />
- <h:outputText value="Age" />
- <h:inputText value="#{validationBean.age}" id="age">
- <f:validateLongRange minimum="3" maximum="18"/>
- <rich:validator />
- </h:inputText>
- <rich:message for="age" />
- </h:panelGrid>
- </rich:panel>
- </h:form>
-</ui:composition>
\ No newline at end of file
Deleted: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml 2011-01-26 15:24:37 UTC (rev 21235)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml 2011-01-26 15:32:15 UTC (rev 21236)
@@ -1,44 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-
-<ui:composition>
- <p><b>RichFaces Client Validation</b> feature allows you to add
- client side validation without writing any line of JavaScript!</p>
- <p>All the JSF validators and JSR-303 standard validators will be
- available on client side after just <b><rich:validator/></b> to
- the inputs which you want to be validated at client side. If you using
- any custom validators or some additional for example hibernate
- validators which we not implemented in first version - Ajax fallback
- mechanism will be used. It means that behavior will try to execute all
- client vlidators available and then send Ajax request for unknown to
- get results from server side.</p>
- <p>In that sample - pay attention that no requests fired when
- typing wrong values in first two fields. And Ajax request used to
- validate the last one.</p>
- <ui:include src="#{demoNavigator.sampleIncludeURI}" />
- <ui:include src="/templates/includes/source-view.xhtml">
- <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
- <ui:param name="sourceType" value="xhtml" />
- <ui:param name="openLabel" value="View Source" />
- <ui:param name="hideLabel" value="Hide Source" />
- </ui:include>
- <fieldset>
- <legend><b>Notes:</b></legend>
- <ul>
- <li>Some validators still not implemented. Them will start work transparently for you after new snapshots with implementations added</li>
- <li>We will provide information about how to provide client validation for custom validators soon!</li>
- </ul>
- </fieldset>
- <fieldset>
- <legend><b>What to expect additionally:</b></legend>
- After we will complete all standard validators migration and instructions for custom ones we plan to work on next features:
- <ul>
- <li>Client Validation for submit components to perform bulk form validation.</li>
- <li>Ways of default validation definitions without usage of <b><rich:validator/></b> tag for every input.</li>
- </ul>
- </fieldset>
-</ui:composition>
-</html>
\ No newline at end of file
13 years, 11 months