JBoss Rich Faces SVN: r21345 - in trunk/ui/output/ui/src/main/java/org/richfaces: renderkit/html and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-31 18:13:58 -0500 (Mon, 31 Jan 2011)
New Revision: 21345
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java
Log:
https://issues.jboss.org/browse/RF-10369
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java 2011-01-31 22:26:32 UTC (rev 21344)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java 2011-01-31 23:13:58 UTC (rev 21345)
@@ -145,30 +145,6 @@
// ------------------------------------------------ Html Attributes End
@Override
- public void encodeAll(FacesContext context) throws IOException {
- if (context == null) {
- throw new NullPointerException();
- }
-
- if (!isRendered()) {
- return;
- }
-
- encodeBegin(context);
- if (getMode() == TooltipMode.client) {
- if (getRendersChildren()) {
- encodeChildren(context);
- } else if (this.getChildCount() > 0) {
- for (UIComponent kid : getChildren()) {
- kid.encodeAll(context);
- }
- }
- }
-
- encodeEnd(context);
- }
-
- @Override
public boolean visitTree(VisitContext context, VisitCallback callback) {
if (context instanceof ExtendedVisitContext) {
ExtendedVisitContext extendedVisitContext = (ExtendedVisitContext) context;
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java 2011-01-31 22:26:32 UTC (rev 21344)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java 2011-01-31 23:13:58 UTC (rev 21345)
@@ -23,6 +23,23 @@
package org.richfaces.renderkit.html;
+import static org.richfaces.renderkit.HtmlConstants.CLASS_ATTRIBUTE;
+import static org.richfaces.renderkit.HtmlConstants.ID_ATTRIBUTE;
+import static org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributes;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.PartialResponseWriter;
+import javax.faces.context.ResponseWriter;
+
import org.ajax4jsf.javascript.JSObject;
import org.richfaces.TooltipMode;
import org.richfaces.cdk.annotations.JsfRenderer;
@@ -32,22 +49,6 @@
import org.richfaces.renderkit.MetaComponentRenderer;
import org.richfaces.renderkit.util.RendererUtils;
-import javax.faces.application.ResourceDependencies;
-import javax.faces.application.ResourceDependency;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.PartialResponseWriter;
-import javax.faces.context.ResponseWriter;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.richfaces.renderkit.HtmlConstants.CLASS_ATTRIBUTE;
-import static org.richfaces.renderkit.HtmlConstants.ID_ATTRIBUTE;
-import static org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributes;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
-
/**
* @author amarkhel
* @since 2010-10-24
@@ -238,6 +239,25 @@
return AbstractTooltip.class;
}
+ @Override
+ protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component)
+ throws IOException {
+
+ AbstractTooltip tooltip = (AbstractTooltip) component;
+
+ if (tooltip.getMode() == TooltipMode.client) {
+ if (tooltip.getChildCount() > 0) {
+ for (UIComponent kid : tooltip.getChildren()) {
+ kid.encodeAll(context);
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean getRendersChildren() {
+ return true;
+ }
}
13 years, 11 months
JBoss Rich Faces SVN: r21344 - in trunk/ui/validator/ui/src/main: java/org/richfaces/renderkit and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-01-31 17:26:32 -0500 (Mon, 31 Jan 2011)
New Revision: 21344
Added:
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageForRender.java
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageTransformer.java
Removed:
trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-message.js
Modified:
trunk/ui/validator/ui/src/main/config/faces-config.xml
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageRendererBase.java
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/FormClientValidatorRenderer.java
trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/message.js
trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js
Log:
RESOLVED - issue RF-10309: CSV: not working JSF validators.
https://issues.jboss.org/browse/RF-10309
Modified: trunk/ui/validator/ui/src/main/config/faces-config.xml
===================================================================
--- trunk/ui/validator/ui/src/main/config/faces-config.xml 2011-01-31 22:26:18 UTC (rev 21343)
+++ trunk/ui/validator/ui/src/main/config/faces-config.xml 2011-01-31 22:26:32 UTC (rev 21344)
@@ -20,7 +20,11 @@
<client-behavior-renderer-type>org.richfaces.ClientValidatorRenderer</client-behavior-renderer-type>
<client-behavior-renderer-class>org.richfaces.renderkit.html.ClientValidatorRenderer</client-behavior-renderer-class>
</client-behavior-renderer>
- </render-kit>
+ <client-behavior-renderer>
+ <client-behavior-renderer-type>org.richfaces.FormValidatorRenderer</client-behavior-renderer-type>
+ <client-behavior-renderer-class>org.richfaces.renderkit.html.FormClientValidatorRenderer</client-behavior-renderer-class>
+ </client-behavior-renderer>
+ </render-kit>
<faces-config-extension>
<cdk:taglib>
<cdk:shortName>csv</cdk:shortName>
Added: trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageForRender.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageForRender.java (rev 0)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageForRender.java 2011-01-31 22:26:32 UTC (rev 21344)
@@ -0,0 +1,79 @@
+package org.richfaces.renderkit;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
+
+public class MessageForRender {
+
+ private final FacesMessage msg;
+ private final String sourceId;
+
+ public MessageForRender(FacesMessage msg, String sourceId) {
+ this.msg = msg;
+ this.sourceId = sourceId;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return
+ * @see javax.faces.application.FacesMessage#getDetail()
+ */
+ public String getDetail() {
+ return this.msg.getDetail();
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return
+ * @see javax.faces.application.FacesMessage#getSeverity()
+ */
+ public Severity getSeverity() {
+ return this.msg.getSeverity();
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return
+ * @see javax.faces.application.FacesMessage#getSummary()
+ */
+ public String getSummary() {
+ return this.msg.getSummary();
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return
+ * @see javax.faces.application.FacesMessage#isRendered()
+ */
+ public boolean isRendered() {
+ return this.msg.isRendered();
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @see javax.faces.application.FacesMessage#rendered()
+ */
+ public void rendered() {
+ this.msg.rendered();
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return the sourceId
+ */
+ public String getSourceId() {
+ return sourceId;
+ }
+}
Property changes on: trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageForRender.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageRendererBase.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageRendererBase.java 2011-01-31 22:26:18 UTC (rev 21343)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageRendererBase.java 2011-01-31 22:26:32 UTC (rev 21344)
@@ -64,9 +64,9 @@
FacesMessage.SEVERITY_ERROR, attrs("error", "err", null), FacesMessage.SEVERITY_FATAL,
attrs("fatal", "ftl", null));
- protected Iterator<FacesMessage> getMessages(FacesContext context, String forClientId, UIComponent component) {
+ protected Iterator<MessageForRender> getMessages(FacesContext context, String forClientId, UIComponent component) {
- Iterator<FacesMessage> msgIter;
+ Iterator<MessageForRender> msgIter;
if (forClientId != null) {
@@ -76,20 +76,32 @@
if (result == null) {
msgIter = Iterators.emptyIterator();
} else {
- msgIter = context.getMessages(result.getClientId(context));
+ String clientId = result.getClientId(context);
+ msgIter = getMessagesForId(context, clientId);
}
} else {
- msgIter = context.getMessages(null);
+ msgIter = getMessagesForId(context, null);
}
} else {
- msgIter = context.getMessages();
+ msgIter = Iterators.emptyIterator();
+ Iterator<String> clientIdsWithMessages = context.getClientIdsWithMessages();
+ while (clientIdsWithMessages.hasNext()) {
+ String clientId = (String) clientIdsWithMessages.next();
+ msgIter = Iterators.concat(msgIter,getMessagesForId(context, clientId));
+ }
}
return msgIter;
}
+ private Iterator<MessageForRender> getMessagesForId(FacesContext context, String clientId) {
+ Iterator<MessageForRender> msgIter;
+ msgIter = Iterators.transform(context.getMessages(clientId),new MessageTransformer(null==clientId?"":clientId));
+ return msgIter;
+ }
+
/**
* <p class="changed_added_4_0">
* TODO - make Generator aware of Iterator.
@@ -99,24 +111,29 @@
* @param component
* @return
*/
- protected Iterable<FacesMessage> getVisibleMessages(FacesContext context, UIComponent component) {
+ protected Iterable<MessageForRender> getVisibleMessages(FacesContext context, UIComponent component) {
String forId = getFor(component);
- Iterator<FacesMessage> messages = getMessages(context, forId, component);
- UnmodifiableIterator<FacesMessage> filteredMessages =
+ Iterator<MessageForRender> messages = getMessages(context, forId, component);
+ UnmodifiableIterator<MessageForRender> filteredMessages =
Iterators.filter(messages, getMessagesLevelFilter(context, component));
return Lists.newArrayList(filteredMessages);
}
- private Predicate<FacesMessage> getMessagesLevelFilter(FacesContext context, UIComponent component) {
+ private Predicate<MessageForRender> getMessagesLevelFilter(FacesContext context, UIComponent component) {
final Severity level = getLevel(component);
final boolean displayAll = component instanceof UIMessages;
- Predicate<FacesMessage> predicate = new Predicate<FacesMessage>() {
+ final boolean redisplay = Boolean.TRUE.equals(component.getAttributes().get("redisplay"));
+ Predicate<MessageForRender> predicate = new Predicate<MessageForRender>() {
private int count = 0;
- public boolean apply(FacesMessage input) {
- if(input.getSeverity().compareTo(level) >= 0){
- return displayAll||0 == count++;
+
+ public boolean apply(MessageForRender input) {
+ if (redisplay || !input.isRendered()) {
+ if (input.getSeverity().compareTo(level) >= 0) {
+ return displayAll || 0 == count++;
+ }
+
}
return false;
}
@@ -150,7 +167,7 @@
protected void encodeMessage(FacesContext facesContext, UIComponent component, Object msg) throws IOException {
// TODO fix generator to properly detect iteration variable type
- FacesMessage message = (FacesMessage) msg;
+ MessageForRender message = (MessageForRender) msg;
String summary = message.getSummary();
String detail = message.getDetail();
boolean showSummary = true;
@@ -165,6 +182,8 @@
showDetail = uiMessages.isShowDetail();
}
ResponseWriter responseWriter = facesContext.getResponseWriter();
+ // Message id
+ responseWriter.writeAttribute("id", component.getClientId()+':'+message.getSourceId(),null);
// tooltip
boolean wroteTooltip = Boolean.TRUE.equals(component.getAttributes().get("tooltip"));
if(wroteTooltip && !Strings.isNullOrEmpty(summary)){
@@ -176,6 +195,7 @@
if (showDetail) {
writeMessageLabel(responseWriter, detail, "rf-msg-des");
}
+ message.rendered();
}
private void writeMessageLabel(ResponseWriter responseWriter, String label, String styleClass) throws IOException {
@@ -219,7 +239,7 @@
}
protected String getMsgClass(FacesContext facesContext, UIComponent component, Object msg) throws IOException {
- FacesMessage message = (FacesMessage) msg;
+ MessageForRender message = (MessageForRender) msg;
SeverityAttributes severityAttributes = SEVERITY_MAP.get(message.getSeverity());
String styleClass =
buildSeverityAttribute(component, severityAttributes.skinClass, severityAttributes.classAttribute, ' ');
@@ -227,7 +247,7 @@
}
protected String getMsgStyle(FacesContext facesContext, UIComponent component, Object msg) throws IOException {
- FacesMessage message = (FacesMessage) msg;
+ MessageForRender message = (MessageForRender) msg;
SeverityAttributes severityAttributes = SEVERITY_MAP.get(message.getSeverity());
String style =
buildSeverityAttribute(component, severityAttributes.skinStyle, severityAttributes.styleAttribute, ';');
@@ -251,7 +271,7 @@
static SeverityAttributes attrs(String attPrefix, String skinSuffix, String skinStyle) {
SeverityAttributes attrs =
- new SeverityAttributes(attPrefix + "Style", attPrefix + "Class", "rf-msg-" + skinSuffix, skinStyle, null,
+ new SeverityAttributes(attPrefix + "Style", attPrefix + "Class", skinStyle, "rf-msg-" + skinSuffix, null,
null);
return attrs;
}
Added: trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageTransformer.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageTransformer.java (rev 0)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageTransformer.java 2011-01-31 22:26:32 UTC (rev 21344)
@@ -0,0 +1,19 @@
+package org.richfaces.renderkit;
+
+import javax.faces.application.FacesMessage;
+
+import com.google.common.base.Function;
+
+public class MessageTransformer implements Function<FacesMessage, MessageForRender> {
+
+ private final String sourceId;
+
+ public MessageTransformer(String sourceId) {
+ this.sourceId = sourceId;
+ }
+
+ public MessageForRender apply(FacesMessage input) {
+ return new MessageForRender(input, sourceId);
+ }
+
+}
Property changes on: trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageTransformer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/FormClientValidatorRenderer.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/FormClientValidatorRenderer.java 2011-01-31 22:26:18 UTC (rev 21343)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/FormClientValidatorRenderer.java 2011-01-31 22:26:32 UTC (rev 21344)
@@ -32,6 +32,6 @@
*/
public class FormClientValidatorRenderer extends ClientBehaviorRenderer {
- public static final String RENDERER_TYPE="orf.richfaces.FormValidatorRenderer";
+ public static final String RENDERER_TYPE="org.richfaces.FormValidatorRenderer";
}
Modified: trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/message.js
===================================================================
--- trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/message.js 2011-01-31 22:26:18 UTC (rev 21343)
+++ trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/message.js 2011-01-31 22:26:32 UTC (rev 21344)
@@ -49,30 +49,28 @@
};
var severetyClasses=["rf-msg-inf","rf-msg-wrn","rf-msg-err","rf-msg-ftl"];
- var componentHash = {};
- var componentIndex = 0;
var onMessage = function (event, element, data) {
var content = $(rf.getDomElement(this.id));
+ var sourceId = data.sourceId;
+ var message = data.message;
if (!this.options.forComponentId) {
- var index = componentHash[data.sourceId];
- if (typeof index != undefined) {
- $(rf.getDomElement(this.id+index)).remove();
+ if (!message) {
+ // rf.csv.clearMessage
+ $(rf.getDomElement(this.id+':'+sourceId)).remove();
+ } else {
+ renderMessage.call(this,sourceId,message);
}
- componentIndex ++;
- renderMessage.call(this,componentIndex,data.message);
- componentHash[data.sourceId] = componentIndex;
-
- } else if (this.options.forComponentId==data.sourceId) {
+ } else if (this.options.forComponentId === sourceId) {
content.empty();
- renderMessage.call(this,0,data.message);
+ renderMessage.call(this,sourceId,message);
}
}
var renderMessage = function(index,message){
if(message && message.severity >= this.options.level){
var content = $(rf.getDomElement(this.id));
- var msgContent = "<span class='"+severetyClasses[message.severity]+"' id='"+this.id+index+"'";
+ var msgContent = "<span class='"+severetyClasses[message.severity]+"' id='"+this.id+':'+index+"'";
if(message.summary){
if(this.options.tooltip){
msgContent = msgContent+" title='"+message.summary+"'>";
Modified: trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js
===================================================================
--- trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js 2011-01-31 22:26:18 UTC (rev 21343)
+++ trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js 2011-01-31 22:26:32 UTC (rev 21344)
@@ -69,6 +69,7 @@
var value = __getValue(element || id);
var convertedValue;
var converter = params.c;
+ rf.csv.clearMessage(id);
if (converter) {
try {
if (converter.f)
@@ -99,8 +100,6 @@
}
if(!params.da && params.a){
params.a.call(element,event,id);
- } else {
- rf.csv.clearMessage(id);
}
return true;
},
@@ -162,8 +161,8 @@
});
var validateRange = function(value,label,params,msg) {
- var isMinSet = typeof params.minimum == "number" ;//&& params.minimum >0;
- var isMaxSet = typeof params.maximum == "number" ;//&& params.maximum >0;
+ var isMinSet = typeof params.minimum === "number" ;//&& params.minimum >0;
+ var isMaxSet = typeof params.maximum === "number" ;//&& params.maximum >0;
if (isMaxSet && value > params.maximum) {
throw rf.csv.interpolateMessage(msg,isMinSet?[params.minimum,params.maximum,label]:[params.maximum,label]);
Deleted: trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-message.js
===================================================================
--- trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-message.js 2011-01-31 22:26:18 UTC (rev 21343)
+++ trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-message.js 2011-01-31 22:26:32 UTC (rev 21344)
@@ -1,77 +0,0 @@
-(function($, rf) {
-
- rf.ui = rf.ui || {};
-
- // Constructor definition
- rf.ui.Base = function(componentId, options, defaultOptions) {
- this.namespace = "."+rf.Event.createNamespace(this.name, componentId);
- // call constructor of parent class
- $super.constructor.call(this, componentId);
- this.options = $.extend(this.options, defaultOptions, options);
- this.attachToDom();
- this.__bindEventHandlers();
- };
-
- // Extend component class and add protected methods from parent class to our container
- rf.BaseComponent.extend(rf.ui.Base);
-
- // define super class link
- var $super = rf.ui.Base.$super;
-
- $.extend(rf.ui.Base.prototype, {
- __bindEventHandlers: function () {
- },
- destroy: function () {
- rf.Event.unbindById(this.id, this.namespace);
- $super.destroy.call(this);
- }
- });
-
-})(jQuery, window.RichFaces || (window.RichFaces={}));
-
-(function($, rf) {
-
- // Constructor definition
- rf.ui.Message = function(componentId, options) {
- // call constructor of parent class
- $super.constructor.call(this, componentId, options, defaultOptions);
- };
-
- // Extend component class and add protected methods from parent class to our container
- rf.ui.Base.extend(rf.ui.Message);
-
- // define super class link
- var $super = rf.ui.Message.$super;
-
- var defaultOptions = {
-
- };
-
- var componentHash = {};
- var componentIndex = 0;
-
- var onMessage = function (event, element, data) {
- if (!this.options.forComponentId) {
- var index = componentHash[data.sourceId];
- if (typeof index != undefined) {
- $(rf.getDomElement(this.id+index)).remove();
- }
- var content = content = $(rf.getDomElement(this.id));
-
- componentIndex ++;
- if (data.message) content.append('<li id="'+this.id+componentIndex+'">'+data.message.summary+'</li>');
- componentHash[data.sourceId] = componentIndex;
-
- } else if (this.options.forComponentId==data.sourceId) {
- rf.getDomElement(this.id).innerHTML = data.message ? '<li>'+data.message.summary+'</li>' : '';
- }
- }
-
- $.extend(rf.ui.Message.prototype, {
- name: "Message",
- __bindEventHandlers: function () {
- rf.Event.bind(window.document, rf.Event.MESSAGE_EVENT_TYPE+this.namespace, onMessage, this);
- }
- });
-
-})(jQuery, window.RichFaces || (window.RichFaces={}));
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r21343 - trunk/examples/validator-demo/src/main/webapp/examples.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-01-31 17:26:18 -0500 (Mon, 31 Jan 2011)
New Revision: 21343
Modified:
trunk/examples/validator-demo/src/main/webapp/examples/faces-validators.xhtml
Log:
RESOLVED - issue RF-10309: CSV: not working JSF validators.
https://issues.jboss.org/browse/RF-10309
Modified: trunk/examples/validator-demo/src/main/webapp/examples/faces-validators.xhtml
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/examples/faces-validators.xhtml 2011-01-31 18:56:44 UTC (rev 21342)
+++ trunk/examples/validator-demo/src/main/webapp/examples/faces-validators.xhtml 2011-01-31 22:26:18 UTC (rev 21343)
@@ -14,13 +14,30 @@
<ui:define name="content">
<h:form id="form">
<h:panelGrid columns="4">
- <h:outputLabel for="text" value="Text length from 1 to 3:" />
- <h:inputText id="text" value="#{test.value}">
+ <h:outputLabel for="length" value="Text length from 1 to 3:" />
+ <h:inputText id="length" value="#{test.value}">
<f:validateLength minimum="1" maximum="3" />
<csv:validator event="blur" />
</h:inputText>
- <h:outputText id="out" value="#{test.value}"></h:outputText>
- <csv:message id="uiMessage" for="text" />
+ <h:outputText id="lengthOut" value="#{test.value}"></h:outputText>
+ <csv:message for="length" />
+
+ <h:outputLabel for="dblrange" value="Text dblrange from 1.0 to 3.0:" />
+ <h:inputText id="dblrange" value="#{test.doubleValue}">
+ <f:validateDoubleRange minimum="1" maximum="3" />
+ <csv:validator event="blur" />
+ </h:inputText>
+ <h:outputText id="dblrangeOut" value="#{test.doubleValue}"></h:outputText>
+ <csv:message for="dblrange" />
+
+ <h:outputLabel for="longrange" value="Text long range from 2 to 5:" />
+ <h:inputText id="longrange" value="#{test.longValue}">
+ <f:validateLongRange minimum="2" maximum="5" />
+ <csv:validator event="blur" />
+ </h:inputText>
+ <h:outputText id="longrangeOut" value="#{test.longValue}"></h:outputText>
+ <csv:message for="longrange" />
+
</h:panelGrid>
<h:commandButton value="Submit">
<csv:validator/>
13 years, 11 months
JBoss Rich Faces SVN: r21342 - trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-31 13:56:44 -0500 (Mon, 31 Jan 2011)
New Revision: 21342
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
Log:
https://issues.jboss.org/browse/RF-10314
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2011-01-31 18:49:42 UTC (rev 21341)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2011-01-31 18:56:44 UTC (rev 21342)
@@ -80,11 +80,14 @@
if (panelItem != null) {
new ActionEvent(panelItem).queue();
- //TODO nick - why render item by default?
- context.getPartialViewContext().getRenderIds().add(panelItem.getClientId(context));
-
- //TODO nick - this should be done on encode, not on decode
- addOnCompleteParam(context, panelItem.getClientId(context));
+ if (context.getPartialViewContext().isPartialRequest()) {
+
+ //TODO nick - why render item by default?
+ context.getPartialViewContext().getRenderIds().add(panelItem.getClientId(context));
+
+ //TODO nick - this should be done on encode, not on decode
+ addOnCompleteParam(context, panelItem.getClientId(context));
+ }
}
}
}
13 years, 11 months
JBoss Rich Faces SVN: r21341 - trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-31 13:49:42 -0500 (Mon, 31 Jan 2011)
New Revision: 21341
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js
Log:
https://issues.jboss.org/browse/RF-10314
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js 2011-01-31 17:48:33 UTC (rev 21340)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js 2011-01-31 18:49:42 UTC (rev 21341)
@@ -62,7 +62,11 @@
execServer : function (item) {
item.__changeState();
//TODO nick - 'target' attribute?
- rf.submitForm(this.__getParentForm(item));
+
+ var params = {};
+ params[item.__panelMenu().id] = item.itemName;
+
+ rf.submitForm(this.__getParentForm(item), params);
return false;
},
13 years, 11 months
JBoss Rich Faces SVN: r21340 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richTree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-31 12:48:33 -0500 (Mon, 31 Jan 2011)
New Revision: 21340
Added:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeNodeBean.properties
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
Log:
attribute cleaning
Added: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeNodeBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeNodeBean.properties (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeNodeBean.properties 2011-01-31 17:48:33 UTC (rev 21340)
@@ -0,0 +1,5 @@
+attr.dir.rtl=RTL
+attr.dir.ltr=LTR
+attr.dir.null=
+
+
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-01-31 17:40:30 UTC (rev 21339)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-01-31 17:48:33 UTC (rev 21340)
@@ -51,10 +51,24 @@
nodeType="#{node.type}"
var="node"
value="#{richTreeBean.root}"
+ selection="#{richTreeBean.selection}"
+ selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
+ toggleListener="#{richTreeListenerBean.processToggle}"
+ data="#{richTreeBean.attributes['data'].value}"
dir="#{richTreeBean.attributes['dir'].value}"
+ execute="#{richTreeBean.attributes['execute'].value}"
+ handleClass="#{richTreeBean.attributes['handleClass'].value}"
+ iconClass="#{richTreeBean.attributes['iconClass'].value}"
+ iconCollapsed="#{richTreeBean.attributes['iconCollapsed'].value}"
+ iconExpanded="#{richTreeBean.attributes['iconExpanded'].value}"
+ iconLeaf="#{richTreeBean.attributes['iconLeaf'].value}"
+ immediate="#{richTreeBean.attributes['immediate'].value}"
+ keepSaved="#{richTreeBean.attributes['keepSaved'].value}"
+ labelClass="#{richTreeBean.attributes['labelClass'].value}"
lang="#{richTreeBean.attributes['lang'].value}"
- data="#{richTreeBean.attributes['data'].value}"
+ limitRender="#{richTreeBean.attributes['limitRender'].value}"
+ nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
onbeforedomupdate="#{richTreeBean.attributes['onbeforedomupdate'].value}"
onbeforenodetoggle="#{richTreeBean.attributes['onbeforenodetoggle'].value}"
onbeforeselectionchange="#{richTreeBean.attributes['onbeforeselectionchange'].value}"
@@ -67,45 +81,50 @@
onkeyup="#{richTreeBean.attributes['onkeyup'].value}"
onmousedown="#{richTreeBean.attributes['onmousedown'].value}"
onmousemove="#{richTreeBean.attributes['onmousemove'].value}"
- onmouseup="#{richTreeBean.attributes['onmouseup'].value}"
onmouseout="#{richTreeBean.attributes['onmouseout'].value}"
onmouseover="#{richTreeBean.attributes['onmouseover'].value}"
+ onmouseup="#{richTreeBean.attributes['onmouseup'].value}"
onnodetoggle="#{richTreeBean.attributes['onnodetoggle'].value}"
onselectionchange="#{richTreeBean.attributes['onselectionchange'].value}"
+ render="#{richTreeBean.attributes['render'].value}"
rendered="#{richTreeBean.attributes['rendered'].value}"
- selection="#{richTreeBean.selection}"
selectionType="#{richTreeBean.attributes['selectionType'].value}"
+ status="#{richTreeBean.attributes['status'].value}"
style="#{richTreeBean.attributes['style'].value}"
styleClass="#{richTreeBean.attributes['styleClass'].value}"
title="#{richTreeBean.attributes['title'].value}"
+ toggleNodeEvent="#{richTreeBean.attributes['toggleNodeEvent'].value}"
toggleType="#{richTreeBean.attributes['toggleType'].value}"
- iconLeaf="#{richTreeBean.attributes['iconLeaf'].value}"
- iconExpanded="#{richTreeBean.attributes['iconExpanded'].value}"
- iconCollapsed="#{richTreeBean.attributes['iconCollapsed'].value}"
- handleClass="#{richTreeBean.attributes['handleClass'].value}"
- iconClass="#{richTreeBean.attributes['iconClass'].value}"
- labelClass="#{richTreeBean.attributes['labelClass'].value}"
- nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
- selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
- toggleListener="#{richTreeListenerBean.processToggle}"
- render="#{richTreeBean.attributes['render'].value}"
- execute="#{richTreeBean.attributes['execute'].value}"
- toggleNodeEvent="#{richTreeBean.attributes['toggleNodeEvent'].value}"
- limitRender="#{richTreeBean.attributes['limitRender'].value}"
- status="#{richTreeBean.attributes['status'].value}"
- immediate="#{richTreeBean.attributes['immediate'].value}"
>
<rich:treeNode type="country"
expanded="#{richTreeBean.expanded[node]}"
- rendered="#{richTreeNodeBean.attributes[0]['rendered'].value}"
- iconLeaf="#{richTreeNodeBean.attributes[0]['iconLeaf'].value}"
- iconExpanded="#{richTreeNodeBean.attributes[0]['iconExpanded'].value}"
- iconCollapsed="#{richTreeNodeBean.attributes[0]['iconCollapsed'].value}"
+
+ dir="#{richTreeNodeBean.attributes[0]['dir'].value}"
handleClass="#{richTreeNodeBean.attributes[0]['handleClass'].value}"
iconClass="#{richTreeNodeBean.attributes[0]['iconClass'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[0]['iconCollapsed'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[0]['iconExpanded'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[0]['iconLeaf'].value}"
+ immediate="#{richTreeNodeBean.attributes[0]['immediate'].value}"
labelClass="#{richTreeNodeBean.attributes[0]['labelClass'].value}"
+ lang="#{richTreeNodeBean.attributes[0]['lang'].value}"
+ onbeforetoggle="#{richTreeNodeBean.attributes[0]['onbeforetoggle'].value}"
+ onclick="#{richTreeNodeBean.attributes[0]['onclick'].value}"
+ ondblclick="#{richTreeNodeBean.attributes[0]['ondblclick'].value}"
+ onkeydown="#{richTreeNodeBean.attributes[0]['onkeydown'].value}"
+ onkeypress="#{richTreeNodeBean.attributes[0]['onkeypress'].value}"
+ onkeyup="#{richTreeNodeBean.attributes[0]['onkeyup'].value}"
+ onmousedown="#{richTreeNodeBean.attributes[0]['onmousedown'].value}"
+ onmousemove="#{richTreeNodeBean.attributes[0]['onmousemove'].value}"
+ onmouseout="#{richTreeNodeBean.attributes[0]['onmouseout'].value}"
+ onmouseover="#{richTreeNodeBean.attributes[0]['onmouseover'].value}"
+ onomouseup="#{richTreeNodeBean.attributes[0]['onomouseup'].value}"
+ ontoggle="#{richTreeNodeBean.attributes[0]['ontoggle'].value}"
+ rendered="#{richTreeNodeBean.attributes[0]['rendered'].value}"
+ style="#{richTreeNodeBean.attributes[0]['style'].value}"
styleClass="#{richTreeNodeBean.attributes[0]['styleClass'].value}"
+ title="#{richTreeNodeBean.attributes[0]['title'].value}"
>
<f:facet name="handleLoading">
<h:graphicImage value="/resources/images/loading.gif" rendered="#{richTreeBean.testLoadingFacet}" />
@@ -114,16 +133,33 @@
</rich:treeNode>
<rich:treeNode type="company"
- icon="/images/tree/disc.gif"
expanded="#{richTreeBean.expanded[node]}"
- rendered="#{richTreeNodeBean.attributes[1]['rendered'].value}"
- iconLeaf="#{richTreeNodeBean.attributes[1]['iconLeaf'].value}"
- iconExpanded="#{richTreeNodeBean.attributes[1]['iconExpanded'].value}"
- iconCollapsed="#{richTreeNodeBean.attributes[1]['iconCollapsed'].value}"
+
+ dir="#{richTreeNodeBean.attributes[1]['dir'].value}"
handleClass="#{richTreeNodeBean.attributes[1]['handleClass'].value}"
iconClass="#{richTreeNodeBean.attributes[1]['iconClass'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[1]['iconCollapsed'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[1]['iconExpanded'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[1]['iconLeaf'].value}"
+ immediate="#{richTreeNodeBean.attributes[1]['immediate'].value}"
labelClass="#{richTreeNodeBean.attributes[1]['labelClass'].value}"
+ lang="#{richTreeNodeBean.attributes[1]['lang'].value}"
+ onbeforetoggle="#{richTreeNodeBean.attributes[1]['onbeforetoggle'].value}"
+ onclick="#{richTreeNodeBean.attributes[1]['onclick'].value}"
+ ondblclick="#{richTreeNodeBean.attributes[1]['ondblclick'].value}"
+ onkeydown="#{richTreeNodeBean.attributes[1]['onkeydown'].value}"
+ onkeypress="#{richTreeNodeBean.attributes[1]['onkeypress'].value}"
+ onkeyup="#{richTreeNodeBean.attributes[1]['onkeyup'].value}"
+ onmousedown="#{richTreeNodeBean.attributes[1]['onmousedown'].value}"
+ onmousemove="#{richTreeNodeBean.attributes[1]['onmousemove'].value}"
+ onmouseout="#{richTreeNodeBean.attributes[1]['onmouseout'].value}"
+ onmouseover="#{richTreeNodeBean.attributes[1]['onmouseover'].value}"
+ onomouseup="#{richTreeNodeBean.attributes[1]['onomouseup'].value}"
+ ontoggle="#{richTreeNodeBean.attributes[1]['ontoggle'].value}"
+ rendered="#{richTreeNodeBean.attributes[1]['rendered'].value}"
+ style="#{richTreeNodeBean.attributes[1]['style'].value}"
styleClass="#{richTreeNodeBean.attributes[1]['styleClass'].value}"
+ title="#{richTreeNodeBean.attributes[1]['title'].value}"
>
<f:facet name="handleLoading">
<h:graphicImage value="/resources/images/loading.gif" rendered="#{richTreeBean.testLoadingFacet}" />
@@ -133,16 +169,33 @@
</rich:treeNode>
<rich:treeNode type="cd"
- icon="/images/tree/song.gif"
expanded="#{richTreeBean.expanded[node]}"
- rendered="#{richTreeNodeBean.attributes[2]['rendered'].value}"
- iconLeaf="#{richTreeNodeBean.attributes[2]['iconLeaf'].value}"
- iconExpanded="#{richTreeNodeBean.attributes[2]['iconExpanded'].value}"
- iconCollapsed="#{richTreeNodeBean.attributes[2]['iconCollapsed'].value}"
+
+ dir="#{richTreeNodeBean.attributes[2]['dir'].value}"
handleClass="#{richTreeNodeBean.attributes[2]['handleClass'].value}"
iconClass="#{richTreeNodeBean.attributes[2]['iconClass'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[2]['iconCollapsed'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[2]['iconExpanded'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[2]['iconLeaf'].value}"
+ immediate="#{richTreeNodeBean.attributes[2]['immediate'].value}"
labelClass="#{richTreeNodeBean.attributes[2]['labelClass'].value}"
+ lang="#{richTreeNodeBean.attributes[2]['lang'].value}"
+ onbeforetoggle="#{richTreeNodeBean.attributes[2]['onbeforetoggle'].value}"
+ onclick="#{richTreeNodeBean.attributes[2]['onclick'].value}"
+ ondblclick="#{richTreeNodeBean.attributes[2]['ondblclick'].value}"
+ onkeydown="#{richTreeNodeBean.attributes[2]['onkeydown'].value}"
+ onkeypress="#{richTreeNodeBean.attributes[2]['onkeypress'].value}"
+ onkeyup="#{richTreeNodeBean.attributes[2]['onkeyup'].value}"
+ onmousedown="#{richTreeNodeBean.attributes[2]['onmousedown'].value}"
+ onmousemove="#{richTreeNodeBean.attributes[2]['onmousemove'].value}"
+ onmouseout="#{richTreeNodeBean.attributes[2]['onmouseout'].value}"
+ onmouseover="#{richTreeNodeBean.attributes[2]['onmouseover'].value}"
+ onomouseup="#{richTreeNodeBean.attributes[2]['onomouseup'].value}"
+ ontoggle="#{richTreeNodeBean.attributes[2]['ontoggle'].value}"
+ rendered="#{richTreeNodeBean.attributes[2]['rendered'].value}"
+ style="#{richTreeNodeBean.attributes[2]['style'].value}"
styleClass="#{richTreeNodeBean.attributes[2]['styleClass'].value}"
+ title="#{richTreeNodeBean.attributes[2]['title'].value}"
>
#{node.artist} - #{node.title}
</rich:treeNode>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2011-01-31 17:40:30 UTC (rev 21339)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2011-01-31 17:48:33 UTC (rev 21340)
@@ -46,9 +46,24 @@
<rich:tree id="richTree"
var="node"
-
- dir="#{richTreeBean.attributes['dir'].value}"
+ selection="#{richTreeBean.selection}"
+ selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
+ toggleListener="#{richTreeListenerBean.processToggle}"
+
+ data="#{richTreeBean.attributes['data'].value}"
+ dir="#{richTreeBean.attributes['dir'].value}"
+ execute="#{richTreeBean.attributes['execute'].value}"
+ handleClass="#{richTreeBean.attributes['handleClass'].value}"
+ iconClass="#{richTreeBean.attributes['iconClass'].value}"
+ iconCollapsed="#{richTreeBean.attributes['iconCollapsed'].value}"
+ iconExpanded="#{richTreeBean.attributes['iconExpanded'].value}"
+ iconLeaf="#{richTreeBean.attributes['iconLeaf'].value}"
+ immediate="#{richTreeBean.attributes['immediate'].value}"
+ keepSaved="#{richTreeBean.attributes['keepSaved'].value}"
+ labelClass="#{richTreeBean.attributes['labelClass'].value}"
lang="#{richTreeBean.attributes['lang'].value}"
+ limitRender="#{richTreeBean.attributes['limitRender'].value}"
+ nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
onbeforedomupdate="#{richTreeBean.attributes['onbeforedomupdate'].value}"
onbeforenodetoggle="#{richTreeBean.attributes['onbeforenodetoggle'].value}"
onbeforeselectionchange="#{richTreeBean.attributes['onbeforeselectionchange'].value}"
@@ -61,30 +76,20 @@
onkeyup="#{richTreeBean.attributes['onkeyup'].value}"
onmousedown="#{richTreeBean.attributes['onmousedown'].value}"
onmousemove="#{richTreeBean.attributes['onmousemove'].value}"
- onmouseup="#{richTreeBean.attributes['onmouseup'].value}"
onmouseout="#{richTreeBean.attributes['onmouseout'].value}"
onmouseover="#{richTreeBean.attributes['onmouseover'].value}"
+ onmouseup="#{richTreeBean.attributes['onmouseup'].value}"
onnodetoggle="#{richTreeBean.attributes['onnodetoggle'].value}"
onselectionchange="#{richTreeBean.attributes['onselectionchange'].value}"
+ render="#{richTreeBean.attributes['render'].value}"
rendered="#{richTreeBean.attributes['rendered'].value}"
- selection="#{richTreeBean.selection}"
selectionType="#{richTreeBean.attributes['selectionType'].value}"
+ status="#{richTreeBean.attributes['status'].value}"
style="#{richTreeBean.attributes['style'].value}"
styleClass="#{richTreeBean.attributes['styleClass'].value}"
title="#{richTreeBean.attributes['title'].value}"
+ toggleNodeEvent="#{richTreeBean.attributes['toggleNodeEvent'].value}"
toggleType="#{richTreeBean.attributes['toggleType'].value}"
- iconLeaf="#{richTreeBean.attributes['iconLeaf'].value}"
- iconExpanded="#{richTreeBean.attributes['iconExpanded'].value}"
- iconCollapsed="#{richTreeBean.attributes['iconCollapsed'].value}"
- handleClass="#{richTreeBean.attributes['handleClass'].value}"
- iconClass="#{richTreeBean.attributes['iconClass'].value}"
- labelClass="#{richTreeBean.attributes['labelClass'].value}"
- nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
- selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
- toggleListener="#{richTreeListenerBean.processToggle}"
- render="#{richTreeBean.attributes['render'].value}"
- execute="#{richTreeBean.attributes['execute'].value}"
- toggleNodeEvent="#{richTreeBean.attributes['toggleNodeEvent'].value}"
>
<rich:treeModelRecursiveAdaptor
13 years, 11 months
JBoss Rich Faces SVN: r21339 - 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: pyaschenko
Date: 2011-01-31 12:40:30 -0500 (Mon, 31 Jan 2011)
New Revision: 21339
Modified:
trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js
Log:
http://jira.jboss.com/jira/browse/RF-10349
Modified: trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml 2011-01-31 17:30:51 UTC (rev 21338)
+++ trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml 2011-01-31 17:40:30 UTC (rev 21339)
@@ -74,6 +74,7 @@
boundaryDatesMode = "scroll"
defaultLabel = "bla-bla-bla"
enableManualInput="false"
+ showApplyButton="#{calendarBean.showApply}"
>
</calendar:calendar>
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js 2011-01-31 17:30:51 UTC (rev 21338)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js 2011-01-31 17:40:30 UTC (rev 21339)
@@ -78,7 +78,7 @@
return (!context.calendar.options.disabled && !context.calendar.options.readonly && context.calendar.options.showApplyButton ? CalendarView.getControl(context.controlLabels.apply, CalendarView.toolButtonAttributes, "close", "true") : "");
},
cleanControl: function (context) {
- return (!context.calendar.options.disabled && !context.calendar.options.readonly && context.calendar.selectedDate ? CalendarView.getControl(context.controlLabels.clean, CalendarView.toolButtonAttributes, "resetSelectedDate") : "");
+ return (!context.calendar.options.disabled && !context.calendar.options.readonly && context.calendar.selectedDate ? CalendarView.getControl(context.controlLabels.clean, CalendarView.toolButtonAttributes, "__resetSelectedDate") : "");
},
selectedDateControl: function (context) { return CalendarView.getSelectedDateControl(context.calendar);},
@@ -504,7 +504,7 @@
// add onclick event handlers to input field and popup button
if (this.options.popup && !this.options.disabled)
{
- var handler = new Function ('event', "RichFaces.$('"+this.id+"').doSwitch();");
+ var handler = new Function ('event', "RichFaces.$('"+this.id+"').switchPopup();");
rf.Event.bindById(this.POPUP_BUTTON_ID, "click"+this.namespace, handler, this);
if (!this.options.enableManualInput)
{
@@ -886,10 +886,10 @@
},
eventOnScroll: function (e) {
- this.doCollapse();
+ this.hidePopup();
},
- doCollapse: function() {
+ hidePopup: function() {
if (!this.options.popup || !this.isVisible) return;
@@ -907,12 +907,8 @@
}
}
},
-
- collapse: function() {
- this.doCollapse();
- },
- doExpand: function(e) {
+ showPopup: function(e) {
if (!this.isRendered) {
this.isRendered = true;
this.render();
@@ -933,7 +929,7 @@
if (!this.isFocused) updateDefaultLabel.call(this, "");
} else if (baseInput.value!=undefined)
{
- this.selectDate(baseInput.value, false, {event:e, element:element});
+ this.__selectDate(baseInput.value, false, {event:e, element:element});
}
//rect calculation
@@ -958,18 +954,10 @@
}
}
},
-
- expand: function(e) {
- this.doExpand(e);
- },
- doSwitch: function(e) {
- this.isVisible ? this.doCollapse() : this.doExpand(e);
+ switchPopup: function(e) {
+ this.isVisible ? this.hidePopup() : this.showPopup(e);
},
-
- switchState: function(e) {
- this.doSwitch(e);
- },
eventOnCollapse: function (e) {
if (this.skipEventOnCollapse)
@@ -980,7 +968,7 @@
if (e.target.id == this.POPUP_BUTTON_ID || (!this.options.enableManualInput && e.target.id == this.INPUT_DATE_ID) ) return true;
- this.doCollapse();
+ this.hidePopup();
return true;
},
@@ -998,10 +986,10 @@
getCurrentDate: function() {
return this.currentDate;
},
- getSelectedDate: function() {
+ __getSelectedDate: function() {
if (!this.selectedDate) return null; else return this.selectedDate;
},
- getSelectedDateString: function(pattern) {
+ __getSelectedDateString: function(pattern) {
if (!this.selectedDate) return "";
if (!pattern) pattern = this.options.datePattern;
return rf.calendarUtils.formatDate(this.selectedDate, pattern, this.options.monthLabels, this.options.monthLabelsShort);
@@ -1074,9 +1062,9 @@
this.setupTimeForDate(date);
}
- if (this.selectDate(date,true, {event:e, element:obj}) && !this.options.showApplyButton)
+ if (this.__selectDate(date,true, {event:e, element:obj}) && !this.options.showApplyButton)
{
- this.doCollapse();
+ this.hidePopup();
}
} else if (daydata._month!=0){
@@ -1090,9 +1078,9 @@
this.setupTimeForDate(date);
}
- if (this.selectDate(date, false, {event:e, element:obj}) && !this.options.showApplyButton)
+ if (this.__selectDate(date, false, {event:e, element:obj}) && !this.options.showApplyButton)
{
- this.doCollapse();
+ this.hidePopup();
}
}
}
@@ -1569,14 +1557,14 @@
{
this.setupTimeForDate(date);
}
- if (daydata.enabled && this.selectDate(date,true) && !this.options.showApplyButton)
+ if (daydata.enabled && this.__selectDate(date,true) && !this.options.showApplyButton)
{
- this.doCollapse();
+ this.hidePopup();
}
}
},
- selectDate: function(date, noUpdate, eventData) {
+ __selectDate: function(date, noUpdate, eventData) {
if (!eventData)
{
@@ -1676,7 +1664,7 @@
this.invokeEvent("dateselect", eventData.element, eventData.event, this.selectedDate);
if (!this.options.showApplyButton)
{
- this.setInputField(this.selectedDate!=null ? this.getSelectedDateString(this.options.datePattern) : "", eventData.event);
+ this.setInputField(this.selectedDate!=null ? this.__getSelectedDateString(this.options.datePattern) : "", eventData.event);
}
}
}
@@ -1684,7 +1672,7 @@
return isDateChange;
},
- resetSelectedDate: function()
+ __resetSelectedDate: function()
{
if (!this.selectedDate) return;
if (this.invokeEvent("beforedateselect", null, null, null))
@@ -1698,7 +1686,7 @@
if (!this.options.showApplyButton)
{
this.setInputField("", null);
- this.doCollapse();
+ this.hidePopup();
}
}
},
@@ -1731,9 +1719,9 @@
{
if (updateDate)
{
- this.setInputField(this.getSelectedDateString(this.options.datePattern), null);
+ this.setInputField(this.__getSelectedDateString(this.options.datePattern), null);
}
- this.doCollapse();
+ this.hidePopup();
},
clonePosition: function (source, elements, offset)
@@ -1811,7 +1799,7 @@
{
this.selectedDate = date;
this.renderHF();
- if (!this.options.popup || !this.options.showApplyButton) this.setInputField(this.getSelectedDateString(this.options.datePattern), null);
+ if (!this.options.popup || !this.options.showApplyButton) this.setInputField(this.__getSelectedDateString(this.options.datePattern), null);
this.invokeEvent("timeselect",null, null, this.selectedDate);
}
}
@@ -1849,6 +1837,25 @@
}
},
+ getValue: function() {
+ return this.__getSelectedDate();
+ },
+
+ getValueAsString: function(pattern) {
+ return this.__getSelectedDateString(pattern);
+ },
+
+ setValue: function(value) {
+ this.__selectDate(value);
+ },
+
+ resetValue: function() {
+ this.__resetSelectedDate();
+ if (this.options.defaultLabel && !this.isFocused) {
+ updateDefaultLabel.call(this, this.options.defaultLabel);
+ }
+ },
+
getNamespace: function () {
return this.namespace;
}
13 years, 11 months
JBoss Rich Faces SVN: r21338 - in branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf: util and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2011-01-31 12:30:51 -0500 (Mon, 31 Jan 2011)
New Revision: 21338
Added:
branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/util/DocumentBuilderPool.java
Modified:
branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/context/ResponseWriterContentHandler.java
Log:
RF-10035 updated 3.3.1.SP3-SNAPSHOT with changes
Modified: branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/context/ResponseWriterContentHandler.java
===================================================================
--- branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/context/ResponseWriterContentHandler.java 2011-01-31 17:24:35 UTC (rev 21337)
+++ branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/context/ResponseWriterContentHandler.java 2011-01-31 17:30:51 UTC (rev 21338)
@@ -22,10 +22,11 @@
package org.ajax4jsf.context;
import javax.faces.FacesException;
-import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.util.DocumentBuilderPool;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -44,12 +45,21 @@
public ResponseWriterContentHandler(String linkClass) {
super();
+ DocumentBuilder builder = null;
+
try {
- Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
+ //Pull the document builder from pool
+ builder = DocumentBuilderPool.getDocumentBuilder();
+
+ //create a new document & initialize
+ Document document = builder.newDocument();
node = document.createElement("head");
document.appendChild(node);
} catch (ParserConfigurationException e) {
throw new FacesException(e.getLocalizedMessage(), e);
+ }finally{
+ //Must always return the document builder to pool
+ DocumentBuilderPool.returnDocumentBuilder(builder);
}
this.linkClass = linkClass;
@@ -127,5 +137,4 @@
return list;
}
-
}
\ No newline at end of file
Added: branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/util/DocumentBuilderPool.java
===================================================================
--- branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/util/DocumentBuilderPool.java (rev 0)
+++ branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/util/DocumentBuilderPool.java 2011-01-31 17:30:51 UTC (rev 21338)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.ajax4jsf.util;
+
+import java.util.LinkedList;
+import java.util.NoSuchElementException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+/**
+ * Manages a shared pool of DocumentBuilders so that there is not a performance
+ * hit for every request to create.
+ *
+ * @author balunasj(a)redhat.com
+ *
+ */
+public final class DocumentBuilderPool {
+
+ /**
+ * How big the pool is
+ */
+ private static final int DOC_BUILDER_POOL_SIZE = 100;
+
+ /**
+ * Creates and holds the pool using the Initialization On Demand Holder idiom.
+ */
+ private static class DocumentBuilderPoolHolder {
+ static LinkedList<DocumentBuilder> _documentBuilderPool = new LinkedList<DocumentBuilder>();
+ }
+
+ /**
+ * Private constructor
+ */
+ private DocumentBuilderPool (){}
+
+ /**
+ * Get a pooled instance of DocumentBuilder
+ * @return Pooled DocumentBulder
+ * @throws ParserConfigurationException
+ */
+ public static DocumentBuilder getDocumentBuilder() throws ParserConfigurationException{
+ DocumentBuilder builder = null;
+
+ try {
+ //freeze the pool
+ synchronized (DocumentBuilderPoolHolder._documentBuilderPool) {
+ //pop the top builder - if empty it will through EmptyStackException
+ builder = (DocumentBuilder) DocumentBuilderPoolHolder._documentBuilderPool.pop();
+ }
+ } catch (NoSuchElementException e) {
+ //Stack is empty, create a new builder
+ builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ }
+
+ return builder;
+ }
+
+ /**
+ * Returns a builder to the pool
+ * @param builder
+ */
+ public static void returnDocumentBuilder(DocumentBuilder builder) {
+ //validate the builder
+ if (null != builder) {
+ synchronized (DocumentBuilderPoolHolder._documentBuilderPool) {
+ //only add if the pool is full
+ if (DocumentBuilderPoolHolder._documentBuilderPool.size() < DOC_BUILDER_POOL_SIZE) {
+ //reset the builder to initial state
+ builder.reset();
+
+ //push the builder back
+ DocumentBuilderPoolHolder._documentBuilderPool.push(builder);
+ }
+ }
+ }
+ }
+
+}
13 years, 11 months
JBoss Rich Faces SVN: r21337 - trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-31 12:24:35 -0500 (Mon, 31 Jan 2011)
New Revision: 21337
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
Log:
https://issues.jboss.org/browse/RF-10382
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2011-01-31 17:19:56 UTC (rev 21336)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2011-01-31 17:24:35 UTC (rev 21337)
@@ -143,6 +143,17 @@
getMinimumSize : function(size) {
return Math.max(size, 2 * this.getInitialSize() + 2);
},
+
+ __getParsedOption: function(options, name) {
+ var value = parseInt(options[name], 10);
+
+ if (value < 0 || isNaN(value)) {
+ value = this[name];
+ }
+
+ return value;
+ },
+
destroy: function() {
this._contentElement = null;
@@ -268,8 +279,8 @@
$.extend(this.userOptions, opts);
}
- this.currentMinHeight = this.getMinimumSize((options.minHeight || options.minHeight == 0) ? options.minHeight : this.minHeight);
- this.currentMinWidth = this.getMinimumSize((options.minWidth || options.minWidth == 0) ? options.minWidth : this.minWidth);
+ this.currentMinHeight = this.getMinimumSize(this.__getParsedOption(options, 'minHeight'));
+ this.currentMinWidth = this.getMinimumSize(this.__getParsedOption(options, 'minWidth'));
var eContentElt = this.getContentElement();
13 years, 11 months
JBoss Rich Faces SVN: r21336 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richTabPanel and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-31 12:19:56 -0500 (Mon, 31 Jan 2011)
New Revision: 21336
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java
Log:
* fixed testImmediate and testBypassUpdates in panels
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2011-01-31 16:55:43 UTC (rev 21335)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2011-01-31 17:19:56 UTC (rev 21336)
@@ -143,6 +143,7 @@
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
PhaseId.RENDER_RESPONSE);
+ phaseInfo.assertListener(PhaseId.PROCESS_VALIDATIONS, "item changed: item1 -> item3");
}
@Test
@@ -234,10 +235,8 @@
selenium.click(itemHeaders[2]);
waitGui.failWith("Item 3 is not displayed.").until(isDisplayed.locator(itemContents[2]));
- assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.RENDER_RESPONSE);
-
- String listenerOutput = selenium.getText(jq("div#phasesPanel li:eq(2)"));
- assertEquals(listenerOutput, "* item changed item1 -> item3", "Item change listener's output");
+ phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.RENDER_RESPONSE);
+ phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "item changed: item1 -> item3");
}
@Test
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2011-01-31 16:55:43 UTC (rev 21335)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2011-01-31 17:19:56 UTC (rev 21336)
@@ -149,6 +149,7 @@
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
PhaseId.RENDER_RESPONSE);
+ phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "item changed: tab1 -> tab3");
}
@Test
@@ -225,9 +226,7 @@
waitGui.failWith("Tab 3 is not displayed.").until(isDisplayed.locator(itemContents[2]));
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.RENDER_RESPONSE);
-
- String listenerOutput = selenium.getText(jq("div#phasesPanel li:eq(2)"));
- assertEquals(listenerOutput, "* item changed: tab1 -> tab3", "Item change listener's output");
+ phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "item changed: tab1 -> tab3");
}
@Test
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java 2011-01-31 16:55:43 UTC (rev 21335)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java 2011-01-31 17:19:56 UTC (rev 21336)
@@ -194,9 +194,7 @@
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
PhaseId.RENDER_RESPONSE);
-
- String listenerOutput = selenium.getText(jq("div#phasesPanel li:eq(3)"));
- assertEquals(listenerOutput, "* item changed item1 -> item3", "Item change listener's output");
+ phaseInfo.assertListener(PhaseId.PROCESS_VALIDATIONS, "item changed: item1 -> item3");
}
@Test
@@ -259,9 +257,7 @@
waitGui.failWith("Item 3 is not displayed.").until(isDisplayed.locator(item3));
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.RENDER_RESPONSE);
-
- String listenerOutput = selenium.getText(jq("div#phasesPanel li:eq(2)"));
- assertEquals(listenerOutput, "* item changed: item1 -> item3", "Item change listener's output");
+ phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "item changed: item1 -> item3");
}
@Test
13 years, 11 months