JBoss Rich Faces SVN: r6157 - trunk/sandbox/ui/fileUpload.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-19 06:55:26 -0500 (Tue, 19 Feb 2008)
New Revision: 6157
Modified:
trunk/sandbox/ui/fileUpload/pom.xml
Log:
change progressBar dependency
Modified: trunk/sandbox/ui/fileUpload/pom.xml
===================================================================
--- trunk/sandbox/ui/fileUpload/pom.xml 2008-02-19 11:43:43 UTC (rev 6156)
+++ trunk/sandbox/ui/fileUpload/pom.xml 2008-02-19 11:55:26 UTC (rev 6157)
@@ -54,7 +54,7 @@
<version>3.2.0-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>org.richfaces.sandbox.ui</groupId>
+ <groupId>org.richfaces.ui</groupId>
<artifactId>progressBar</artifactId>
<version>3.2.0-SNAPSHOT</version>
</dependency>
18 years, 2 months
JBoss Rich Faces SVN: r6156 - in trunk/ui/progressBAR/src/main: java/org/richfaces/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-19 06:43:43 -0500 (Tue, 19 Feb 2008)
New Revision: 6156
Modified:
trunk/ui/progressBAR/src/main/config/component/progressBar.xml
trunk/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
trunk/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx
Log:
RF-2270, RF-2283, RF-2290, RF-2291
Modified: trunk/ui/progressBAR/src/main/config/component/progressBar.xml
===================================================================
--- trunk/ui/progressBAR/src/main/config/component/progressBar.xml 2008-02-19 11:42:38 UTC (rev 6155)
+++ trunk/ui/progressBAR/src/main/config/component/progressBar.xml 2008-02-19 11:43:43 UTC (rev 6156)
@@ -41,6 +41,11 @@
<description>Parameters for macrosubstitution in label</description>
</property>
<property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>Attribute defines simple label instead of children component rendering</description>
+ </property>
+ <property>
<name>dualColoredLabel</name>
<classname>java.lang.Boolean</classname>
<description>Defines if component renderes as simple markup</description>
@@ -142,6 +147,14 @@
but just allows to avoid unnecessary updates on the client side if the response isn't actual now
</description>
</property>
+ <property hidden="true">
+ <name>lang</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Code describing the language used in the generated
+ markup for this component
+ </description>
+ </property>
</component>
</components>
Modified: trunk/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java
===================================================================
--- trunk/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java 2008-02-19 11:42:38 UTC (rev 6155)
+++ trunk/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java 2008-02-19 11:43:43 UTC (rev 6156)
@@ -22,6 +22,7 @@
import org.ajax4jsf.context.AjaxContextImpl;
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.javascript.JSLiteral;
+import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.richfaces.renderkit.AbstractProgressBarRenderer;
@@ -59,9 +60,9 @@
Map params = request.getParameterMap();
if (!params.containsKey(FORCE_PERCENT_PARAM)
&& params.containsKey(PERCENT_PARAM)) {
- Number percent = getNumber(this.getAttributes().get("value"));
+ Number value = getNumber(this.getAttributes().get("value"));
ajaxContext.removeRenderedArea(this.getClientId(facesContext));
- ajaxContext.setResponseData(getResponseData(percent,
+ ajaxContext.setResponseData(getResponseData(value,
facesContext));
Object reRender = this.getAttributes().get(
@@ -89,14 +90,14 @@
* @param percent
* @return
*/
- private Map<Object, Object> getResponseData(Number percent,
+ private Map<Object, Object> getResponseData(Number value,
FacesContext facesContext) {
AbstractProgressBarRenderer renderer = (AbstractProgressBarRenderer) this
.getRenderer(facesContext);
Map<Object, Object> map = new HashMap<Object, Object>();
- map.put("percent", percent);
+ map.put("value", value);
map.put("interval", this.getInterval());
if (this.getAttributes().get("style") != null) {
@@ -106,9 +107,9 @@
boolean enabled = (Boolean) this.getAttributes().get("enabled");
map.put("enabled", Boolean.toString(enabled));
- if (!isSimple()) {
+ if (!isSimple(renderer)) {
map.put("markup", getMarkup(facesContext, renderer));
- map.put("context", getContext(renderer, percent));
+ map.put("context", getContext(renderer, value));
}
addStyles2Responce(map, "completeClass", this.getAttributes().get(
@@ -130,10 +131,10 @@
private JSLiteral getContext(AbstractProgressBarRenderer renderer,
Number percent) {
StringBuffer buffer = new StringBuffer("{");
- buffer.append("value:").append(percent.toString()).append(",");
- buffer.append("minValue:").append(this.getAttributes().get("minValue"))
+ buffer.append("value:").append(ScriptUtils.toScript(percent.toString())).append(",");
+ buffer.append("minValue:").append(ScriptUtils.toScript(this.getAttributes().get("minValue").toString()))
.append(",");
- buffer.append("maxValue:").append(this.getAttributes().get("maxValue"));
+ buffer.append("maxValue:").append(ScriptUtils.toScript(this.getAttributes().get("maxValue").toString()));
String parameters = renderer.getParameters(this);
if (parameters != null) {
@@ -148,8 +149,8 @@
* Return true if markup is simple
* @return
*/
- private boolean isSimple() {
- return this.getChildCount() == 0;
+ private boolean isSimple(AbstractProgressBarRenderer renderer) {
+ return renderer.isSimpleMarkup(this);
}
/**
Modified: trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
===================================================================
--- trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-02-19 11:42:38 UTC (rev 6155)
+++ trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-02-19 11:43:43 UTC (rev 6156)
@@ -102,26 +102,33 @@
public StringBuffer getMarkup(FacesContext context, UIComponent component) {
StringBuffer result = null;
CountingOutputWriter customWriter = new CountingOutputWriter();
- ResponseWriter writer = context.getResponseWriter();
try {
+ if (hasChildren(component)) {
+ ResponseWriter writer = context.getResponseWriter();
- String defaultRenderKitId = context.getApplication()
- .getDefaultRenderKitId();
- if (null == defaultRenderKitId) {
- defaultRenderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT;
- }
- RenderKitFactory renderKitFactory = (RenderKitFactory) FactoryFinder
- .getFactory(FactoryFinder.RENDER_KIT_FACTORY);
- RenderKit renderKit = renderKitFactory.getRenderKit(context,
- defaultRenderKitId);
+ String defaultRenderKitId = context.getApplication()
+ .getDefaultRenderKitId();
+ if (null == defaultRenderKitId) {
+ defaultRenderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT;
+ }
+ RenderKitFactory renderKitFactory = (RenderKitFactory) FactoryFinder
+ .getFactory(FactoryFinder.RENDER_KIT_FACTORY);
+ RenderKit renderKit = renderKitFactory.getRenderKit(context,
+ defaultRenderKitId);
- ResponseWriter responseWriter = renderKit.createResponseWriter(
- customWriter, null, "UTF-8");
- context.setResponseWriter(responseWriter);
- writeScriptBody(context, component, true);
- result = customWriter.getContent();
- if (writer != null) {
- context.setResponseWriter(writer);
+ ResponseWriter responseWriter = renderKit.createResponseWriter(
+ customWriter, null, "UTF-8");
+ context.setResponseWriter(responseWriter);
+ writeScriptBody(context, component, true);
+ result = customWriter.getContent();
+ if (writer != null) {
+ context.setResponseWriter(writer);
+ }
+
+ } else {
+ writeScriptBody(customWriter, (String) component
+ .getAttributes().get("label"));
+ result = customWriter.getContent();
}
} catch (Exception e) {
e.getMessage();
@@ -222,7 +229,7 @@
String mode = (String) component.getAttributes().get("mode");
Number minValue = getNumber(component.getAttributes().get("minValue"));
Number maxValue = getNumber(component.getAttributes().get("maxValue"));
- Number value = (Number)variables.getVariable("percent");
+ Number value =(Number)variables.getVariable("value");
StringBuffer markup = getMarkup(context, component);
script.append("new ProgressBar('")
@@ -250,7 +257,7 @@
script.append(state);
script.append("',");
script.append(value.toString());
- script.append(");\n");
+ script.append(")\n;");
writer.write(script.toString());
}
@@ -268,6 +275,9 @@
Integer interval = new Integer(progressBar.getInterval());
options.put("pollId", clientId);
options.put("pollinterval", interval);
+ if (progressBar.getAttributes().containsKey("ignoreDupResponses")) {
+ options.put("ignoreDupResponses", progressBar.getAttributes().get("ignoreDupResponses"));
+ }
Map parameters = (Map) options.get("parameters");
parameters.put("percent", "percent");
// options.put("onbeforedomupdate", getOnComplete(clientId, progressBar,
@@ -398,6 +408,7 @@
String clientId = component.getClientId(context);
ComponentVariables variables = ComponentsVariableResolver.getVariables(
this, component);
+
Number value = (Number) variables.getVariable("percent");
String width = String.valueOf(value.intValue());
@@ -506,12 +517,28 @@
}
/**
+ * Return true if component has children components
+ * @param component
+ * @return
+ */
+ private boolean hasChildren (UIComponent component) {
+ return (component.getChildCount() != 0);
+ }
+
+ /**
* Returns true if markup should rendered as simple 2 divs
* @param component
* @return
*/
- private boolean isSimpleMarkup(UIComponent component) {
- return (component.getChildCount() == 0);
+ public boolean isSimpleMarkup(UIComponent component) {
+ if (hasChildren(component)) {
+ return false;
+ } else {
+ if (component.getAttributes().get("label") != null) {
+ return false;
+ }
+ }
+ return true;
}
/**
@@ -592,6 +619,21 @@
}
return result;
}
+
+ /**
+ * Calculates percent value according to min & max value
+ * @param value
+ * @param minValue
+ * @param maxValue
+ * @return
+ */
+ public Number calculatePercent(Number value, Number minValue, Number maxValue) {
+ if (minValue.doubleValue() < value.doubleValue() && value.doubleValue() < maxValue.doubleValue()) {
+ return (Number)( (value.doubleValue() - minValue.doubleValue()) * 100.0/(maxValue.doubleValue() - minValue.doubleValue()));
+ } else {
+ return value;
+ }
+ }
/**
* Returns JS script to stop polling
Modified: trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
===================================================================
--- trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-19 11:42:38 UTC (rev 6155)
+++ trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-19 11:43:43 UTC (rev 6156)
@@ -31,7 +31,7 @@
onComplete: function (data) {
if (!$(this.id) || this.disabled) { return; }
if (data) {
- this.value = data['percent'];
+ this.value = data['value'];
if (this.state == "progressState") {
if (this.value > this.getMaxValue()) {
this.forceState("complete",null);
@@ -61,7 +61,7 @@
},
updateComponent: function (data) {
this.updateStyle(data['style']);
- this.setValue(data['percent']);
+ this.setValue(this.value);
if (!data['enabled']) { this.disable(); }
this.updateClassName($(this.id + ":complete"), data['completeClass']);
this.updateClassName($(this.id + ":remain"), data['remainClass']);
@@ -96,8 +96,8 @@
getContext: function () {
var context = this.context;
if (!context) { context = {}; }
- context['minValue'] = this.minValue;
- context['maxValue'] = this.maxValue;
+ context['minValue'] = (this.minValue == 0 ? "0" : this.minValue);
+ context['maxValue'] = (this.maxValue == 0 ? "0" : this.maxValue);
context['value'] = (this.value == 0 ? "0" : this.value);
if (this.progressVar) {
context[this.progressVar] = context['value'];
@@ -143,19 +143,21 @@
isAjaxMode: function () {
return (this.getMode() == "ajax");
},
+ calculatePercent: function(v) {
+ var min = parseFloat(this.getMinValue());
+ var max = parseFloat(this.getMaxValue());
+ var value = parseFloat(v);
+ if (value > min && value < max) {
+ return (100*(value - min))/(max - min);
+ }
+ return value;
+ },
setValue: function (val) {
this.value = val;
- var p = val;
- val = "" + val;
- if (val != null) {
- if (val.indexOf("%") < 0)
- val = val + "%";
- }
-
if (!this.isAjaxMode()) {
- if ( parseFloat(p) <= parseFloat(this.getMinValue())) {
+ if (parseFloat(val) <= parseFloat(this.getMinValue())) {
this.switchState("initialState");
- }else if ( parseFloat(p) > parseFloat(this.getMaxValue())) {
+ }else if (parseFloat(val) > parseFloat(this.getMaxValue())) {
this.switchState("completeState");
}else {
this.switchState("progressState");
@@ -168,15 +170,16 @@
} else {
//this.setLabel("{value}%");
}
-
+
+ var p = this.calculatePercent(val);
var d = $(this.id + ":upload");
- if (d != null) d.style.width = val;
+ if (d != null) d.style.width = (p + "%");
},
enable: function (ev) {
if (!this.isAjaxMode()) {
this.switchState("progressState");
- this.setValue(0);
+ this.setValue(this.getMinValue() + 1);
}else {
this.disable();
this.poll();
@@ -188,7 +191,12 @@
A4J.AJAX.StopPoll(this.id);
},
finish: function () {
- //this.switchMode("completed");
+ if (!this.isAjaxMode()) {
+ this.switchState("completeState");
+ }else {
+ this.disable();
+ this.forceState("complete");
+ }
},
hideAll: function () {
Element.hide($(this.id + ":progressState"));
Modified: trunk/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx
===================================================================
--- trunk/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx 2008-02-19 11:42:38 UTC (rev 6155)
+++ trunk/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx 2008-02-19 11:43:43 UTC (rev 6156)
@@ -21,14 +21,16 @@
<jsp:scriptlet>
<![CDATA[
String mode = (String) component.getAttributes().get("mode");
+ boolean isAjax = ("ajax".equalsIgnoreCase(mode));
if (!mode.equalsIgnoreCase("client") && !mode.equalsIgnoreCase("ajax")) {
throw new IOException("Mode attribute should have 'client' or 'ajax' value");
}
Number minValue = getNumber(component.getAttributes().get("minValue"));
Number maxValue = getNumber(component.getAttributes().get("maxValue"));
- boolean isAjax = ("ajax".equalsIgnoreCase(mode));
Number value = getNumber(component.getAttributes().get("value"));
- variables.setVariable("percent",value);
+ Number percent = calculatePercent(value,minValue, maxValue);
+ variables.setVariable("percent",percent);
+ variables.setVariable("value",value);
variables.setVariable("style",(String)component.getAttributes().get("style"));
variables.setVariable("styleClass",(String)component.getAttributes().get("styleClass"));
String forcedState = getForcedState(context,component);
18 years, 2 months
JBoss Rich Faces SVN: r6155 - trunk/framework/impl/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-19 06:42:38 -0500 (Tue, 19 Feb 2008)
New Revision: 6155
Modified:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java
Log:
change access type of function to public
Modified: trunk/framework/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java 2008-02-19 11:02:20 UTC (rev 6154)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java 2008-02-19 11:42:38 UTC (rev 6155)
@@ -59,7 +59,7 @@
return true;
}
- void writeScriptBody(Writer writer, String string) throws IOException {
+ public void writeScriptBody(Writer writer, String string) throws IOException {
Properties tidyProperties = new Properties();
InputStream propertiesStream = null;
try {
18 years, 2 months
JBoss Rich Faces SVN: r6154 - in trunk: ui/dataTable/src/main/java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-02-19 06:02:20 -0500 (Tue, 19 Feb 2008)
New Revision: 6154
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
Log:
http://jira.jboss.com/jira/browse/RF-1839
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-02-19 10:25:01 UTC (rev 6153)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-02-19 11:02:20 UTC (rev 6154)
@@ -35,6 +35,7 @@
import javax.faces.component.EditableValueHolder;
import javax.faces.component.NamingContainer;
import javax.faces.component.StateHolder;
+import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import javax.faces.component.UIData;
import javax.faces.context.FacesContext;
@@ -54,6 +55,7 @@
import org.ajax4jsf.renderkit.AjaxChildrenRenderer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.richfaces.component.Column;
/**
* Base class for iterable components, like dataTable, Tomahawk dataList,
@@ -109,7 +111,14 @@
public void processComponent(FacesContext context, UIComponent c,
Object argument) {
- c.processDecodes(context);
+ if (c instanceof UIColumn || c instanceof Column) {
+ for (Iterator children = c.getChildren().iterator(); children.hasNext(); ) {
+ UIComponent child = (UIComponent) children.next();
+ child.processDecodes(context);;
+ }
+ } else {
+ c.processDecodes(context);
+ }
}
};
@@ -121,7 +130,14 @@
public void processComponent(FacesContext context, UIComponent c,
Object argument) {
- c.processValidators(context);
+ if (c instanceof UIColumn || c instanceof Column) {
+ for (Iterator children = c.getChildren().iterator(); children.hasNext(); ) {
+ UIComponent child = (UIComponent) children.next();
+ child.processValidators(context);
+ }
+ } else {
+ c.processValidators(context);
+ }
}
};
@@ -133,7 +149,14 @@
public void processComponent(FacesContext context, UIComponent c,
Object argument) {
- c.processUpdates(context);
+ if (c instanceof UIColumn || c instanceof Column) {
+ for (Iterator children = c.getChildren().iterator(); children.hasNext(); ) {
+ UIComponent child = (UIComponent) children.next();
+ child.processUpdates(context);
+ }
+ } else {
+ c.processUpdates(context);
+ }
}
};
@@ -866,9 +889,11 @@
while (itr.hasNext()) {
saveChildState(faces, (UIComponent) itr.next(), childState);
}
- itr = c.getFacets().values().iterator();
- while (itr.hasNext()) {
- saveChildState(faces, (UIComponent) itr.next(), childState);
+ if (!(c instanceof UIColumn || c instanceof Column)) {
+ itr = c.getFacets().values().iterator();
+ while (itr.hasNext()) {
+ saveChildState(faces, (UIComponent) itr.next(), childState);
+ }
}
}
@@ -919,9 +944,11 @@
while (itr.hasNext()) {
restoreChildState(faces, (UIComponent) itr.next(), childState);
}
- itr = c.getFacets().values().iterator();
- while (itr.hasNext()) {
- restoreChildState(faces, (UIComponent) itr.next(), childState);
+ if (!(c instanceof UIColumn || c instanceof Column)) {
+ itr = c.getFacets().values().iterator();
+ while (itr.hasNext()) {
+ restoreChildState(faces, (UIComponent) itr.next(), childState);
+ }
}
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-02-19 10:25:01 UTC (rev 6153)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-02-19 11:02:20 UTC (rev 6154)
@@ -110,13 +110,9 @@
.iterator(), isAjaxSupport));
- // http://jira.jboss.com/jira/browse/RF-1839
- // Append all column's children (facets have
- // been processed with fixedChildren() already)
- for (Iterator columns = columns(); columns.hasNext(); ) {
- UIComponent column = (UIComponent) columns.next();
- dataChildren.addIterator(column.getChildren().iterator());
- }
+
+ // Append all columns children.
+ dataChildren.addIterator(columns());
// for (Iterator iter = columns(); iter.hasNext();) {
// UIComponent column = (UIComponent) iter.next();
18 years, 2 months
JBoss Rich Faces SVN: r6153 - trunk/docs/faq/en/src/main/docbook/module.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-19 05:25:01 -0500 (Tue, 19 Feb 2008)
New Revision: 6153
Modified:
trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
Log:
http://jira.jboss.com/jira/browse/RF-2147 - How to select one row of a dataTable by clicking on it, even if clicked in an inputText of this row
Modified: trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
===================================================================
--- trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-02-19 00:31:04 UTC (rev 6152)
+++ trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-02-19 10:25:01 UTC (rev 6153)
@@ -1460,7 +1460,7 @@
<section id="RowSelectionInDataTable">
<?dbhtml filename="HighlightRowDataTable.html"?>
<title>How to highlight rows in a dataTable when the mouse is over?</title>
- <para>In order <property>to highlight rows in a dataTable when the mouse is over</property> you should use <emphasis><property>"onmouseover"</property></emphasis> and <emphasis><property>"onmouseout"</property></emphasis> attributes. </para>
+ <para>In order to highlight rows in a dataTable when the mouse is over you should use <emphasis><property>"onmouseover"</property></emphasis> and <emphasis><property>"onmouseout"</property></emphasis> attributes. </para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
@@ -1553,4 +1553,42 @@
</section>
+ <section id="OneRowSelectionInDataTable">
+ <?dbhtml filename="HighlightRowDataTable.html"?>
+ <title>How to select one row of a dataTable by clicking on it, even if clicked in an inputText of this row?</title>
+ <para>In order to select one row of a dataTable by clicking on it you could use JavaScript function described below. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<script type="text/javascript">
+ var oldRow;
+ function changeColor(row)
+ {
+ if (oldRow!=undefined)
+ {
+ oldRow.style.backgroundColor='#ffffff';
+ }
+ row.style.backgroundColor='#ffff00';
+ oldRow=row;
+ }
+</script>
+...]]></programlisting>
+ <para>Then you could use <emphasis role="bold"><property>a4j:support</property></emphasis> with <emphasis><property>"event"</property></emphasis> and <emphasis><property>"onsubmit"</property></emphasis> attributes.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:form>
+ <rich:dataTable cellpadding="0" cellspacing="0"
+ width="700" border="0" var="record" value="#{report.expReport.records}">
+ <a4j:support event="onRowClick" onsubmit="changeColor(this)" ajaxSingle="true">
+ <f:param name="currentRow" value="#{record.city}"/>
+ </a4j:support>
+ ...
+ </rich:dataTable>
+</h:form>
+...]]></programlisting>
+ </section>
+
</chapter>
18 years, 2 months
JBoss Rich Faces SVN: r6152 - in trunk/samples/richfaces-demo: src/main/webapp/WEB-INF and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-02-18 19:31:04 -0500 (Mon, 18 Feb 2008)
New Revision: 6152
Modified:
trunk/samples/richfaces-demo/pom.xml
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
Log:
Modified: trunk/samples/richfaces-demo/pom.xml
===================================================================
--- trunk/samples/richfaces-demo/pom.xml 2008-02-19 00:28:01 UTC (rev 6151)
+++ trunk/samples/richfaces-demo/pom.xml 2008-02-19 00:31:04 UTC (rev 6152)
@@ -13,7 +13,7 @@
<build>
<finalName>richfaces-demo</finalName>
<plugins>
- <plugin>
+ <!--plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
@@ -73,7 +73,7 @@
<argument>${project.build.directory}/richfaces/META-INF/rich.tld</argument>
</arguments>
</configuration>
- </plugin>
+ </plugin-->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-02-19 00:28:01 UTC (rev 6151)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-02-19 00:31:04 UTC (rev 6152)
@@ -73,7 +73,7 @@
<managed-bean>
<managed-bean-name>dataTableScrollerBean</managed-bean-name>
<managed-bean-class>org.richfaces.datatablescroller.DataTableScrollerBean</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
+ <managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>toggleBean</managed-bean-name>
@@ -264,7 +264,7 @@
</managed-property>
<managed-property>
<property-name>singleMode</property-name>
- <property-class>boolean</property-class>
+ <property-class>java.lang.Boolean</property-class>
<value>true</value>
</managed-property>
</managed-bean>
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2008-02-19 00:28:01 UTC (rev 6151)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2008-02-19 00:31:04 UTC (rev 6152)
@@ -45,11 +45,11 @@
</context-param>
<!--context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
- <param-value>ALL</param-value>
+ <param-value>DEFAULT</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
- <param-value>ALL</param-value>
+ <param-value>DEFAULT</param-value>
</context-param-->
<filter>
18 years, 2 months
JBoss Rich Faces SVN: r6151 - trunk/docs/userguide/en/src/main/docbook.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-02-18 19:28:01 -0500 (Mon, 18 Feb 2008)
New Revision: 6151
Modified:
trunk/docs/userguide/en/src/main/docbook/master.xml
Log:
combobox case updated in doc.
Modified: trunk/docs/userguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/master.xml 2008-02-19 00:03:04 UTC (rev 6150)
+++ trunk/docs/userguide/en/src/main/docbook/master.xml 2008-02-19 00:28:01 UTC (rev 6151)
@@ -52,7 +52,7 @@
<!ENTITY orderingList_table SYSTEM "../../../target/generated/orderingList.xml">
<!ENTITY componentControl_table SYSTEM "../../../target/generated/componentControl.xml">
<!ENTITY columns_table SYSTEM "../../../target/generated/columns.xml">
-<!ENTITY comboBox_table SYSTEM "../../../target/generated/comboBox.xml">
+<!ENTITY comboBox_table SYSTEM "../../../target/generated/combobox.xml">
<!ENTITY pickList_table SYSTEM "../../../target/generated/pickList.xml">
<!ENTITY coreComponents_table SYSTEM "../../../target/generated/a4j.xml">
18 years, 2 months
JBoss Rich Faces SVN: r6150 - trunk/docs/userguide.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-02-18 19:03:04 -0500 (Mon, 18 Feb 2008)
New Revision: 6150
Modified:
trunk/docs/userguide/pom.xml
Log:
combobox case updated in doc. pom.xml
Modified: trunk/docs/userguide/pom.xml
===================================================================
--- trunk/docs/userguide/pom.xml 2008-02-18 19:13:50 UTC (rev 6149)
+++ trunk/docs/userguide/pom.xml 2008-02-19 00:03:04 UTC (rev 6150)
@@ -80,7 +80,7 @@
org.richfaces.ui
</groupId>
<artifactId>
- comboBox
+ combobox
</artifactId>
<version>
${project.version}
18 years, 2 months
JBoss Rich Faces SVN: r6149 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vsukhov
Date: 2008-02-18 14:13:50 -0500 (Mon, 18 Feb 2008)
New Revision: 6149
Modified:
trunk/docs/userguide/en/src/main/docbook/included/pickList.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/pickList.xml
Log:
http://jira.jboss.com/jira/browse/RF-2174 Skin Parameters Redefinition, Definition of Custom Style Classes done without screenshots.
Modified: trunk/docs/userguide/en/src/main/docbook/included/pickList.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/pickList.desc.xml 2008-02-18 17:09:11 UTC (rev 6148)
+++ trunk/docs/userguide/en/src/main/docbook/included/pickList.desc.xml 2008-02-18 19:13:50 UTC (rev 6149)
@@ -9,9 +9,7 @@
<title>Description</title>
<para>The <emphasis role="bold">
<property><rich:pickList></property>
- </emphasis> is a component for ordering items in a list. This component provides possibilities similar to <emphasis role="bold"><property><rich:orderingList></property></emphasis>, except sorting items on the client side.
- <emphasis role="bold">
- <property><rich:pickList></property></emphasis> doesn't have this possibility.
+ </emphasis> component is used for moving chosen items from one list into another.
</para>
<figure>
<title><emphasis role="bold">
Modified: trunk/docs/userguide/en/src/main/docbook/included/pickList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/pickList.xml 2008-02-18 17:09:11 UTC (rev 6148)
+++ trunk/docs/userguide/en/src/main/docbook/included/pickList.xml 2008-02-18 19:13:50 UTC (rev 6149)
@@ -39,9 +39,14 @@
<entry>org.richfaces.PickListRenderer</entry>
</row>
<row>
+ <entry>renderer-class</entry>
+
+ <entry>org.richfaces.renderkit.html.PickListRendererGen</entry>
+ </row>
+ <row>
<entry>tag-class</entry>
- <entry>org.richfaces.taglib.PickListTagHandler</entry>
+ <entry>org.richfaces.taglib.PickListTag</entry>
</row>
</tbody>
</tgroup>
@@ -53,7 +58,8 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[...<pickList:pickList
+ <programlisting role="XML"><![CDATA[...
+ <pickList:pickList
copyControlLabel = "#{pickBean.copyLabel}"
value="#{pickBean.listValues}">
<f:selectItems value="#{pickBean.testList}"/>
@@ -83,7 +89,7 @@
has three different representations for a single element: common, selected,
active. Combination of these states is possible.</listitem>
<listitem>
- <property>Ordering controls set</property>
+ <property>Move controls set</property> is a set of controls, which performs moving items between lists.
</listitem>
</itemizedlist>
</para>
@@ -182,12 +188,7 @@
</listitem>
</itemizedlist>
</para>
- <para>
- The
- <emphasis>
- <property> "value"</property></emphasis> attribute defines array of items to be shown in a list.
- With the help of this attribute you can input the list of items.
- </para>
+
<table>
<title>Keyboard usage for elements selection</title>
@@ -278,6 +279,22 @@
</row>
<!--List managing API -->
<row>
+ <entry>copy()</entry>
+ <entry>Copies selected item from the source list to the target list</entry>
+ </row>
+ <row>
+ <entry>remove()</entry>
+ <entry>Removes selected item from the target list to the source list</entry>
+ </row>
+ <row>
+ <entry>copyAll()</entry>
+ <entry>Copies all items from the source list to the target list</entry>
+ </row>
+ <row>
+ <entry>removeAll()</entry>
+ <entry>Removes all items from the target list to the source list</entry>
+ </row>
+ <row>
<entry>getSelection()</entry>
<entry>Returns currently selected item</entry>
</row>
@@ -311,8 +328,8 @@
<section>
<title>Skin Parameters Redefinition</title>
- <!--table>
- <title>Skin parameters redefinition for a wrapper <div> element of a list</title>
+ <table>
+ <title>Skin parameters redefinition for a list</title>
<tgroup cols="2">
<thead>
<row>
@@ -322,13 +339,207 @@
</thead>
<tbody>
<row>
- <entry></entry>
+ <entry>generalBackgroundColor</entry>
+ <entry>background-color</entry>
</row>
+
</tbody>
</tgroup>
- </table-->
-
+ </table>
+ <table>
+ <title>Skin parameters redefinition for a button</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>trimColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a pressed and highlighted button</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>trimColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>tableBorderWidth</entry>
+ <entry>border-width</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a button selection</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a button content</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a source and target items</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>tableBorderWidth</entry>
+ <entry>border-width</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a source and target cell</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a controls</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>tableBottomBorderColor</entry>
+ <entry>border-bottom-color</entry>
+ </row>
+ <row>
+ <entry>tableTopBorderColor</entry>
+ <entry>border-top-color</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
</section>
@@ -338,39 +549,208 @@
<para>On the screenshot there are classes names that define styles for component elements.</para>
- <figure>
+ <!--figure>
<title>Classes names</title>
- <!--mediaobject>
+ <mediaobject>
<imageobject>
<imagedata fileref="images/orderingList_classes_1.png"/>
</imageobject>
- </mediaobject-->
+ </mediaobject>
- </figure>
+ </figure-->
- <!--table id="OrderLC">
+ <table >
<title>Classes names that define a list representation</title>
<tgroup cols="2">
<thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-picklist-list</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ <row>
+ <entry>rich-list-picklist</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table >
+ <title>Classes names that define a button representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-list-picklist-button</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ <row>
+ <entry>rich-list-picklist-button-disabled</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table >
+ <title>Classes names that define a pressed and highlighted button representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-list-picklist-button-press</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ <row>
+ <entry>rich-list-picklist-button-light</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table >
+ <title>Classes names that define a button selection representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-list-picklist-button-selection</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table >
+ <title>Classes names that define a button content representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>ich-list-picklist-button-content</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table >
+ <title>Classes names that define a source and target items representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
</thead>
<tbody>
+ <row>
+ <entry>rich-picklist-source-items</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-target-items</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
</tbody>
</tgroup>
</table>
-
+ <table >
+ <title>Classes names that define a source and target cell representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-picklist-source-cell</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-target-cell</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
</tbody>
</tgroup>
</table>
+
+
+
+ <table >
+ <title>Classes names that define a control representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-picklist-control-disabled</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-control-copyall</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-control-copy</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-control-remove</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+ <row>
+ <entry>rich-picklist-control-removeall</entry>
+ <entry>rich-picklist-list</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
<para>In order to redefine styles for all <emphasis role="bold">
<property><rich:pickList></property>
</emphasis> components on a page using CSS, it's enough to create classes with the
same names (possible classes could be found in the tables <link linkend="OrderL"> above</link>) and define necessary properties in them. </para>
- <para>
+ <!--para>
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="CSS"><![CDATA[...
18 years, 2 months
JBoss Rich Faces SVN: r6148 - trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-18 12:09:11 -0500 (Mon, 18 Feb 2008)
New Revision: 6148
Modified:
trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.jsp
trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.xhtml
Log:
Modified: trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.jsp 2008-02-18 17:06:09 UTC (rev 6147)
+++ trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.jsp 2008-02-18 17:09:11 UTC (rev 6148)
@@ -46,7 +46,7 @@
<h:inputText value="#{bean.controlsPosition}" />
<h:outputText value="controlsHorizontalAlign (default: left) is: " />
- <h:inputText value="#{bean.onchangeScript}" />
+ <h:inputText value="#{bean.controlsHorizontalAlign}" />
<h:outputText value="tabindex: " />
<h:inputText value="#{bean.tabindex}" />
Modified: trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.xhtml 2008-02-18 17:06:09 UTC (rev 6147)
+++ trunk/sandbox/samples/inplaceInput-sample/src/main/webapp/pages/index.xhtml 2008-02-18 17:09:11 UTC (rev 6148)
@@ -53,7 +53,7 @@
<h:inputText value="#{bean.controlsPosition}" />
<h:outputText value="controlsHorizontalAlign (default: left) is: " />
- <h:inputText value="#{bean.onchangeScript}" />
+ <h:inputText value="#{bean.controlsHorizontalAlign}" />
<h:outputText value="tabindex: " />
<h:inputText value="#{bean.tabindex}" />
18 years, 2 months