JBoss Rich Faces SVN: r5866 - management/design/progressBar/markup.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-02-06 09:26:27 -0500 (Wed, 06 Feb 2008)
New Revision: 5866
Modified:
management/design/progressBar/markup/ProgressBar.html
Log:
Modified: management/design/progressBar/markup/ProgressBar.html
===================================================================
--- management/design/progressBar/markup/ProgressBar.html 2008-02-06 13:35:29 UTC (rev 5865)
+++ management/design/progressBar/markup/ProgressBar.html 2008-02-06 14:26:27 UTC (rev 5866)
@@ -10,18 +10,19 @@
body{margin : 20px}
*{font-family : verdana; font-size : 11px}
.pbar_block{ white-space : nowrap;}
-.pbar_bar_height{height : 15px;}
+.pbar_bar_height{height : 13px;}
.pbar_bar_width{width : 200px}
-.pbar_bar_uploaded{width : 99px; height : 100%; background : #FF9409/*selectControlColor*/; background-image : url(images/bg_ProgressBar_perm.gif);background-repeat : repeat-x;}
+.pbar_bar_uploaded{width : 99px; background : #FF9409/*selectControlColor*/; background-image : url(images/bg_ProgressBar_perm.gif);background-repeat : repeat-x;}
.pbar_bar_shell{margin-bottom : 2px; background : #FFFFFF /*controlBackgroundColor*/; border : 1px solid #c0c0c0/*panelBorderColor*/;}
+.pbar_bar_height_dig{height:}
+.pbar_bar_uploaded_dig{width : 99px; overflow : hidden; position : absolute; top : 0px; left : 0px;}
+.pbar_bar_shell_dig{position : relative; margin-bottom : 2px; border : 1px solid #c0c0c0/*panelBorderColor*/;}
+.pbar_bar_track_dig{background : #FFFFFF /*controlBackgroundColor*/; text-align : center; color : #000000 /*controlTextColor*/; font-weight : bold; position : relative;}
+.pbar_bar_ststusline_dig{background : #FF9409/*selectControlColor*/; text-align : center; color : #FFFFFF /*controlBackgroundColor*/; font-weight : bold; background-image : url(images/bg_ProgressBar_perm.gif);background-repeat : repeat-x;}
+.pbar_bar_padding{padding: 0px}
-.pbar_bar_uploaded_dig{width : 99px; overflow : hidden; position : absolute; border : 1px solid #c0c0c0/*panelBorderColor*/;}
-.pbar_bar_shell_dig{position : relative; margin-bottom : 2px;}
-.pbar_bar_track_dig{background : #FFFFFF /*controlBackgroundColor*/; text-align : center; border : 1px solid #c0c0c0/*panelBorderColor*/; color : #000000 /*controlTextColor*/; font-weight : bold; position : absolute;}
-.pbar_bar_ststusline_dig{background : #FF9409/*selectControlColor*/; text-align : center; color : #FFFFFF /*controlBackgroundColor*/; font-weight : bold; background-image : url(images/bg_ProgressBar_perm.gif);background-repeat : repeat-x; position : absolute;}
-
.pbar_name_padding{padding : 0px 0px 2px 0px; font-size : 10px}
</style>
@@ -36,8 +37,8 @@
<div class="pbar_name_padding">
file_upload.html
</div>
-<div class="pbar_block pbar_bar_height pbar_bar_width pbar_bar_shell">
- <div class="pbar_bar_uploaded">
+<div class="pbar_block pbar_bar_width pbar_bar_shell">
+ <div class="pbar_bar_height pbar_bar_uploaded">
</div>
</div>
@@ -52,12 +53,12 @@
<fieldset><legend>Progress Bar with digital status indication</legend>
<br><br>
-<div class="pbar_block pbar_bar_height pbar_bar_width pbar_bar_shell_dig">
- <div class="pbar_bar_height pbar_bar_width pbar_bar_track_dig">
+<div class="pbar_block pbar_bar_width pbar_bar_shell_dig">
+ <div class=" pbar_bar_width pbar_bar_track_dig pbar_bar_padding">
50%
</div>
- <div class="pbar_bar_height pbar_bar_uploaded_dig">
- <div class="pbar_bar_height pbar_bar_width pbar_bar_ststusline_dig">
+ <div class=" pbar_bar_uploaded_dig">
+ <div class="pbar_bar_height_dig pbar_bar_width pbar_bar_ststusline_dig pbar_bar_padding">
50%
</div>
</div>
16 years, 3 months
JBoss Rich Faces SVN: r5865 - in trunk/sandbox/ui/progressBAR/src/main: resources/org/richfaces/renderkit/html/js and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-06 08:35:29 -0500 (Wed, 06 Feb 2008)
New Revision: 5865
Modified:
trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
Log:
last portion of fixs
Modified: trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-02-06 13:12:11 UTC (rev 5864)
+++ trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-02-06 13:35:29 UTC (rev 5865)
@@ -349,12 +349,13 @@
ComponentVariables variables = ComponentsVariableResolver.getVariables(
this, component);
String clientId = component.getClientId(context);
+ String styleClass = (String) variables.getVariable("styleClass");
writer.startElement("div", component);
getUtils().writeAttribute(
writer,
"class",
"rich-progress-bar "
- + (String) variables.getVariable("styleClass"));
+ + (styleClass != null ? styleClass : ""));
getUtils().writeAttribute(writer, "id", clientId);
getUtils().writeAttribute(writer, "style",
variables.getVariable("style"));
Modified: trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-06 13:12:11 UTC (rev 5864)
+++ trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-06 13:35:29 UTC (rev 5865)
@@ -59,7 +59,7 @@
if (!data['enabled']) { this.disable(); }
this.updateClassName($(this.id + ":complete"), data['completeClass'], "rich-progress-bar-base");
this.updateClassName($(this.id + ":remain"), data['remainClass'], "rich-progress-bar-base");
- this.updateClassName($(this.id), data['styleClass'], "rich-progress-bar-base");
+ this.updateClassName($(this.id), data['styleClass'], "rich-progress-bar");
if (this.options.pollinterval != data['interval']) {
this.options.pollinterval = data['interval'];
16 years, 3 months
JBoss Rich Faces SVN: r5864 - trunk/ui/datascroller/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2008-02-06 08:12:11 -0500 (Wed, 06 Feb 2008)
New Revision: 5864
Modified:
trunk/ui/datascroller/src/main/config/component/datascroller.xml
Log:
http://jira.jboss.com/jira/browse/RF-1340
Modified: trunk/ui/datascroller/src/main/config/component/datascroller.xml
===================================================================
--- trunk/ui/datascroller/src/main/config/component/datascroller.xml 2008-02-06 12:59:45 UTC (rev 5863)
+++ trunk/ui/datascroller/src/main/config/component/datascroller.xml 2008-02-06 13:12:11 UTC (rev 5864)
@@ -57,13 +57,6 @@
&ui_component_attributes;
<property>
- <name>id</name>
- <classname>java.lang.String</classname>
- <description>Every component may have a unique id that is automatically created if omitted
- </description>
- </property>
-
- <property>
<name>handleValue</name>
<classname>java.lang.String</classname>
<description>Current handle value
@@ -71,13 +64,6 @@
</property>
<property>
- <name>binding</name>
- <classname>java.lang.String</classname>
- <description>The attribute takes a value-binding expression for a component property of a backing bean
- </description>
- </property>
-
- <property>
<name>scrollerListener</name>
<classname>javax.el.MethodExpression</classname>
<description>MethodBinding representing an action listener method that will be notified after scrolling
16 years, 3 months
JBoss Rich Faces SVN: r5863 - trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-06 07:59:45 -0500 (Wed, 06 Feb 2008)
New Revision: 5863
Modified:
trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
Log:
Modified: trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-06 12:28:21 UTC (rev 5862)
+++ trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-06 12:59:45 UTC (rev 5863)
@@ -34,7 +34,7 @@
if (this.state == "progress") {
this.updateComponent(data);
this.renderLabel(data['markup'], data['context']);
- } else if (this.state == "initial" && this.value == this.getMinValue()) {
+ } else if (this.state == "initial" && this.value >= this.getMinValue()) {
this.state = "progress";
this.forceState(this.value, function () { this.poll() }.bind(this));
}
@@ -157,7 +157,7 @@
if (this.markup) {
this.renderLabel(this.markup, this.getContext());
} else {
- this.setLabel("{value}%");
+ //this.setLabel("{value}%");
}
d = $(this.id + ":upload");
16 years, 3 months
JBoss Rich Faces SVN: r5862 - in trunk/sandbox/samples/progressBarDemo/src/main: webapp/WEB-INF and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-06 07:28:21 -0500 (Wed, 06 Feb 2008)
New Revision: 5862
Modified:
trunk/sandbox/samples/progressBarDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java
trunk/sandbox/samples/progressBarDemo/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp
Log:
fix problems
Modified: trunk/sandbox/samples/progressBarDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java
===================================================================
--- trunk/sandbox/samples/progressBarDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java 2008-02-06 12:28:07 UTC (rev 5861)
+++ trunk/sandbox/samples/progressBarDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java 2008-02-06 12:28:21 UTC (rev 5862)
@@ -37,6 +37,10 @@
private Integer value = 0;
+ public String action () {
+ return null;
+ }
+
public String start() {
this.enabled = true;
return null;
Modified: trunk/sandbox/samples/progressBarDemo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/progressBarDemo/src/main/webapp/WEB-INF/web.xml 2008-02-06 12:28:07 UTC (rev 5861)
+++ trunk/sandbox/samples/progressBarDemo/src/main/webapp/WEB-INF/web.xml 2008-02-06 12:28:21 UTC (rev 5862)
@@ -26,11 +26,18 @@
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
-
+
<context-param>
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
<param-value>false</param-value>
</context-param>
+
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_STYLE</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+
<!--
-->
<filter>
Modified: trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp 2008-02-06 12:28:07 UTC (rev 5861)
+++ trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp 2008-02-06 12:28:21 UTC (rev 5862)
@@ -33,7 +33,7 @@
<h:outputText value="Progress value: " />
<h:inputText value="#{bean.value}" />
- <h:commandButton value="Set" />
+ <h:commandButton action="#{bean.action}" value="Set" />
</h:panelGrid>
</h:form>
@@ -80,16 +80,16 @@
<script>
var pr = $('_form:progrs').component;
</script>
- <input type="button" value="Get value" onclick="alert(pr.getValue());" /><br/>
+ <input type="button" value="Get value" onclick="alert($('_form:progrs').component.getValue());" /><br/>
<input type="text" value="" id="percent"/>
- <input type="button" value="Set value" onclick="pr.setValue(document.getElementById('percent').value);" />
+ <input type="button" value="Set value" onclick="$('_form:progrs').component.setValue(document.getElementById('percent').value);" />
<br/>
<input type="text" value="" id="label"/>
- <input type="button" value="Set label" onclick="pr.setLabel(document.getElementById('label').value);" />
+ <input type="button" value="Set label" onclick="$('_form:progrs').component.setLabel(document.getElementById('label').value);" />
<br/>
- <input type="button" value="Disable" onclick="pr.disable();" />
+ <input type="button" value="Disable" onclick="$('_form:progrs').component.disable();" />
<br/>
- <input type="button" value="Enable" onclick="pr.enable(event);" />
+ <input type="button" value="Enable" onclick="$('_form:progrs').component.enable(event);" />
</f:view>
</body>
16 years, 3 months
JBoss Rich Faces SVN: r5861 - in trunk/sandbox/ui/progressBAR/src/main: java/org/richfaces/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-06 07:28:07 -0500 (Wed, 06 Feb 2008)
New Revision: 5861
Modified:
trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java
trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
Log:
fix problems
Modified: trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java 2008-02-06 10:35:10 UTC (rev 5860)
+++ trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java 2008-02-06 12:28:07 UTC (rev 5861)
@@ -21,7 +21,6 @@
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.context.AjaxContextImpl;
import org.ajax4jsf.event.AjaxEvent;
-import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.javascript.JSLiteral;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.richfaces.renderkit.AbstractProgressBarRenderer;
@@ -39,10 +38,11 @@
public static final String COMPONENT_TYPE = "org.richfaces.ProgressBar";
public static final String COMPONENT_FAMILY = "org.richfaces.ProgressBar";
-
+
/** Request parameter name containing component state to render */
- private static final String FORCE_STATE_PARAM = "forceState";
+ public static final String FORCE_PERCENT_PARAM = "forcePercent";
+
/* (non-Javadoc)
* @see org.ajax4jsf.component.AjaxActionComponent#broadcast(javax.faces.event.FacesEvent)
*/
@@ -59,11 +59,11 @@
Number percent = getNumber(this.getAttributes().get("value"));
Number maxValue = getNumber(this.getAttributes().get("maxValue"));
Map params = request.getParameterMap();
- if (params.containsKey(FORCE_STATE_PARAM)) {
+ if (params.containsKey(FORCE_PERCENT_PARAM)) {
ajaxContext.addComponentToAjaxRender(this);
- String[] str = (String[]) params.get(FORCE_STATE_PARAM);
+ String[] str = (String[]) params.get(FORCE_PERCENT_PARAM);
for (String s : str) {
- this.getAttributes().put(FORCE_STATE_PARAM, s);
+ this.getAttributes().put(FORCE_PERCENT_PARAM, s);
}
} else if (percent.doubleValue() < maxValue.doubleValue()
&& params.containsKey("percent")) {
@@ -88,7 +88,7 @@
}
}
-
+
/**
* Returns ajax response data
*
Modified: trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-02-06 10:35:10 UTC (rev 5860)
+++ trunk/sandbox/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-02-06 12:28:07 UTC (rev 5861)
@@ -40,9 +40,6 @@
*/
public class AbstractProgressBarRenderer extends TemplateEncoderRendererBase {
- /** Request parameter name containing component state to render */
- private static final String FORCE_STATE_PARAM = "forceState";
-
/** Ajax function performing polling */
private static final String AJAX_POLL_FUNCTION = "A4J.AJAX.Poll";
@@ -74,9 +71,9 @@
} else if ("complete".equals(state)) {
encodeCompletedState(context, component);
}
- component.getAttributes().remove(FORCE_STATE_PARAM);
+ component.getAttributes().remove(UIProgressBar.FORCE_PERCENT_PARAM);
}
-
+
/**
* Gets state forced from javascript
*
@@ -84,10 +81,32 @@
* @return
*/
public String getForcedState(UIComponent component) {
- if (component.getAttributes().containsKey(FORCE_STATE_PARAM)) {
- return (String) component.getAttributes().get(FORCE_STATE_PARAM);
+ String forcedState = null;
+ if (component.getAttributes().containsKey(UIProgressBar.FORCE_PERCENT_PARAM)) {
+ ComponentVariables variables = ComponentsVariableResolver
+ .getVariables(this, component);
+ Number maxValue = getNumber(component.getAttributes().get(
+ "maxValue"));
+ Number minValue = getNumber(component.getAttributes().get(
+ "minValue"));
+ String percent = (String) component.getAttributes().get(
+ UIProgressBar.FORCE_PERCENT_PARAM);
+ Number p = null;
+ try {
+ p = getNumber(percent);
+ if (p.doubleValue() < minValue.doubleValue()) {
+ forcedState = "initial";
+ } else if (p.doubleValue() > maxValue.doubleValue()) {
+ forcedState = "complete";
+ } else {
+ forcedState = "progress";
+ }
+ variables.setVariable("percent", p);
+ } catch (Exception e) {
+ e.getMessage();
+ }
}
- return null;
+ return forcedState;
}
/**
@@ -199,11 +218,11 @@
* @param component
* @throws IOException
*/
- public void encodeInitialScript(FacesContext context, UIComponent component)
+ public void encodeInitialScript(FacesContext context, UIComponent component, String state)
throws IOException {
ResponseWriter writer = context.getResponseWriter();
UIProgressBar progressBar = (UIProgressBar) component;
-
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
writer.startElement(HTML.SPAN_ELEM, component);
writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none;", null);
writer.startElement(HTML.SCRIPT_ELEM, component);
@@ -217,7 +236,9 @@
String mode = (String) component.getAttributes().get("mode");
Integer minValue = (Integer) component.getAttributes().get("minValue");
Integer maxValue = (Integer) component.getAttributes().get("maxValue");
-
+ Number value = (Number)variables.getVariable("percent");
+ StringBuffer markup = getMarkup(context, component);
+
script.append("new ProgressBar('")
.append(clientId).append("','") // id
.append(containerId).append("','") // containerId
@@ -227,6 +248,8 @@
.append(maxValue).append(","); // max value
script.append(getContext(component)); // context
script.append(",");
+ script.append(markup != null ? new JSLiteral(markup.toString()) : JSReference.NULL); //markup
+ script.append(",");
script.append(ScriptUtils.toScript(buildAjaxOptions(clientId, // options
progressBar, context)));
String progressVar = (String) component.getAttributes().get(
@@ -234,11 +257,13 @@
if (progressVar != null) {
script.append(",'");
script.append(progressVar); // progress var
- script.append("'");
+ script.append("','");
} else {
- script.append(",null");
+ script.append(",null,'");
}
-
+ script.append(state);
+ script.append("',");
+ script.append(value.toString());
script.append(");\n");
writer.write(script.toString());
@@ -303,7 +328,7 @@
if (initial != null) {
renderChild(context, initial);
}
- encodeInitialScript(context, component);
+ encodeInitialScript(context, component,"initial");
if (isAjaxMode(component)) {
encodePollScript(context, component);
}
@@ -333,7 +358,7 @@
getUtils().writeAttribute(writer, "id", clientId);
getUtils().writeAttribute(writer, "style",
variables.getVariable("style"));
- encodeInitialScript(context, component);
+ encodeInitialScript(context, component,"progress");
encodeProgressBar(context, component);
encodeLabelScript(context, component);
writer.endElement("div");
@@ -471,7 +496,7 @@
if (completed != null) {
renderChild(context, completed);
}
- encodeInitialScript(context, component);
+ encodeInitialScript(context, component,"completed");
if (isAjax) {
writer.startElement(HTML.SPAN_ELEM, component);
writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none;", null);
Modified: trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-06 10:35:10 UTC (rev 5860)
+++ trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-02-06 12:28:07 UTC (rev 5861)
@@ -1,17 +1,19 @@
ProgressBar = {};
ProgressBar = Class.create();
Object.extend(ProgressBar.prototype, {
- initialize: function(id, containerId, formId, mode, minValue, maxValue, context, options, progressVar) {
+ initialize: function(id, containerId, formId, mode, minValue, maxValue, context, markup, options, progressVar, state, value) {
this.id = id;
- $(this.id).component = this;
-
+
this.containerId = containerId;
this.formId = formId;
this.mode = mode;
+ this.state = state;
this.minValue = minValue;
this.maxValue = maxValue;
+ this.value = value;
this.context = context;
+ this.markup = markup;
this.options = options || {};
this.options.onbeforedomupdate = function(request, event, data) {
@@ -19,23 +21,23 @@
}.bind(this);
this.progressVar = progressVar;
+ $(this.id).component = this;
},
getValue: function () {
- var d = $(this.id + ":upload");
- if (d != null) {
- var w = d.style.width;
- if (w) {
- return w.substring(0,w.length - 1);
- }
- }
- return null;
+ return this.value;
},
onComplete: function (data) {
if (!$(this.id)) { return; }
if (data) {
- this.updateComponent(data);
- this.renderLabel(data['markup'], data['context']);
+ this.value = data['percent'];
+ if (this.state == "progress") {
+ this.updateComponent(data);
+ this.renderLabel(data['markup'], data['context']);
+ } else if (this.state == "initial" && this.value == this.getMinValue()) {
+ this.state = "progress";
+ this.forceState(this.value, function () { this.poll() }.bind(this));
+ }
this.poll();
}
@@ -89,14 +91,14 @@
if (!context) { context = {}; }
context['minValue'] = this.minValue;
context['maxValue'] = this.maxValue;
- context['value'] = (this.value ? this.value : this.getValue());
+ context['value'] = (this.value == 0 ? "0" : this.value);
if (this.progressVar) {
context[this.progressVar] = context['value'];
}
return context;
},
renderLabel: function (markup, context) {
- if (!markup) {
+ if (!markup || this.state != "progress") {
return;
}
if (!context) {
@@ -114,9 +116,11 @@
return placeholders;
},
setLabel: function (str) {
+ if (this.state != "progress") { return; }
var lbl = this.interpolate(str, this.getContext());
if (lbl)
$(this.id + ":remain").innerHTML = $(this.id + ":complete").innerHTML = lbl;
+ this.markup = null;
},
getMode: function () {
return this.mode;
@@ -131,33 +135,38 @@
return (this.getMode() == "ajax");
},
setValue: function (val) {
+ this.value = val;
+ var p = val;
val = "" + val;
- var p = val;
if (val != null) {
if (val.indexOf("%") < 0)
val = val + "%";
}
if ( parseFloat(p) < parseFloat(this.getMinValue())) {
if (!this.isAjaxMode()) {
- this.forceState("initial",null);
+ this.forceState(p, null);
return;
}
} else if ( parseFloat(p) > parseFloat(this.getMaxValue())) {
if (!this.isAjaxMode()) {
- this.forceState("complete",null);
+ this.forceState(p, null);
return;
}
}
+ if (this.markup) {
+ this.renderLabel(this.markup, this.getContext());
+ } else {
+ this.setLabel("{value}%");
+ }
+
d = $(this.id + ":upload");
if (d != null) d.style.width = val;
},
enable: function (ev) {
if (!this.isAjaxMode()) {
- this.forceState("progress", function() {
- this.setValue(0);
- }.bind(this));
+ this.forceState("0", null);
}else {
this.disable();
this.poll();
@@ -169,11 +178,11 @@
finish: function () {
//this.switchMode("completed");
},
- forceState: function (state, oncomplete) {
+ forceState: function (percent, oncomplete) {
var options = {};
options['parameters'] = {};
options['parameters'][this.id] = this.id;
- options['parameters']['forceState'] = state;
+ options['parameters']['forcePercent'] = percent;
options['actionUrl'] = this.options.actionUrl;
if (oncomplete) {
options['oncomplete'] = oncomplete;
16 years, 3 months
JBoss Rich Faces SVN: r5860 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-06 05:35:10 -0500 (Wed, 06 Feb 2008)
New Revision: 5860
Modified:
trunk/docs/userguide/en/src/main/docbook/included/subTable.desc.xml
Log:
http://jira.jboss.com/jira/browse/RF-2158 - done for subTable
Modified: trunk/docs/userguide/en/src/main/docbook/included/subTable.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/subTable.desc.xml 2008-02-06 10:34:35 UTC (rev 5859)
+++ trunk/docs/userguide/en/src/main/docbook/included/subTable.desc.xml 2008-02-06 10:35:10 UTC (rev 5860)
@@ -15,7 +15,7 @@
<para>The component is used for inserting <property>subtables</property> into tables with opportunity to choose data from a model
and built-in Ajax updates support.</para>
<figure>
- <title><rich:subTable> element</title>
+ <title><emphasis role="bold"><property><rich:subTable></property></emphasis> element</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/subtable1.png"/>
16 years, 3 months
JBoss Rich Faces SVN: r5859 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-06 05:34:35 -0500 (Wed, 06 Feb 2008)
New Revision: 5859
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dragSupport.desc.xml
Log:
http://jira.jboss.com/jira/browse/RF-2158 - done for dragSupport
Modified: trunk/docs/userguide/en/src/main/docbook/included/dragSupport.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dragSupport.desc.xml 2008-02-06 10:34:11 UTC (rev 5858)
+++ trunk/docs/userguide/en/src/main/docbook/included/dragSupport.desc.xml 2008-02-06 10:34:35 UTC (rev 5859)
@@ -14,7 +14,7 @@
supporting drag-and-drop operations.</para>
<figure>
- <title><rich:dragSupport> component</title>
+ <title><emphasis role="bold"><property><rich:dragSupport></property></emphasis> component</title>
<mediaobject>
<imageobject>
16 years, 3 months
JBoss Rich Faces SVN: r5858 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-06 05:34:11 -0500 (Wed, 06 Feb 2008)
New Revision: 5858
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml
Log:
http://jira.jboss.com/jira/browse/RF-2158 - done for dragIndicator
Modified: trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml 2008-02-06 10:34:01 UTC (rev 5857)
+++ trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml 2008-02-06 10:34:11 UTC (rev 5858)
@@ -81,7 +81,7 @@
<para> In the simplest way the component could be defined empty - in that case a default
indicator will be shown like this: </para>
<figure>
- <title>Simplest <rich:dragIndicator> </title>
+ <title>Simplest <emphasis role="bold"><property><rich:dragIndicator></property></emphasis> </title>
<mediaobject>
<imageobject>
<imagedata fileref="images/dragIndicator3.png"/>
16 years, 3 months
JBoss Rich Faces SVN: r5857 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-02-06 05:34:01 -0500 (Wed, 06 Feb 2008)
New Revision: 5857
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.desc.xml
Log:
http://jira.jboss.com/jira/browse/RF-2158 - done for dragIndicator
Modified: trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.desc.xml 2008-02-06 10:33:42 UTC (rev 5856)
+++ trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.desc.xml 2008-02-06 10:34:01 UTC (rev 5857)
@@ -12,7 +12,7 @@
operations. The displayed drag indicator can show information about the dragged elements.</para>
<figure>
- <title><rich:dragIndicator> component</title>
+ <title><emphasis role="bold"><property><rich:dragIndicator></property></emphasis> component</title>
<mediaobject>
<imageobject>
16 years, 3 months