JBoss Rich Faces SVN: r7740 - in branches/3.1.x/ui/orderingList/src/main: resources/org/richfaces/renderkit/html/css and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-04-10 12:34:25 -0400 (Thu, 10 Apr 2008)
New Revision: 7740
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
Log:
http://jira.jboss.com/jira/browse/RF-2580
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2008-04-10 15:52:47 UTC (rev 7739)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2008-04-10 16:34:25 UTC (rev 7740)
@@ -347,6 +347,9 @@
renderChild(context, facet);
} else {
writer.startElement(HTML.IMG_ELEMENT, orderingList);
+ //buttons sometimes don't work under IE if mouse cursor
+ //is above some special areas of the button
+ writer.writeAttribute(HTML.style_ATTRIBUTE, "margin:0px;padding:0px;border:0px;", null);
writer.writeAttribute(HTML.width_ATTRIBUTE, "15", null);
writer.writeAttribute(HTML.height_ATTRIBUTE, "15", null);
writer.writeAttribute(HTML.border_ATTRIBUTE, "0", null);
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2008-04-10 15:52:47 UTC (rev 7739)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2008-04-10 16:34:25 UTC (rev 7740)
@@ -71,7 +71,7 @@
}
.rich-ordering-list-button-content {
- padding : 0px 4px 0px 1px;
+ padding : 0px 1px 0px 1px;
text-align : left;
white-space: nowrap;
}
16 years, 9 months
JBoss Rich Faces SVN: r7739 - trunk/ui/suggestionbox/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-04-10 11:52:47 -0400 (Thu, 10 Apr 2008)
New Revision: 7739
Modified:
trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
Log:
http://jira.jboss.com/jira/browse/RF-696 - attribute desc is corrected
Modified: trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
--- trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-04-10 15:27:22 UTC (rev 7738)
+++ trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-04-10 15:52:47 UTC (rev 7739)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "http://labs.jboss.com/jbossrichfaces/component-config.dtd
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "http://labs.jboss.com/jbossrichfaces/component-config.dtd
">
<components>
@@ -84,8 +84,7 @@
<name>ajaxSingle</name>
<classname>boolean</classname>
<description>
- if "true", submit ONLY one field/link, instead of all
- form controls
+ if "true", the component tree is processed limited only to the current component
</description>
<defaultvalue>true</defaultvalue>
</property>
16 years, 9 months
JBoss Rich Faces SVN: r7738 - trunk/ui/listShuttle/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-04-10 11:27:22 -0400 (Thu, 10 Apr 2008)
New Revision: 7738
Modified:
trunk/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
Log:
http://jira.jboss.com/jira/browse/RF-2045
Modified: trunk/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
===================================================================
--- trunk/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2008-04-10 15:27:18 UTC (rev 7737)
+++ trunk/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2008-04-10 15:27:22 UTC (rev 7738)
@@ -640,6 +640,20 @@
}
}
+ protected boolean isListEmpty(Object value) {
+ return super.isEmpty(value);
+ }
+
+ protected void validateValue(FacesContext context, Object value) {
+ Object[] values = (Object[]) value;
+ boolean[] requiredValues = {isSourceRequired(), isTargetRequired()};
+
+ for (int i = 0; i < values.length; i++) {
+ Object v = values[i];
+ validateListValue(context, v, isListEmpty(v), requiredValues[i]);
+ }
+ }
+
protected void resetDataModel() {
super.resetDataModel();
@@ -674,6 +688,12 @@
public abstract String getListClass();
public abstract void setListClass(String listClass);
+
+ public abstract boolean isSourceRequired();
+ public abstract void setSourceRequired(boolean sourceRequired);
+
+ public abstract boolean isTargetRequired();
+ public abstract void setTargetRequired(boolean targetRequired);
private void createValueHolder() {
if (valueHolder == null) {
16 years, 9 months
JBoss Rich Faces SVN: r7737 - trunk/ui/orderingList/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-04-10 11:27:18 -0400 (Thu, 10 Apr 2008)
New Revision: 7737
Modified:
trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
Log:
http://jira.jboss.com/jira/browse/RF-2045
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2008-04-10 13:52:00 UTC (rev 7736)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2008-04-10 15:27:18 UTC (rev 7737)
@@ -319,26 +319,60 @@
*
*/
protected void validateValue(FacesContext context, Object newValue) {
- // If our value is valid, enforce the required property if present
- if (isValid() && isRequired() && isEmpty(newValue)) {
- FacesMessage message = MessageUtil.getMessage(context,
- UIInput.REQUIRED_MESSAGE_ID,
- new Object[] {MessageUtil.getLabel(context, this)});
- message.setSeverity(FacesMessage.SEVERITY_ERROR);
+ validateListValue(context, newValue, isEmpty(newValue), isRequired());
+ }
+
+ protected void validateListValue(FacesContext context, Object newValue,
+ boolean isEmpty, boolean isRequired) {
+ // If our value is valid, enforce the required property if present
+ requiredValidation(context, newValue, isEmpty, isRequired);
+
+ // If our value is valid and not empty, call all validators
+ processingValidators(context, newValue, isEmpty);
+ }
+
+ protected void requiredValidation(FacesContext context, Object newValue, boolean isRequired, boolean isEmpty) {
+ if (isValid() && isRequired && isEmpty) {
+ FacesMessage message = MessageUtil.getMessage(context, UIInput.REQUIRED_MESSAGE_ID,
+ new Object[] {MessageUtil.getLabel(context, this)});
+ message.setSeverity(FacesMessage.SEVERITY_ERROR);
- context.addMessage(getClientId(context), message);
- setValid(false);
+ context.addMessage(getClientId(context), message);
+ setValid(false);
+ }
+ }
+
+ protected void processingValidators(FacesContext context, Object newValue, boolean isEmpty) {
+ if (isValid() && !isEmpty) {
+ Validator[] validators = getValidators();
+ for (int i = 0; i < validators.length; i++) {
+ Validator validator = (Validator) validators[i];
+ try {
+ validator.validate(context, this, newValue);
+ }
+ catch (ValidatorException ve) {
+ // If the validator throws an exception, we're
+ // invalid, and we need to add a message
+ setValid(false);
+ FacesMessage message = ve.getFacesMessage();
+ if (message != null) {
+ message.setSeverity(FacesMessage.SEVERITY_ERROR);
+ context.addMessage(getClientId(context), message);
+ }
+ }
}
- // If our value is valid and not empty, call all validators
- if (isValid() && !isEmpty(newValue)) {
- Validator[] validators = getValidators();
- for (int i = 0; i < validators.length; i++) {
- Validator validator = (Validator) validators[i];
- try {
- validator.validate(context, this, newValue);
- }
- catch (ValidatorException ve) {
+ MethodBinding validator = getValidator();
+ if (validator != null) {
+ try {
+ validator.invoke(context,
+ new Object[] { context, this, newValue});
+ }
+ catch (EvaluationException ee) {
+ if (ee.getCause() instanceof ValidatorException) {
+ ValidatorException ve =
+ (ValidatorException) ee.getCause();
+
// If the validator throws an exception, we're
// invalid, and we need to add a message
setValid(false);
@@ -347,37 +381,15 @@
message.setSeverity(FacesMessage.SEVERITY_ERROR);
context.addMessage(getClientId(context), message);
}
+ } else {
+ // Otherwise, rethrow the EvaluationException
+ throw ee;
}
}
-
- MethodBinding validator = getValidator();
- if (validator != null) {
- try {
- validator.invoke(context,
- new Object[] { context, this, newValue});
- }
- catch (EvaluationException ee) {
- if (ee.getCause() instanceof ValidatorException) {
- ValidatorException ve =
- (ValidatorException) ee.getCause();
-
- // If the validator throws an exception, we're
- // invalid, and we need to add a message
- setValid(false);
- FacesMessage message = ve.getFacesMessage();
- if (message != null) {
- message.setSeverity(FacesMessage.SEVERITY_ERROR);
- context.addMessage(getClientId(context), message);
- }
- } else {
- // Otherwise, rethrow the EvaluationException
- throw ee;
- }
- }
- }
}
+ }
}
-
+
/**
* <p>In addition to the standard <code>processUpdates</code> behavior
* inherited from {@link UIComponentBase}, calls
16 years, 9 months
JBoss Rich Faces SVN: r7736 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-04-10 09:52:00 -0400 (Thu, 10 Apr 2008)
New Revision: 7736
Modified:
trunk/docs/userguide/en/src/main/docbook/included/progressBar.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/progressBar.xml
Log:
http://jira.jboss.com/jira/browse/RF-1690
Fixing descriptions, basing on the comments of developers
Modified: trunk/docs/userguide/en/src/main/docbook/included/progressBar.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/progressBar.desc.xml 2008-04-10 13:11:49 UTC (rev 7735)
+++ trunk/docs/userguide/en/src/main/docbook/included/progressBar.desc.xml 2008-04-10 13:52:00 UTC (rev 7736)
@@ -24,9 +24,10 @@
<title>Key Features</title>
<itemizedlist>
+
+ <listitem><para>Ajax or Client modes</para></listitem>
<listitem><para>Option to control rerendering frequency</para></listitem>
- <listitem><para>Ajax or Client modes</para></listitem>
- <listitem><para>Possibility to display status information on the progress bar </para></listitem>
+ <listitem><para>Customizable status information label </para></listitem>
<listitem><para>Highly customizable look and feel</para></listitem>
</itemizedlist>
Modified: trunk/docs/userguide/en/src/main/docbook/included/progressBar.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/progressBar.xml 2008-04-10 13:11:49 UTC (rev 7735)
+++ trunk/docs/userguide/en/src/main/docbook/included/progressBar.xml 2008-04-10 13:52:00 UTC (rev 7736)
@@ -211,7 +211,7 @@
</listitem>
<listitem>
- <para>Using any child components that display text. One of the components that can be used is <emphasis role="bold"><property><h:outputText /></property></emphasis></para>
+ <para>Using any child(nested) components. One of the components that can be used is <emphasis role="bold"><property><h:outputText /></property></emphasis></para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
@@ -265,7 +265,7 @@
In the shown example <emphasis><property> "progressVar"</property></emphasis> attribute
defines a variable "progress" with the value taken from <emphasis><property>"value"</property></emphasis>
attribute of the <emphasis role="bold"><property><rich:progressBar></property></emphasis> component.
- The "progress" variable performs substitution passing the current value of a progress to the
+ The "progress" variable performs substitution passing the current progress value to the
<emphasis><property>"value"</property></emphasis> attribute of the
<emphasis role="bold"><property><h:outputText></property></emphasis>.
This is how the current value of a progress appears on
@@ -326,7 +326,7 @@
<para>
The <emphasis><property>"parameters"</property></emphasis>
- is also a special attribute that defines parameters for substitution in the label.
+ is also a special attribute which defines parameters that can be to get additional data from server (e.g. additional info about process status).
All you need is to define the value of your own parameter
(e.g parameters="param:'#{bean.incValue1}'")
and you can use it to pass the data.
@@ -377,8 +377,6 @@
</f:facet>
</rich:progressBar>
...]]> </programlisting>
- <para> However, the usage of these facets is optional. If you omit them nothing will be displayed.
- </para>
</section>
16 years, 9 months
JBoss Rich Faces SVN: r7735 - in trunk/ui/fileUpload/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-04-10 09:11:49 -0400 (Thu, 10 Apr 2008)
New Revision: 7735
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
Log:
RF-3020
Modified: trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-04-10 13:03:14 UTC (rev 7734)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-04-10 13:11:49 UTC (rev 7735)
@@ -378,7 +378,7 @@
uploadedCount: 0,
- initialize: function(id, formId, stopScript, getFileSizeScript, progressBarId, classes, label, maxFiles, events, disabled, acceptedTypes, options, labels, parameters) {
+ initialize: function(id, formId, actionUrl, stopScript, getFileSizeScript, progressBarId, classes, label, maxFiles, events, disabled, acceptedTypes, options, labels, parameters) {
this.id = id;
this.element = $(this.id);
if (formId != '') {
@@ -410,6 +410,7 @@
this.maxFileBatchSize = maxFiles;
this.currentInput = $(this.id + ":file");
+ this.actionUrl = actionUrl;
this.options = options || {};
this.initEvents();
this.setupAutoUpload();
@@ -933,7 +934,7 @@
parentForm.encoding = "multipart/form-data";
parentForm.enctype = "multipart/form-data";
parentForm.target = this.id + "_iframe";//this.id;
- parentForm.action = oldAction + (/\?/.test(oldAction) ? '&_richfaces_upload_uid' : '?_richfaces_upload_uid') + '=' + encodeURI(entry.uid) + "&id=" + this.id + "&_richfaces_upload_file_indicator=true";
+ parentForm.action = this.actionUrl + (/\?/.test(this.actionUrl) ? '&_richfaces_upload_uid' : '?_richfaces_upload_uid') + '=' + encodeURI(entry.uid) + "&id=" + this.id + "&_richfaces_upload_file_indicator=true";
try {
var inputs = parentForm.elements;
Modified: trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-04-10 13:03:14 UTC (rev 7734)
+++ trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-04-10 13:11:49 UTC (rev 7735)
@@ -45,6 +45,7 @@
variables.setVariable("uploadLabel",labels.get("upload"));
variables.setVariable("clearAllLabel",labels.get("clear_all"));
+ variables.setVariable("actionUrl",org.ajax4jsf.context.AjaxContextImpl.getCurrentInstance().getAjaxActionURL(context));
variables.setVariable("formId",getFormId(context, component));
variables.setVariable("containerId",getContainerId(context, component));
@@ -182,7 +183,7 @@
onclear : #{this:getAsEventHandler(context, component, "onclear")}
};
- new FileUpload('#{clientId}','#{formId}',#{this:getStopScript(context, component)}, #{this:getFileSizeScript(context, component)} ,'#{this:getProgressBarId(context, component)}', FileUpload.CLASSES, #{this:getLabelMarkup(context, component)}, #{maxCount}, events, #{component.attributes["disabled"]}, #{this:getAcceptedTypes(context, component)}, {'autoclear':#{component.attributes["autoclear"]},'autoUpload':#{component.attributes["immediateUpload"]}},#{this:_getLabels(labels)},#{this:getChildrenParams(context, component)});
+ new FileUpload('#{clientId}','#{formId}','#{actionUrl}',#{this:getStopScript(context, component)}, #{this:getFileSizeScript(context, component)} ,'#{this:getProgressBarId(context, component)}', FileUpload.CLASSES, #{this:getLabelMarkup(context, component)}, #{maxCount}, events, #{component.attributes["disabled"]}, #{this:getAcceptedTypes(context, component)}, {'autoclear':#{component.attributes["autoclear"]},'autoUpload':#{component.attributes["immediateUpload"]}},#{this:_getLabels(labels)},#{this:getChildrenParams(context, component)});
</script>
</span>
<f:call name="utils.encodeEndFormIfNessesary" />
16 years, 9 months
JBoss Rich Faces SVN: r7734 - branches/3.1.x/test-applications/jsp/src/main/webapp/OrderingList.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-04-10 09:03:14 -0400 (Thu, 10 Apr 2008)
New Revision: 7734
Modified:
branches/3.1.x/test-applications/jsp/src/main/webapp/OrderingList/OrderingList.jsp
Log:
Modified: branches/3.1.x/test-applications/jsp/src/main/webapp/OrderingList/OrderingList.jsp
===================================================================
--- branches/3.1.x/test-applications/jsp/src/main/webapp/OrderingList/OrderingList.jsp 2008-04-10 13:02:46 UTC (rev 7733)
+++ branches/3.1.x/test-applications/jsp/src/main/webapp/OrderingList/OrderingList.jsp 2008-04-10 13:03:14 UTC (rev 7734)
@@ -9,17 +9,35 @@
<h:messages />
</a4j:outputPanel>
- <rich:orderingList id="orderingListID" value="#{orderingList.list}" var="item" listHeight="#{orderingList.listHeight}"
- listWidth="#{orderingList.listWidth}" controlsType="#{orderingList.controlsType}" converter="orderingListConverter"
- bottomControlLabel="#{orderingList.bottomControlLabel}" captionLabel="#{orderingList.captionLabel}"
- topControlLabel="#{orderingList.topControlLabel}" upControlLabel="#{orderingList.upControlLabel}"
- controlsHorizontalAlign="#{orderingList.controlsHorizontalAlign}" controlsVerticalAlign="#{orderingList.controlsVerticalAlign}"
- downControlLabel="#{orderingList.downControlLabel}"
- orderControlsVisible="#{orderingList.orderControlsVisible}" fastOrderControlsVisible="#{orderingList.fastOrderControlsVisible}"
- rendered="#{orderingList.rendered}" showButtonLabels="#{orderingList.showButtonLabels}" selection="#{orderingList.selection}"
- onmousemove="showEvent('onmousemoveInputID', 'onmousemove work!')" onclick="showEvent('onclickInputID', 'onclick work!')"
- ondblclick="showEvent('ondblclickInputID', 'ondblclick work!')" onmouseout="showEvent('onmouseoutInputID', 'onmouseout work!')"
- onmouseover="showEvent('onmouseoverInputID', 'onmouseover work!')" onorderchanged="showEvent('onorderchangedInputID', 'onorderchanged work!')" ontopclick="showEvent('ontopclickInputID', 'ontopclick work!')" onupclick="showEvent('onupclickInputID', 'onupclick work!')" ondownclick="showEvent('ondownclickInputID', 'ondownclick work!')" onbottomclick="showEvent('onbottomclickInputID', 'onbottomclick work!')" onheaderclick="showEvent('onheaderclickInputID', 'onheaderclick work!')">
+ <rich:orderingList id="orderingListID" immediate="false"
+ binding="#{orderingList.myOrderingList}" value="#{orderingList.list}"
+ var="item" listHeight="#{orderingList.listHeight}"
+ listWidth="#{orderingList.listWidth}"
+ controlsType="#{orderingList.controlsType}"
+ converter="orderingListConverter"
+ bottomControlLabel="#{orderingList.bottomControlLabel}"
+ captionLabel="#{orderingList.captionLabel}"
+ topControlLabel="#{orderingList.topControlLabel}"
+ upControlLabel="#{orderingList.upControlLabel}"
+ controlsHorizontalAlign="#{orderingList.controlsHorizontalAlign}"
+ controlsVerticalAlign="#{orderingList.controlsVerticalAlign}"
+ downControlLabel="#{orderingList.downControlLabel}"
+ orderControlsVisible="#{orderingList.orderControlsVisible}"
+ fastOrderControlsVisible="#{orderingList.fastOrderControlsVisible}"
+ rendered="#{orderingList.rendered}"
+ showButtonLabels="#{orderingList.showButtonLabels}"
+ selection="#{orderingList.selection}"
+ onmousemove="showEvent('onmousemoveInputID', 'onmousemove work!')"
+ onclick="showEvent('onclickInputID', 'onclick work!')"
+ ondblclick="showEvent('ondblclickInputID', 'ondblclick work!')"
+ onmouseout="showEvent('onmouseoutInputID', 'onmouseout work!')"
+ onmouseover="showEvent('onmouseoverInputID', 'onmouseover work!')"
+ onorderchanged="showEvent('onorderchangedInputID', 'onorderchanged work!')"
+ ontopclick="showEvent('ontopclickInputID', 'ontopclick work!')"
+ onupclick="showEvent('onupclickInputID', 'onupclick work!')"
+ ondownclick="showEvent('ondownclickInputID', 'ondownclick work!')"
+ onbottomclick="showEvent('onbottomclickInputID', 'onbottomclick work!')"
+ onheaderclick="showEvent('onheaderclickInputID', 'onheaderclick work!')">
<f:facet name="header">
<h:outputText value="header" />
</f:facet>
@@ -45,7 +63,8 @@
<f:facet name="header">
<h:outputText value="Button" />
</f:facet>
- <h:commandButton onclick="submit();" action="#{orderingList.cbAction}" value="#{item.str0} submit();" />
+ <h:commandButton onclick="submit();"
+ action="#{orderingList.cbAction}" value="#{item.str0} submit();" />
</h:column>
<h:column>
@@ -59,14 +78,15 @@
<f:facet name="header">
<h:outputText value="Link" />
</f:facet>
- <a4j:commandLink action="#{orderingList.clAction}" value="#{item.str1} submit()" reRender="orderingListID"></a4j:commandLink>
+ <a4j:commandLink action="#{orderingList.clAction}"
+ value="#{item.str1} submit()" reRender="orderingListID"></a4j:commandLink>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="select" />
</f:facet>
- <h:selectOneMenu value="#{item.str2}" >
+ <h:selectOneMenu value="#{item.str2}">
<f:selectItem itemLabel="select0" itemValue="select0" />
<f:selectItem itemLabel="select1" itemValue="select1" />
<f:selectItem itemLabel="select2" itemValue="select2" />
@@ -90,21 +110,52 @@
<h:graphicImage value="#{item.str3}" />
</h:column>
</rich:orderingList>
+
+ <h:panelGrid columns="2">
+ <a4j:commandButton reRender="outBindingCheck" actionListener="#{orderingList.bindingCheck}"
+ value="binding Check" />
+ <h:outputText id="outBindingCheck" value="#{orderingList.bindingCheck}" />
+ </h:panelGrid>
+
<h:panelGrid columns="3">
<h:column></h:column>
<h:outputText value="JavaScript API"></h:outputText>
<h:column></h:column>
- <a4j:commandLink onclick="$('formID:orderingListSubviewID:orderingListID').component.doHide()" value="Hide"></a4j:commandLink>
- <a4j:commandLink onclick="$('formID:orderingListSubviewID:orderingListID').component.doShow()" value="Show"></a4j:commandLink>
- <a4j:commandLink onclick="alert($('formID:orderingListSubviewID:orderingListID').component.isShown)" value="isShown"></a4j:commandLink>
- <a4j:commandLink onclick="$('formID:orderingListSubviewID:orderingListID').component.Enable()" value="Enable"></a4j:commandLink>
- <a4j:commandLink onclick="$('formID:orderingListSubviewID:orderingListID').component.Disable()" value="Disable"></a4j:commandLink>
- <a4j:commandLink onclick="$('formID:orderingListSubviewID:orderingListID').component.isEnabled()" value="isEnabled"></a4j:commandLink>
- <a4j:commandLink onclick="$('formID:orderingListSubviewID:orderingListID').component.moveUp" value="moveUp"></a4j:commandLink>
- <a4j:commandLink onclick="$('formID:orderingListSubviewID:orderingListID').component.moveDown" value="moveDown"></a4j:commandLink>
- <a4j:commandLink onclick="$('formID:orderingListSubviewID:orderingListID').component.moveTop" value="moveTop"></a4j:commandLink>
- <a4j:commandLink onclick="$('formID:orderingListSubviewID:orderingListID').component.moveBottom" value="moveBottom"></a4j:commandLink>
- <a4j:commandLink onclick="$('formID:orderingListSubviewID:orderingListID').component.getSelection" value="getSelection"></a4j:commandLink>
- <a4j:commandLink onclick="$('formID:orderingListSubviewID:orderingListID').component.getItems" value="getItems"></a4j:commandLink>
- </h:panelGrid>
+ <a4j:commandLink
+ onclick="$('formID:orderingListSubviewID:orderingListID').component.doHide()"
+ value="Hide"></a4j:commandLink>
+ <a4j:commandLink
+ onclick="$('formID:orderingListSubviewID:orderingListID').component.doShow()"
+ value="Show"></a4j:commandLink>
+ <a4j:commandLink
+ onclick="alert($('formID:orderingListSubviewID:orderingListID').component.isShown)"
+ value="isShown"></a4j:commandLink>
+ <a4j:commandLink
+ onclick="$('formID:orderingListSubviewID:orderingListID').component.Enable()"
+ value="Enable"></a4j:commandLink>
+ <a4j:commandLink
+ onclick="$('formID:orderingListSubviewID:orderingListID').component.Disable()"
+ value="Disable"></a4j:commandLink>
+ <a4j:commandLink
+ onclick="$('formID:orderingListSubviewID:orderingListID').component.isEnabled()"
+ value="isEnabled"></a4j:commandLink>
+ <a4j:commandLink
+ onclick="$('formID:orderingListSubviewID:orderingListID').component.moveUp"
+ value="moveUp"></a4j:commandLink>
+ <a4j:commandLink
+ onclick="$('formID:orderingListSubviewID:orderingListID').component.moveDown"
+ value="moveDown"></a4j:commandLink>
+ <a4j:commandLink
+ onclick="$('formID:orderingListSubviewID:orderingListID').component.moveTop"
+ value="moveTop"></a4j:commandLink>
+ <a4j:commandLink
+ onclick="$('formID:orderingListSubviewID:orderingListID').component.moveBottom"
+ value="moveBottom"></a4j:commandLink>
+ <a4j:commandLink
+ onclick="$('formID:orderingListSubviewID:orderingListID').component.getSelection"
+ value="getSelection"></a4j:commandLink>
+ <a4j:commandLink
+ onclick="$('formID:orderingListSubviewID:orderingListID').component.getItems"
+ value="getItems"></a4j:commandLink>
+ </h:panelGrid>
</f:subview>
\ No newline at end of file
16 years, 9 months
JBoss Rich Faces SVN: r7733 - branches/3.1.x/test-applications/jsp/src/main/java/orderingList.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-04-10 09:02:46 -0400 (Thu, 10 Apr 2008)
New Revision: 7733
Modified:
branches/3.1.x/test-applications/jsp/src/main/java/orderingList/OrderingList.java
Log:
Modified: branches/3.1.x/test-applications/jsp/src/main/java/orderingList/OrderingList.java
===================================================================
--- branches/3.1.x/test-applications/jsp/src/main/java/orderingList/OrderingList.java 2008-04-10 12:41:56 UTC (rev 7732)
+++ branches/3.1.x/test-applications/jsp/src/main/java/orderingList/OrderingList.java 2008-04-10 13:02:46 UTC (rev 7733)
@@ -3,12 +3,16 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
-
+import org.richfaces.component.html.HtmlOrderingList;
import javax.faces.component.html.HtmlDataTable;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
import util.data.Data;
public class OrderingList{
+ private String bindingCheck;
+ private HtmlOrderingList myOrderingList;
private ArrayList<String> info;
private ArrayList<Data> list;
private String captionLabel;
@@ -31,6 +35,14 @@
private boolean showAllData;
private boolean showSelect;
+ public void bindingCheck(ActionEvent actionEvent){
+ FacesContext faces = FacesContext.getCurrentInstance();
+ bindingCheck = "Passed";
+ System.out.println("============OL Binding Check===========");
+ System.out.println(myOrderingList.getBaseClientId(faces));
+ System.out.println("============OL Binding Check===========");
+ }
+
public boolean isFacet() {
return facet;
}
@@ -69,6 +81,7 @@
}
public OrderingList() {
+ this.bindingCheck = "Not checked";
this.info = new ArrayList<String>();
this.captionLabel = "captionLabel";
this.lenght = 10;
@@ -351,4 +364,20 @@
public void setShowSelect(boolean showSelect) {
this.showSelect = showSelect;
}
+
+ public HtmlOrderingList getMyOrderingList() {
+ return myOrderingList;
+ }
+
+ public void setMyOrderingList(HtmlOrderingList myOrderingList) {
+ this.myOrderingList = myOrderingList;
+ }
+
+ public String getBindingCheck() {
+ return bindingCheck;
+ }
+
+ public void setBindingCheck(String bindingCheck) {
+ this.bindingCheck = bindingCheck;
+ }
}
16 years, 9 months
JBoss Rich Faces SVN: r7732 - in trunk: ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-04-10 08:41:56 -0400 (Thu, 10 Apr 2008)
New Revision: 7732
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java
Log:
RF-2037
Modified: trunk/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java 2008-04-10 12:04:30 UTC (rev 7731)
+++ trunk/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java 2008-04-10 12:41:56 UTC (rev 7732)
@@ -3,6 +3,7 @@
*/
package org.richfaces.model.selection;
+import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -17,27 +18,39 @@
private Set<Object> keys = new LinkedHashSet<Object>();
+ private boolean selectAll = false;
+
public boolean addKey(Object rowKey) {
return keys.add(rowKey);
}
public boolean removeKey(Object rowKey) {
+ selectAll = false;
return keys.remove(rowKey);
}
public Iterator<Object> getKeys() {
- return keys.iterator();
+ Iterator<Object> result = Collections.emptyList().iterator();;
+ if (!selectAll) {
+ result = keys.iterator();
+ }
+ return result;
}
public int size() {
- return keys.size();
+ int result = -1;
+ if (!selectAll) {
+ result = keys.size();
+ }
+ return result;
}
public boolean isSelected(Object rowKey) {
- return keys.contains(rowKey);
+ return selectAll || keys.contains(rowKey);
}
public void clear() {
+ selectAll = false;
keys.clear();
}
@@ -45,6 +58,7 @@
final int prime = 31;
int result = 1;
result = prime * result + ((keys == null) ? 0 : keys.hashCode());
+ result = prime * result + (selectAll ? 1231 : 1237);
return result;
}
@@ -55,14 +69,20 @@
return false;
if (getClass() != obj.getClass())
return false;
- final SimpleSelection other = (SimpleSelection) obj;
+ SimpleSelection other = (SimpleSelection) obj;
if (keys == null) {
if (other.keys != null)
return false;
} else if (!keys.equals(other.keys))
return false;
+ if (selectAll != other.selectAll)
+ return false;
return true;
}
+
+ public void setSelectAll(boolean selectAll) {
+ this.selectAll = selectAll;
+ }
}
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java 2008-04-10 12:04:30 UTC (rev 7731)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java 2008-04-10 12:41:56 UTC (rev 7732)
@@ -83,6 +83,7 @@
if (clientSelection.isReset() || clientSelection.isSelectAll()) {
simpleSelection.clear();
+ simpleSelection.setSelectAll(clientSelection.isSelectAll());
}
try {
16 years, 9 months
JBoss Rich Faces SVN: r7731 - trunk/ui/calendar/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: vbaranov
Date: 2008-04-10 08:04:30 -0400 (Thu, 10 Apr 2008)
New Revision: 7731
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-2969
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-04-10 10:16:43 UTC (rev 7730)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-04-10 12:04:30 UTC (rev 7731)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.text.DateFormatSymbols;
import java.text.Format;
+import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
@@ -34,10 +35,14 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.Set;
+import java.util.logging.Level;
+import javax.el.ValueExpression;
+import javax.faces.application.Application;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import javax.faces.convert.DateTimeConverter;
import javax.faces.event.PhaseId;
@@ -108,26 +113,56 @@
}
}
- public Object getConvertedValue(FacesContext context,
- UIComponent component, Object submittedValue)
- throws ConverterException {
- if (submittedValue instanceof Date) {
- return (Date) submittedValue;
- }
- UICalendar calendar = (UICalendar) component;
- if (calendar.getConverter() != null) {
+ @Override
+ public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue)
+ throws ConverterException {
+ // skip conversion of already converted date
+ if (submittedValue instanceof Date) {
+ return (Date) submittedValue;
+ }
- return calendar.getConverter().getAsObject(context, component,
- (String) submittedValue);
-
- } else {
- DateTimeConverter converter = new DateTimeConverter();
- converter.setPattern(calendar.getDatePattern());
- converter.setLocale(calendar.getAsLocale(calendar.getLocale()));
- converter.setTimeZone(calendar.getTimeZone());
- return converter.getAsObject(context, component,
- (String) submittedValue);
+ // Store submitted value in the local variable as a string
+ String newValue = (String) submittedValue;
+ // if we have no local value, try to get the valueExpression.
+ ValueExpression valueExpression = component.getValueExpression("value");
+ Converter converter = null;
+
+ UICalendar calendar = (UICalendar) component;
+ converter = calendar.getConverter();
+
+ if ((converter == null) && (valueExpression != null)) {
+ Class<?> converterType = valueExpression.getType(context.getELContext());
+ if((converterType != null) && (converterType != Object.class)) {
+ // if getType returns a type for which we support a default
+ // conversion, acquire an appropriate converter instance.
+ try {
+ Application application = context.getApplication();
+ converter = application.createConverter(converterType);
+ if (log.isInfoEnabled()) {
+ log.info(MessageFormat.format("Created converter ({0}) for type {1} for component {2}.", new Object[] {
+ converter.getClass().getName(), converterType.getClass().getName(), component.getId() }));
+ }
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error(MessageFormat.format("Could not instantiate converter for type {0}: {1}", new Object[] {
+ converterType, e.toString() }));
+ }
+ return (null);
+ }
}
+ }
+
+ if (converter != null) {
+ // Use configured converter
+ return converter.getAsObject(context, component, newValue);
+ } else {
+ // in case the converter hasn't been set, try to use default DateTimeConverter
+ DateTimeConverter defaultConverter = new DateTimeConverter();
+ defaultConverter.setPattern(calendar.getDatePattern());
+ defaultConverter.setLocale(calendar.getAsLocale(calendar.getLocale()));
+ defaultConverter.setTimeZone(calendar.getTimeZone());
+ return defaultConverter.getAsObject(context, component, newValue);
+ }
}
protected void doDecode(FacesContext context, UIComponent component) {
16 years, 9 months