JBoss Rich Faces SVN: r6788 - trunk/ui/listShuttle/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-03-13 12:39:49 -0400 (Thu, 13 Mar 2008)
New Revision: 6788
Modified:
trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
Log:
Event.onReady was deleted ()
Modified: trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
===================================================================
--- trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2008-03-13 16:39:44 UTC (rev 6787)
+++ trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2008-03-13 16:39:49 UTC (rev 6788)
@@ -184,21 +184,24 @@
<script type="text/javascript">
var clientId = '#{clientId}';
- Event.onReady(function() {
- var cotrolsIdPrefix = [['up', 'disup'], ['down', 'disdown'], ['last', 'dislast'], ['first','disfirst']];
- var listShuttleCotrolsIdPrefix = [['copy', 'discopy'], ['copyAll', 'discopyAll'], ['remove', 'disremove'], ['removeAll','disremoveAll']];
-
- var sourceLayoutManager = new LayoutManager('#{clientId}internal_header_tab', '#{clientId}internal_tab');
- var targetLayoutManager = new LayoutManager('#{clientId}tlInternal_header_tab', '#{clientId}tlInternal_tab');
-
- var listShuttle = new Richfaces.ListShuttle(new Richfaces.ListShuttle.Target('#{clientId}', '#{clientId}tlInternal_tab', '#{clientId}tlInternal_header_tab', '#{clientId}tlFocusKeeper', cotrolsIdPrefix, '#{clientId}sortLabel', #{this:getAsEventHandler(context, component, "onorderchanged")}, Richfaces.ListShuttle.Target.SelectItem, #{this:getColumnClassesAsJSArray(context, component)}, #{this:getRowClassesAsJSArray(context, component)}),
- new Richfaces.ListShuttle.Source('#{clientId}', '#{clientId}internal_tab', '#{clientId}internal_header_tab', '#{clientId}focusKeeper', undefined, Richfaces.ListShuttle.Source.SelectItem, #{this:getColumnClassesAsJSArray(context, component)}, #{this:getRowClassesAsJSArray(context, component)}),
- "#{clientId}", listShuttleCotrolsIdPrefix, "#{switchByClick}", sourceLayoutManager, targetLayoutManager, #{this:getAsEventHandler(context, component, "onlistchanged")});
- var sourceLayoutManager = new LayoutManager('#{clientId}internal_header_tab', '#{clientId}internal_tab');
- var targetLayoutManager = new LayoutManager('#{clientId}tlInternal_header_tab', '#{clientId}tlInternal_tab');
- sourceLayoutManager.widthSynchronization();
- targetLayoutManager.widthSynchronization();
- });
+ RichShuttleUtils.execOnLoad(
+ function(){
+ var cotrolsIdPrefix = [['up', 'disup'], ['down', 'disdown'], ['last', 'dislast'], ['first','disfirst']];
+ var listShuttleCotrolsIdPrefix = [['copy', 'discopy'], ['copyAll', 'discopyAll'], ['remove', 'disremove'], ['removeAll','disremoveAll']];
+
+ var sourceLayoutManager = new LayoutManager('#{clientId}internal_header_tab', '#{clientId}internal_tab');
+ var targetLayoutManager = new LayoutManager('#{clientId}tlInternal_header_tab', '#{clientId}tlInternal_tab');
+
+ var listShuttle = new Richfaces.ListShuttle(new Richfaces.ListShuttle.Target('#{clientId}', '#{clientId}tlInternal_tab', '#{clientId}tlInternal_header_tab', '#{clientId}tlFocusKeeper', cotrolsIdPrefix, '#{clientId}sortLabel', #{this:getAsEventHandler(context, component, "onorderchanged")}, Richfaces.ListShuttle.Target.SelectItem, #{this:getColumnClassesAsJSArray(context, component)}, #{this:getRowClassesAsJSArray(context, component)}),
+ new Richfaces.ListShuttle.Source('#{clientId}', '#{clientId}internal_tab', '#{clientId}internal_header_tab', '#{clientId}focusKeeper', undefined, Richfaces.ListShuttle.Source.SelectItem, #{this:getColumnClassesAsJSArray(context, component)}, #{this:getRowClassesAsJSArray(context, component)}),
+ "#{clientId}", listShuttleCotrolsIdPrefix, "#{switchByClick}", sourceLayoutManager, targetLayoutManager, #{this:getAsEventHandler(context, component, "onlistchanged")});
+ var sourceLayoutManager = new LayoutManager('#{clientId}internal_header_tab', '#{clientId}internal_tab');
+ var targetLayoutManager = new LayoutManager('#{clientId}tlInternal_header_tab', '#{clientId}tlInternal_tab');
+ sourceLayoutManager.widthSynchronization();
+ targetLayoutManager.widthSynchronization();
+ },
+ RichShuttleUtils.Condition.ElementPresent("#{clientId}"), 100
+ );
//setTimeout(init, 0);
</script>
</td>
16 years, 10 months
JBoss Rich Faces SVN: r6787 - trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-03-13 12:39:44 -0400 (Thu, 13 Mar 2008)
New Revision: 6787
Modified:
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
Log:
Event.onReady was deleted ()
Modified: trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
===================================================================
--- trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2008-03-13 15:47:40 UTC (rev 6786)
+++ trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2008-03-13 16:39:44 UTC (rev 6787)
@@ -1,51 +1,29 @@
-Object.extend(Event, {
- _domReady : function() {
- var domReady = arguments.callee
- if (!domReady.done) {
- domReady.done = true;
-
- Event._readyCallbacks.each(function(f) { f() });
- Event._readyCallbacks = null;
+if (!window.RichShuttleUtils) {
+ window.RichShuttleUtils = {};
+}
- if (Event._timer) {
- clearInterval(Event._timer);
- }
+RichShuttleUtils.execOnLoad = function(func, condition, timeout) {
- if (document.removeEventListener) {
- document.removeEventListener("DOMContentLoaded", domReady, false);
- }
-
- Event.stopObserving(window, 'load', domReady);
- }
- },
-
- onReady : function(f) {
- var domReady = this._domReady;
- if (domReady.done) {
- return f();
- }
+ if (condition()) {
+ func();
+ } else {
+ window.setTimeout(
+ function() {
+ Utils.execOnLoad(func, condition, timeout);
+ },
+ timeout
+ );
+ }
+};
+RichShuttleUtils.Condition = {
+ ElementPresent : function(element) {
+ return function () {
+ var el = $(element);
+ return el && el.offsetHeight > 0;
+ };
+ }
+};
- if (!this._readyCallbacks) {
-
- this._readyCallbacks = [];
-
- if (document.addEventListener) {
- document.addEventListener("DOMContentLoaded", domReady, false);
- }
-
- if (/WebKit/i.test(navigator.userAgent)) {
- this._timer = setInterval(function() {
- if (/loaded|complete/.test(document.readyState)) domReady();
- }, 10);
- }
-
- this.observe(window, 'load', domReady);
- }
-
- this._readyCallbacks.push(f);
- }
-});
-
Array.prototype.remove = function(object) {
var index = this.indexOf(object, 0, this.length);
if (index == -1) return;
16 years, 10 months
JBoss Rich Faces SVN: r6786 - trunk/ui/inputnumber-slider/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-03-13 11:47:40 -0400 (Thu, 13 Mar 2008)
New Revision: 6786
Modified:
trunk/ui/inputnumber-slider/src/main/java/org/richfaces/component/UIInputNumberSlider.java
Log:
http://jira.jboss.com/jira/browse/RF-2488
Modified: trunk/ui/inputnumber-slider/src/main/java/org/richfaces/component/UIInputNumberSlider.java
===================================================================
--- trunk/ui/inputnumber-slider/src/main/java/org/richfaces/component/UIInputNumberSlider.java 2008-03-13 15:44:45 UTC (rev 6785)
+++ trunk/ui/inputnumber-slider/src/main/java/org/richfaces/component/UIInputNumberSlider.java 2008-03-13 15:47:40 UTC (rev 6786)
@@ -21,7 +21,9 @@
package org.richfaces.component;
+import org.richfaces.component.util.HtmlUtil;
+
/**
* JSF component class
*
@@ -30,21 +32,33 @@
public static final String COMPONENT_TYPE = "org.richfaces.inputNumberSlider";
+ public abstract String getWidth();
+ public abstract void setWidth(String width);
+
+ public abstract String getHeight();
+ public abstract void setHeight(String height);
+
+ public abstract String getStyle();
+ public abstract void setStyle(String style);
+
public String getStyleValue() {
StringBuffer buf = new StringBuffer();
- String width = (String)getAttributes().get("width");
- String height = (String)getAttributes().get("height");
- String style = (String)getAttributes().get("style");
- if (width!=null&&width.length()>0) {
- buf.append("width:"+width);
+ String width = getWidth();
+ String height = getHeight();
+ String style = getStyle();
+ if (width != null && width.length() > 0) {
+ buf.append("width:" + HtmlUtil.qualifySize(width));
buf.append(";");
}
- if (height!=null&&height.length()>0) {
- buf.append("height:"+height);
+ if (height !=null && height.length() > 0) {
+ buf.append("height:" + HtmlUtil.qualifySize(height));
buf.append(";");
}
- buf.append(style);
+ if (style !=null && style.length() > 0) {
+ buf.append(style);
+ }
+
return buf.toString();
}
16 years, 10 months
JBoss Rich Faces SVN: r6785 - trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-03-13 11:44:45 -0400 (Thu, 13 Mar 2008)
New Revision: 6785
Modified:
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
RF-1774
Modified: trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2008-03-13 15:17:34 UTC (rev 6784)
+++ trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2008-03-13 15:44:45 UTC (rev 6785)
@@ -721,7 +721,7 @@
for (var i=0;i<items.length;i++)
{
itm = this.selectedItemsCache[items[i]];
- if (!itm) itm = {text:items[i], object: undefined};
+ if (!itm) itm = {text:items[i], object: null};
this.selectedItems.push(itm);
newItemsCache[itm.text] = itm;
}
@@ -729,12 +729,38 @@
else
{
itm = this.selectedItemsCache[value];
- if (!itm) itm = {text:items[i], object: undefined};
+ if (!itm) itm = {text:items[i], object: null};
this.selectedItems.push(itm);
newItemsCache[itm.text] = itm;
}
this.selectedItemsCache = newItemsCache;
},
+
+ updateSelectedItems: function (items)
+ {
+ for (var i=0;i<this.selectedItems.length; i++)
+ {
+ var obj = items[this.selectedItems.text];
+ if (obj) this.selectedItems.object = obj;
+ }
+ },
+
+ getItemListForUpdate: function()
+ {
+ var list = [];
+ var result="";
+ if (this.options.tokens.length!=0)
+ {
+ for (var i=0;i<this.selectedItems.length; i++)
+ {
+ if (!this.selectedItems.object) list.push(this.selectedItems.text);
+ }
+ result = list.join(this.options.tokens[0]);
+ }
+ else if (this.selectedItems.length!=0 && !this.selectedItems[0].object) result = this.selectedItems.object;
+
+ return result;
+ },
insertValue: function(value)
{
@@ -796,8 +822,8 @@
getUpdatedChoices: function(event) {
this.options.parameters[this.options.param] = this.getToken();
- // TODO add string list parameter for the values that need object from server
-
+ // TODO-done: add string list parameter for the values that need object from server
+ this.options.parameters["inputvaluerequest"] = this.getItemListForUpdate();
if (this.onsubmitFunction && ! this.onsubmitFunction()) {
return;
}
@@ -814,8 +840,9 @@
RichFaces.Position.smartClone(this.element, this.update, this.options);
}
this.updateChoices();
- this.fetchValues = data;
- // TODO add update item objects from data
+ this.fetchValues = data; // use data.suggestionObjects
+ // TODO-done: add update item objects from data
+ this.updateSelectedItems(data); // use data.requestedObjects
LOG.debug("Choices updated");
if (this.options.onajaxcomplete) {
this.options.onajaxcomplete(request, event);
16 years, 10 months
JBoss Rich Faces SVN: r6783 - in trunk/ui/progressBAR/src/main: java/org/richfaces/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-03-13 10:59:53 -0400 (Thu, 13 Mar 2008)
New Revision: 6783
Modified:
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
Log:
RF-2474
Modified: trunk/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java
===================================================================
--- trunk/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java 2008-03-13 14:59:33 UTC (rev 6782)
+++ trunk/ui/progressBAR/src/main/java/org/richfaces/component/UIProgressBar.java 2008-03-13 14:59:53 UTC (rev 6783)
@@ -93,6 +93,7 @@
String clientId = this.getClientId(facesContext);
if (!params.containsKey(clientId)) {
+ System.out.println("Return from broadcast");
return;
}
@@ -120,6 +121,7 @@
}
}
} else if (params.containsKey(FORCE_PERCENT_PARAM)) {
+ System.out.println("Force state: " + this.getClientId(facesContext));
ajaxContext.addComponentToAjaxRender(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-03-13 14:59:33 UTC (rev 6782)
+++ trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-03-13 14:59:53 UTC (rev 6783)
@@ -230,11 +230,12 @@
.findAjaxContainer(context, component)).getClientId(context);
String mode = (String) component.getAttributes().get("mode");
UIComponent form = AjaxRendererUtils.getNestingForm(component);
- String formId = null;
+ String formId = "";
if (form != null) {
formId = form.getClientId(context);
}else if ("ajax".equals(mode)){
- throw new FaceletException("Progress bar component in ajax mode should be placed inside the form");
+ // Ignore form absent. It can be rendered by forcing from any component
+ //throw new FaceletException("Progress bar component in ajax mode should be placed inside the form");
}
Number minValue = getNumber(component.getAttributes().get("minValue"));
Number maxValue = getNumber(component.getAttributes().get("maxValue"));
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-03-13 14:59:33 UTC (rev 6782)
+++ trunk/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-03-13 14:59:53 UTC (rev 6783)
@@ -5,7 +5,12 @@
this.id = id;
this.containerId = containerId;
- this.formId = formId;
+ if (formId != '') {
+ this.formId = formId;
+ }else {
+ var f = this.getForm();
+ this.formId = (f) ? f.id : null;
+ }
this.mode = mode;
this.state = state;
this.minValue = minValue;
@@ -24,6 +29,14 @@
this.progressVar = progressVar;
$(this.id).component = this;
},
+
+ getForm: function () {
+ var parentForm = $(this.id);
+ while (parentForm.tagName && parentForm.tagName.toLowerCase() != 'form') {
+ parentForm = parentForm.parentNode;
+ }
+ return parentForm;
+ },
getValue: function () {
return this.value;
16 years, 10 months
JBoss Rich Faces SVN: r6782 - in trunk/ui/fileUpload/src/main: resources/org/richfaces/renderkit/html/js and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-03-13 10:59:33 -0400 (Thu, 13 Mar 2008)
New Revision: 6782
Modified:
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
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-2474
Modified: trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2008-03-13 14:04:27 UTC (rev 6781)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2008-03-13 14:59:33 UTC (rev 6782)
@@ -30,6 +30,8 @@
import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.renderkit.ComponentVariables;
+import org.ajax4jsf.renderkit.ComponentsVariableResolver;
import org.ajax4jsf.renderkit.RendererUtils;
import org.ajax4jsf.request.MultipartRequest;
import org.ajax4jsf.resource.CountingOutputWriter;
@@ -120,6 +122,35 @@
}
}
+
+ /**
+ * Gets form id
+ * @param context - faces context
+ * @param component - component
+ * @return String form id
+ */
+ public String getFormId(FacesContext context, UIComponent component) {
+ UIComponent form = AjaxRendererUtils.getNestingForm(component);
+ if (form != null) {
+ return form.getClientId(context);
+ }
+ return "";
+ }
+
+
+ /**
+ * Gets container id
+ * @param context - faces context
+ * @param component - component
+ * @return String container id
+ */
+ public String getContainerId(FacesContext context, UIComponent component) {
+ UIComponent container = (UIComponent)AjaxRendererUtils.findAjaxContainer(context, component);
+ if (container != null) {
+ return container.getClientId(context);
+ }
+ return null;
+ }
/**
* Generates map with internalized labels to be put into JS
@@ -337,9 +368,16 @@
@SuppressWarnings("unchecked")
private String getActionScript(FacesContext context, UIComponent component,
String action, Object oncomplete) throws IOException {
- JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(
- component, context);
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
String clientId = component.getClientId(context);
+ String containerId = (String)variables.getVariable("containerId");
+ JSFunction ajaxFunction = new JSFunction(AjaxRendererUtils.AJAX_FUNCTION_NAME);
+ ajaxFunction.addParameter(containerId);
+ ajaxFunction.addParameter(new JSReference("formId"));
+ ajaxFunction.addParameter(new JSReference("event"));
+// AjaxRendererUtils.buildAjaxFunction(
+// component, context);
+
Map options = AjaxRendererUtils.buildEventOptions(context, component);
Map parameters = (Map) options.get("parameters");
parameters.put("action", action);
@@ -351,6 +389,7 @@
ajaxFunction.addParameter(options);
JSFunctionDefinition function = new JSFunctionDefinition("uid");
+ function.addParameter("formId");
function.addParameter("event");
function.addToBody(ajaxFunction.toScript());
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-03-13 14:04:27 UTC (rev 6781)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-03-13 14:59:33 UTC (rev 6782)
@@ -168,7 +168,7 @@
},
stop: function() {
- this.uploadObject.stopScript(this.uid);
+ this.uploadObject.stopScript(this.uid, this.uploadObject.formId);
},
_clearInput: function() {
@@ -373,9 +373,17 @@
uploadedCount: 0,
- initialize: function(id, stopScript, getFileSizeScript, progressBarId, classes, label, maxFiles, events, disabled, acceptedTypes, options, labels) {
+ initialize: function(id, formId, stopScript, getFileSizeScript, progressBarId, classes, label, maxFiles, events, disabled, acceptedTypes, options, labels) {
this.id = id;
this.element = $(this.id);
+ if (formId != '') {
+ this.formId = formId;
+ this.form = $(formId);
+ }else {
+ var f = this._getForm();
+ this.formId = (f) ? f.id : null;
+ this.form = f;
+ }
this._progressBar = $(progressBarId);
this.progressBar = this._progressBar.component;
this.entries = new Array();
@@ -480,7 +488,7 @@
}
}else {
if (this.activeEntry)
- this.getFileSizeScript(this.activeEntry.uid);
+ this.getFileSizeScript(this.activeEntry.uid, this.formId);
}
},
@@ -839,9 +847,13 @@
},
getForm: function () {
+ return this.form;
+ },
+
+ _getForm: function () {
var parentForm = this.element;
while (parentForm.tagName && parentForm.tagName.toLowerCase() != 'form') {
- parentForm = parentForm.parentNode;
+ parentForm = parentForm.firstChild;
}
return parentForm;
},
@@ -921,7 +933,7 @@
parentForm.target = oldTarget;
parentForm.encoding = oldEncoding;
parentForm.enctype = oldEnctype;
- this.getFileSizeScript(entry.uid);
+ this.getFileSizeScript(entry.uid, this.formId);
}
}
Modified: trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-13 14:04:27 UTC (rev 6781)
+++ trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-13 14:59:33 UTC (rev 6782)
@@ -17,7 +17,8 @@
/org/richfaces/renderkit/html/scripts/utils.js,
/org/richfaces/renderkit/html/scripts/json/json-dom.js,
/org/richfaces/renderkit/html/js/FileUpload.js,
- /org/richfaces/renderkit/html/js/progressBar.js
+ /org/richfaces/renderkit/html/js/progressBar.js,
+ /org/ajax4jsf/javascript/scripts/form.js,
</h:scripts>
<f:clientId var="clientId" />
@@ -39,13 +40,16 @@
variables.setVariable("addLabel",labels.get("add"));
variables.setVariable("uploadLabel",labels.get("upload"));
variables.setVariable("clearAllLabel",labels.get("clear_all"));
-
+ variables.setVariable("formId",getFormId(context, component));
+ variables.setVariable("containerId",getContainerId(context, component));
+
]]>
</jsp:scriptlet>
<div class="upload_list_decor" style="width: #{component.attributes['listWidth']}" id="#{clientId}">
+<f:call name="utils.encodeBeginFormIfNessesary" />
<!-- iframe name="ddd" id="#{clientId}_iframe" style="display: none;"/ -->
@@ -166,10 +170,10 @@
onerror : #{this:getAsEventHandler(context, component, "onerror")}
};
- new FileUpload('#{clientId}', #{this:getStopScript(context, component)}, #{this:getFileSizeScript(context, component)} ,'#{this:getProgressBarId(context, component)}', FileUpload.CLASSES, #{this:getLabelMarkup(context, component)}, '#{component.attributes["maxFilesQuantity"]}', events, #{component.attributes["disabled"]}, #{this:getAcceptedTypes(context, component)}, {'autoclear':#{component.attributes["autoclear"]}},#{this:_getLabels(labels)});
+ new FileUpload('#{clientId}','#{formId}',#{this:getStopScript(context, component)}, #{this:getFileSizeScript(context, component)} ,'#{this:getProgressBarId(context, component)}', FileUpload.CLASSES, #{this:getLabelMarkup(context, component)}, '#{component.attributes["maxFilesQuantity"]}', events, #{component.attributes["disabled"]}, #{this:getAcceptedTypes(context, component)}, {'autoclear':#{component.attributes["autoclear"]}},#{this:_getLabels(labels)});
</script>
</span>
-
+<f:call name="utils.encodeEndFormIfNessesary" />
</div>
16 years, 10 months
JBoss Rich Faces SVN: r6781 - trunk/ui/inplaceInput/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-13 10:04:27 -0400 (Thu, 13 Mar 2008)
New Revision: 6781
Modified:
trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml
Log:
http://jira.jboss.com/jira/browse/RF-2499
Modified: trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml
===================================================================
--- trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-03-13 14:01:15 UTC (rev 6780)
+++ trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-03-13 14:04:27 UTC (rev 6781)
@@ -255,6 +255,11 @@
<classname>boolean</classname>
<description></description>
</property>
+ <property hidden="true">
+ <name>valid</name>
+ <classname>boolean</classname>
+ <description></description>
+ </property>
</properties>
</component>
16 years, 10 months
JBoss Rich Faces SVN: r6780 - in trunk: ui/toolBar/src/main/config/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-03-13 10:01:15 -0400 (Thu, 13 Mar 2008)
New Revision: 6780
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
trunk/ui/toolBar/src/main/config/component/toolBar.xml
trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-1605
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2008-03-13 13:44:43 UTC (rev 6779)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2008-03-13 14:01:15 UTC (rev 6780)
@@ -352,7 +352,7 @@
}
public void encodePassThruWithExclusionsArray(FacesContext context,
- UIComponent component, String[] exclusions) throws IOException {
+ UIComponent component, Object[] exclusions) throws IOException {
ResponseWriter writer = context.getResponseWriter();
Map<String, Object> attributes = component.getAttributes();
Arrays.sort(exclusions);
Modified: trunk/ui/toolBar/src/main/config/component/toolBar.xml
===================================================================
--- trunk/ui/toolBar/src/main/config/component/toolBar.xml 2008-03-13 13:44:43 UTC (rev 6779)
+++ trunk/ui/toolBar/src/main/config/component/toolBar.xml 2008-03-13 14:01:15 UTC (rev 6780)
@@ -90,7 +90,58 @@
</property>
&ui_component_attributes;
- &html_style_attributes;
+ &html_style_attributes;
+
+ <property>
+ <name>onitemkeydown</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
+ <property>
+ <name>onitemkeypress</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
+ <property>
+ <name>onitemkeyup</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
+ <property>
+ <name>onitemclick</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
+ <property>
+ <name>onitemdblclick</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
+ <property>
+ <name>onitemmousedown</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
+ <property>
+ <name>onitemmousemove</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
+ <property>
+ <name>onitemmouseover</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
+ <property>
+ <name>onitemmouseout</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
+ <property>
+ <name>onitemmouseup</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
</component>
<component>
Modified: trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
===================================================================
--- trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java 2008-03-13 13:44:43 UTC (rev 6779)
+++ trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java 2008-03-13 14:01:15 UTC (rev 6780)
@@ -26,19 +26,14 @@
import java.util.Iterator;
import java.util.List;
-import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.renderkit.RendererBase;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIToolBarGroup;
-import org.richfaces.renderkit.html.images.DotSeparatorImage;
-import org.richfaces.renderkit.html.images.GridSeparatorImage;
-import org.richfaces.renderkit.html.images.LineSeparatorImage;
-import org.richfaces.renderkit.html.images.SquareSeparatorImage;
-public class ToolBarGroupRenderer extends RendererBase {
+public class ToolBarGroupRenderer extends ToolBarRendererBase {
protected Class getComponentClass() {
return UIToolBarGroup.class;
@@ -51,60 +46,44 @@
public void encodeChildren(FacesContext facesContext, UIComponent component) throws IOException {
UIToolBarGroup toolBarGroup = (UIToolBarGroup) component;
ResponseWriter writer = facesContext.getResponseWriter();
- String style = (String) toolBarGroup.getAttributes().get("style");
- String styleClass = (String) toolBarGroup.getAttributes().get("styleClass");
- if (null == styleClass) styleClass = "";
- String contentClass = (String) toolBarGroup.getToolBar().getAttributes().get("contentClass");
- if (null == contentClass) contentClass = "";
- String contentStyle = (String) toolBarGroup.getToolBar().getAttributes().get("contentStyle");
+ String styleClass = (String) toolBarGroup.getAttributes().get(HTML.STYLE_CLASS_ATTR);
+ String contentClass = (String) getParentToolBar(component).getAttributes().get("contentClass");
+ String style = (String) toolBarGroup.getAttributes().get(HTML.style_ATTRIBUTE);
+ String contentStyle = (String) getParentToolBar(component).getAttributes().get("contentStyle");
+ if (null == contentClass) {
+ contentClass = "";
+ }
+ if (null == styleClass) {
+ styleClass = "";
+ }
+ if (null == contentStyle) {
+ contentStyle = "";
+ }
+ if (null == style) {
+ style = "";
+ }
+
if (component.getChildCount() > 0) {
- List children = component.getChildren();
- for (Iterator iter = children.iterator(); iter.hasNext();) {
+ List<UIComponent> children = component.getChildren();
+ for (Iterator<UIComponent> iter = children.iterator(); iter.hasNext();) {
UIComponent child = (UIComponent) iter.next();
if(!child.isRendered()){
iter.remove();
}
}
- for (Iterator it = children.iterator(); it.hasNext();) {
+ for (Iterator<UIComponent> it = children.iterator(); it.hasNext();) {
UIComponent child = (UIComponent) it.next();
- writer.startElement("td", component);
- writer.writeAttribute("class", "dr-toolbar-int rich-toolbar-item " + contentClass +" "+styleClass, null);
- getUtils().writeAttribute(writer, "style", contentStyle);
- getUtils().writeAttribute(writer, "style", style);
- getUtils().encodePassThruWithExclusions(facesContext, component, "style,class");
- renderChild(facesContext, child);
- writer.endElement("td");
- if (it.hasNext()) {
- insertSeparatorIfNeed(writer, facesContext, toolBarGroup);
- }
-
- }
- }
- }
-
- protected void insertSeparatorIfNeed(ResponseWriter writer,FacesContext context, UIToolBarGroup toolBarGroup) throws IOException {
- String itemSeparator = toolBarGroup.getItemSeparator();
- if (itemSeparator != null && itemSeparator.length()!=0 && ! itemSeparator.equalsIgnoreCase("none")){
- String uri = null;
- if (itemSeparator.equalsIgnoreCase("square")) {
- uri = getResource(SquareSeparatorImage.class.getName()).getUri(context, null);
- } else if (itemSeparator.equalsIgnoreCase("disc")) {
- uri = getResource(DotSeparatorImage.class.getName()).getUri(context, null);
- } else if (itemSeparator.equalsIgnoreCase("grid")) {
- uri = getResource(GridSeparatorImage.class.getName()).getUri(context, toolBarGroup);
- } else if (itemSeparator.equalsIgnoreCase("line")) {
- uri = getResource(LineSeparatorImage.class.getName()).getUri(context, toolBarGroup);
- } else throw new FacesException("Unknown type of separator - \""+itemSeparator+"\"");
- writer.startElement("td", toolBarGroup);
- getUtils().writeAttribute(writer, "class", toolBarGroup.getAttributes().get("separatorClass"));
- writer.writeAttribute("align", "center", null);
- writer.startElement("img", toolBarGroup);
- getUtils().writeAttribute(writer, "src", uri);
- getUtils().writeAttribute(writer, "alt", "");
- writer.endElement("img");
- writer.endElement("td");
+ writer.startElement(HTML.td_ELEM, component);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, "dr-toolbar-int rich-toolbar-item " + contentClass + " " + styleClass, null);
+ getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, contentStyle + ";" + style);
+ encodeEventsAttributes(facesContext, toolBarGroup, writer);
+ renderChild(facesContext, child);
+ writer.endElement(HTML.td_ELEM);
+ if (it.hasNext()) {
+ insertSeparatorIfNeed(facesContext, toolBarGroup, writer);
}
}
-
+ }
+ }
}
Modified: trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java
===================================================================
--- trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java 2008-03-13 13:44:43 UTC (rev 6779)
+++ trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java 2008-03-13 14:01:15 UTC (rev 6780)
@@ -23,9 +23,13 @@
import java.io.IOException;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
@@ -33,6 +37,7 @@
import javax.faces.context.ResponseWriter;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIToolBar;
import org.richfaces.component.UIToolBarGroup;
import org.richfaces.renderkit.html.images.DotSeparatorImage;
@@ -42,19 +47,37 @@
public class ToolBarRendererBase extends HeaderResourcesRendererBase {
-
+ private final static String[] ON_ITEM_EVENTS = new String[] {
+ "onitemkeydown",
+ "onitemkeypress",
+ "onitemkeyup",
+ "onitemclick",
+ "onitemdblclick",
+ "onitemmousedown",
+ "onitemmousemove",
+ "onitemmouseover",
+ "onitemmouseout",
+ "onitemmouseup"
+ };
public void encodeChildren(FacesContext facesContext, UIComponent component) throws IOException {
UIToolBar toolBar = (UIToolBar) component;
- List children = toolBar.getChildren();
+ List<UIComponent> children = toolBar.getChildren();
String contentClass = (String) toolBar.getAttributes().get("contentClass");
- if (null == contentClass) contentClass = "";
String contentStyle = (String) toolBar.getAttributes().get("contentStyle");
- if(children != null){
- List childrenToTheLeft = new LinkedList();
- List childrenToTheRight = new LinkedList();
- for (Iterator iter = children.iterator(); iter.hasNext();) {
- UIComponent child = (UIComponent) iter.next();
+
+ if (null == contentClass) {
+ contentClass = "";
+ }
+ if (null == contentStyle) {
+ contentClass = "";
+ }
+
+ if (children != null) {
+ List<UIComponent> childrenToTheLeft = new LinkedList<UIComponent>();
+ List<UIComponent> childrenToTheRight = new LinkedList<UIComponent>();
+ for (Iterator<UIComponent> iter = children.iterator(); iter.hasNext();) {
+ UIComponent child = iter.next();
if(child.isRendered()){
if (child instanceof UIToolBarGroup) {
UIToolBarGroup group = (UIToolBarGroup) child;
@@ -71,61 +94,59 @@
}
ResponseWriter writer = facesContext.getResponseWriter();
- for (Iterator it = childrenToTheLeft.iterator(); it.hasNext();) {
- UIComponent child = (UIComponent) it.next();
+ for (Iterator<UIComponent> it = childrenToTheLeft.iterator(); it.hasNext();) {
+ UIComponent child = it.next();
if (! (child instanceof UIToolBarGroup)) {
- writer.startElement("td", component);
- writer.writeAttribute("class", "dr-toolbar-int rich-toolbar-item " + contentClass, null);
- getUtils().writeAttribute(writer, "style", contentStyle);
+ writer.startElement(HTML.td_ELEM, component);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, "dr-toolbar-int rich-toolbar-item " + contentClass, null);
+ getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, contentStyle);
+ encodeEventsAttributes(facesContext, child, writer);
}
renderChild(facesContext, child);
if (! (child instanceof UIToolBarGroup)) {
- writer.endElement("td");
+ writer.endElement(HTML.td_ELEM);
}
if (it.hasNext()) {
- insertSeparatorIfNeed(writer, facesContext, toolBar);
+ insertSeparatorIfNeed(facesContext, toolBar, writer);
}
}
- writer.startElement("td", component);
- writer.writeAttribute("width", "100%", null);
- writer.endElement("td");
-// if (!childrenToTheLeft.isEmpty() && !childrenToTheRight.isEmpty()) {
-// insertSeparatorIfNeed(writer, facesContext, toolBar);
-// }
+ writer.startElement(HTML.td_ELEM, component);
+ writer.writeAttribute(HTML.width_ATTRIBUTE, "100%", null);
+ writer.endElement(HTML.td_ELEM);
- for (Iterator it = childrenToTheRight.iterator(); it.hasNext();) {
- UIComponent child = (UIComponent) it.next();
+ for (Iterator<UIComponent> it = childrenToTheRight.iterator(); it.hasNext();) {
+ UIComponent child = it.next();
renderChild(facesContext, child);
if (it.hasNext()) {
- insertSeparatorIfNeed(writer, facesContext, toolBar);
+ insertSeparatorIfNeed(facesContext, toolBar, writer);
}
}
}
}
- protected void insertSeparatorIfNeed(ResponseWriter writer,FacesContext context, UIToolBar toolBar) throws IOException {
+ protected void insertSeparatorIfNeed(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException {
- String itemSeparator = toolBar.getItemSeparator();
+ String itemSeparator = (String)component.getAttributes().get("itemSeparator");
if (itemSeparator != null && itemSeparator.length()!=0 && ! itemSeparator.equalsIgnoreCase("none")){
String uri = null;
if (itemSeparator.equalsIgnoreCase("square")) {
- uri = getResource(SquareSeparatorImage.class.getName()).getUri(context, null);
+ uri = getResource(SquareSeparatorImage.class.getName()).getUri(context, component);
} else if (itemSeparator.equalsIgnoreCase("disc")) {
- uri = getResource(DotSeparatorImage.class.getName()).getUri(context, null);
+ uri = getResource(DotSeparatorImage.class.getName()).getUri(context, component);
} else if (itemSeparator.equalsIgnoreCase("grid")) {
- uri = getResource(GridSeparatorImage.class.getName()).getUri(context, toolBar);
+ uri = getResource(GridSeparatorImage.class.getName()).getUri(context, component);
} else if (itemSeparator.equalsIgnoreCase("line")) {
- uri = getResource(LineSeparatorImage.class.getName()).getUri(context, toolBar);
+ uri = getResource(LineSeparatorImage.class.getName()).getUri(context, component);
} else throw new FacesException("Unknown type of separator - \""+itemSeparator+"\"");
- writer.startElement("td", toolBar);
- writer.writeAttribute("align", "center", null);
- getUtils().writeAttribute(writer, "class", toolBar.getAttributes().get("separatorClass"));
- writer.startElement("img", toolBar);
- getUtils().writeAttribute(writer, "src", uri);
- getUtils().writeAttribute(writer, "alt", "");
- writer.endElement("img");
- writer.endElement("td");
+ writer.startElement(HTML.td_ELEM, component);
+ writer.writeAttribute(HTML.align_ATTRIBUTE, "center", null);
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, component.getAttributes().get("separatorClass"));
+ writer.startElement(HTML.IMG_ELEMENT, component);
+ getUtils().writeAttribute(writer, HTML.src_ATTRIBUTE, uri);
+ getUtils().writeAttribute(writer, HTML.alt_ATTRIBUTE, "");
+ writer.endElement(HTML.IMG_ELEMENT);
+ writer.endElement(HTML.td_ELEM);
}
}
@@ -136,5 +157,42 @@
public boolean getRendersChildren() {
return true;
}
+
+ protected void encodeEventsAttributes(FacesContext facesContext, UIComponent component, ResponseWriter writer)
+ throws IOException {
+ Map<String, Object> attributes = getParentToolBar(component).getAttributes();
+ Set<String> encodedAttributes = new HashSet<String>();
+
+ for (int i = 0; i < ON_ITEM_EVENTS.length; i++) {
+ Object value = attributes.get(ON_ITEM_EVENTS[i]);
+ if (null != value && !"".equals(value)) {
+ String eventName = ON_ITEM_EVENTS[i].replace("item", "");
+ encodedAttributes.add(eventName);
+ Object selfEvent = component.getAttributes().get(eventName);
+ if (null == selfEvent) {
+ selfEvent = "";
+ }
+ writer.writeAttribute(eventName, selfEvent + ";" + value, null);
+ }
+ }
+ encodedAttributes.add(HTML.class_ATTRIBUTE);
+ encodedAttributes.add(HTML.style_ATTRIBUTE);
+ getUtils().encodePassThruWithExclusionsArray(facesContext, component, encodedAttributes.toArray());
+ }
+ public UIToolBar getParentToolBar(UIComponent component) {
+ if (component instanceof UIToolBar) {
+ return (UIToolBar) component;
+ } else if (component instanceof UIToolBarGroup) {
+ return ((UIToolBarGroup)component).getToolBar();
+ } else {
+ UIComponent parent = component.getParent();
+ if (!(parent instanceof UIToolBar)) {
+ return null;
+ } else {
+ return (UIToolBar) parent;
+ }
+ }
+ }
+
}
16 years, 10 months
JBoss Rich Faces SVN: r6779 - trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-03-13 09:44:43 -0400 (Thu, 13 Mar 2008)
New Revision: 6779
Modified:
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
Log:
RF-2484
Modified: trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2008-03-13 12:50:02 UTC (rev 6778)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2008-03-13 13:44:43 UTC (rev 6779)
@@ -78,15 +78,17 @@
"uploadControlLabel", "stopControlLabel", "clearAllControlLabel",
"cancelEntryControlLabel", "clearControlLabel",
"stopEntryControlLabel", null, null, null };
-
/**
* Overrides standard JSF component method.
- * @param context faces context
- * @param component file upload component
+ *
+ * @param context
+ * faces context
+ * @param component
+ * file upload component
*/
@Override
- @SuppressWarnings ("unchecked")
+ @SuppressWarnings("unchecked")
protected void doDecode(FacesContext context, UIComponent component) {
UIFileUpload fileUpload = (UIFileUpload) component;
ServletRequest request = (ServletRequest) context.getExternalContext()
@@ -118,27 +120,30 @@
}
}
-
-
- /**
- * Generates map with internalized labels to be put into JS
- * @param o map of labels
- * @return javascript hash map
- */
+
+ /**
+ * Generates map with internalized labels to be put into JS
+ *
+ * @param o
+ * map of labels
+ * @return javascript hash map
+ */
public Object _getLabels(Object o) {
return ScriptUtils.toScript(o);
}
-
-
- /**
- * Gets internalized labels.
- * At the first system is looking for them in appropriate attributes if they are defined.
- * Next search place is application and file upload bundles.
- * If no result - default label value will be set up.
- * @param context facesContext instance
- * @param component UIComponent
- * @return map of labels
- */
+
+ /**
+ * Gets internalized labels. At the first system is looking for them in
+ * appropriate attributes if they are defined. Next search place is
+ * application and file upload bundles. If no result - default label value
+ * will be set up.
+ *
+ * @param context
+ * facesContext instance
+ * @param component
+ * UIComponent
+ * @return map of labels
+ */
public Map<String, String> getLabels(FacesContext context,
UIComponent component) {
Map<String, String> labelsMap = new HashMap<String, String>();
@@ -167,15 +172,18 @@
initLabels(labelsMap, bundle1, bundle2, fileUpload);
return labelsMap;
}
-
-
- /**
- * Sets values for labels.
- * @param map map of labels
- * @param bundle1 application bundle
- * @param bundle2 file upload bundle
- * @param fileUpload
- */
+
+ /**
+ * Sets values for labels.
+ *
+ * @param map
+ * map of labels
+ * @param bundle1
+ * application bundle
+ * @param bundle2
+ * file upload bundle
+ * @param fileUpload
+ */
private void initLabels(Map<String, String> map, ResourceBundle bundle1,
ResourceBundle bundle2, UIFileUpload fileUpload) {
int i = 0;
@@ -203,12 +211,15 @@
}
}
- /**
- * Looking for labels name in bundles provided.
- * @param bundle1 application bundle
- * @param bundle2 file upload bundle
- * @return String label value
- */
+ /**
+ * Looking for labels name in bundles provided.
+ *
+ * @param bundle1
+ * application bundle
+ * @param bundle2
+ * file upload bundle
+ * @return String label value
+ */
private String getFromBundle(String name, ResourceBundle bundle1,
ResourceBundle bundle2) {
name = bundlePrefix + name.toUpperCase() + bundlePostfix;
@@ -269,20 +280,19 @@
Object file) {
ValueExpression data = fileUpload
.getValueExpression(_FILES_UPLOADED_ATTRIBUTE_NAME);
+ UploadItem item = new UploadItem(fileUpload.getLocalFileName(), file);
if (data != null) {
if (data.getValue(context.getELContext()) instanceof Collection) {
Collection collection = (Collection) data.getValue(context
.getELContext());
if (checkFileCount(fileUpload, collection)) {
- UploadItem item = new UploadItem(fileUpload
- .getLocalFileName(), file);
- new UploadEvent(fileUpload, item).queue();
collection.add(item);
} else {
throw new FileUploadException("Files count overflow");
}
}
}
+ new UploadEvent(fileUpload, item).queue();
}
/**
16 years, 10 months