JBoss Rich Faces SVN: r15285 - in tags/3.3.2.CR1/ui/contextMenu/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-08-24 13:02:49 -0400 (Mon, 24 Aug 2009)
New Revision: 15285
Modified:
tags/3.3.2.CR1/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java
tags/3.3.2.CR1/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
Log:
RF-7172 fix
Modified: tags/3.3.2.CR1/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java
===================================================================
--- tags/3.3.2.CR1/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java 2009-08-24 17:02:17 UTC (rev 15284)
+++ tags/3.3.2.CR1/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java 2009-08-24 17:02:49 UTC (rev 15285)
@@ -46,7 +46,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
*/
- protected Class getComponentClass() {
+ protected Class<UIContextMenu> getComponentClass() {
return UIContextMenu.class;
}
@@ -66,18 +66,11 @@
styleClass = "";
}
- writeAttr(writer, HTML.onmousemove_ATTRIBUTE, layer.getAttributes().get("onmousemove"));
- writeAttr(writer, HTML.onmouseout_ATTRIBUTE, layer.getAttributes().get("onmouseout"));
- writeAttr(writer, HTML.onmouseover_ATTRIBUTE, layer.getAttributes().get("onmouseover"));
-
+ getUtils().writeAttribute(writer, HTML.onmousemove_ATTRIBUTE, layer.getAttributes().get("onmousemove"));
+ getUtils().writeAttribute(writer, HTML.onmouseout_ATTRIBUTE, layer.getAttributes().get("onmouseout"));
+ getUtils().writeAttribute(writer, HTML.onmouseover_ATTRIBUTE, layer.getAttributes().get("onmouseover"));
+
writer.writeAttribute(HTML.class_ATTRIBUTE, "rich-menu-list-border " + styleClass, null);
writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none; z-index: 2; " + style, null);
}
-
- private void writeAttr(ResponseWriter writer, final String name, final Object value) throws IOException {
- if (value != null) {
- writer.writeAttribute(name, value, null);
- }
-
- }
}
Modified: tags/3.3.2.CR1/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
===================================================================
--- tags/3.3.2.CR1/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2009-08-24 17:02:17 UTC (rev 15284)
+++ tags/3.3.2.CR1/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2009-08-24 17:02:49 UTC (rev 15285)
@@ -109,11 +109,21 @@
this.element.appendChild(div);
var html = this.evaluator.invoke('getContent', context||{}).join('');
+ html = this.interpolate(html, context);
new Insertion.Top(div, html);
this.menuContent = div;
},
+ interpolate: function (placeholders, context) {
+ for(var k in context) {
+ var v = context[k];
+ var regexp = new RegExp("\\{" + k + "\\}", "g");
+ placeholders = placeholders.replace(regexp, v);
+ }
+ return placeholders;
+ },
+
destroyMenu: function() {
if (this.menuContent) {
window.RichFaces.Memory.clean(this.menuContent);
15 years, 4 months
JBoss Rich Faces SVN: r15284 - tags/3.3.2.CR1/ui/calendar/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-08-24 13:02:17 -0400 (Mon, 24 Aug 2009)
New Revision: 15284
Modified:
tags/3.3.2.CR1/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
RF-7666 fix
Modified: tags/3.3.2.CR1/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- tags/3.3.2.CR1/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2009-08-24 16:48:06 UTC (rev 15283)
+++ tags/3.3.2.CR1/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2009-08-24 17:02:17 UTC (rev 15284)
@@ -361,23 +361,23 @@
}
- public JSFunction getIsDayEnabled(FacesContext context, UIComponent component) {
+ public JSReference getIsDayEnabled(FacesContext context, UIComponent component) {
UICalendar calendar = (UICalendar) component;
String isDayEnabled = (String) calendar.getAttributes().get(
"isDayEnabled");
if (isDayEnabled != null && isDayEnabled.length() != 0) {
- return new JSFunction(isDayEnabled);
+ return new JSReference(isDayEnabled); //new JSFunction(isDayEnabled);
}
return null;
}
- public JSFunction getDayStyleClass(FacesContext context, UIComponent component) {
+ public JSReference getDayStyleClass(FacesContext context, UIComponent component) {
UICalendar calendar = (UICalendar) component;
String dayStyleClass = (String) calendar.getAttributes().get(
"dayStyleClass");
if (dayStyleClass != null && dayStyleClass.length() != 0) {
- return new JSFunction(dayStyleClass);
+ return new JSReference(dayStyleClass);
}
return null;
15 years, 4 months
JBoss Rich Faces SVN: r15283 - in root: framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-08-24 12:48:06 -0400 (Mon, 24 Aug 2009)
New Revision: 15283
Modified:
root/examples/trunk/components/core-demo/src/main/webapp/status.xhtml
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js/4_0_0.js
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxStatusRenderer.java
Log:
Named status support added
Modified: root/examples/trunk/components/core-demo/src/main/webapp/status.xhtml
===================================================================
--- root/examples/trunk/components/core-demo/src/main/webapp/status.xhtml 2009-08-24 16:24:55 UTC (rev 15282)
+++ root/examples/trunk/components/core-demo/src/main/webapp/status.xhtml 2009-08-24 16:48:06 UTC (rev 15283)
@@ -14,6 +14,9 @@
jQuery(source).css('border', borderStyle);
}
</script>
+
+ <a4j:status name="ilStatus" startText="...named status request start..." />
+ <br />
<a4j:status startStyle="color: green" errorStyle="color: red" onstart="selectEventSource(event.source, '3px dotted navy')"
onerror="selectEventSource(event.source, '2px solid red')" onsuccess="selectEventSource(event.source, '0px none white')">
@@ -30,6 +33,10 @@
</a4j:status>
<h:form>
+ <a4j:jsFunction name="statusFunction" status="ilStatus" action="#{statusBean.delay}" />
+
+ <h:commandLink value="Named status" onclick="statusFunction(); return false;" />
+  
<h:commandLink value="Ajax" action="#{statusBean.delay}">
<f:ajax />
</h:commandLink>
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-24 16:24:55 UTC (rev 15282)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-24 16:48:06 UTC (rev 15283)
@@ -27,7 +27,6 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
@@ -36,7 +35,6 @@
import java.util.Map;
import java.util.Set;
-import javax.faces.component.EditableValueHolder;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
import javax.faces.component.UIForm;
@@ -55,7 +53,6 @@
import org.ajax4jsf.component.AjaxComponent;
import org.ajax4jsf.component.AjaxContainer;
import org.ajax4jsf.component.AjaxLoadBundleComponent;
-import org.ajax4jsf.component.AjaxSupport;
import org.ajax4jsf.component.AjaxViewRoot;
import org.ajax4jsf.component.JavaScriptParameter;
import org.ajax4jsf.context.AjaxContext;
@@ -294,6 +291,12 @@
UIComponent component) {
AjaxEventOptions ajaxEventOptions = new AjaxEventOptions();
+
+ String ajaxStatusName = getAjaxStatus(component);
+ if (ajaxStatusName != null && ajaxStatusName.length() != 0) {
+ ajaxEventOptions.set(STATUS_ATTR_NAME, ajaxStatusName);
+ }
+
appendParameters(facesContext, component, ajaxEventOptions.getParameters());
return ajaxEventOptions;
@@ -661,20 +664,23 @@
} else {
statusId = (String) component.getAttributes().get(STATUS_ATTR_NAME);
}
- if (null != statusId) {
- UIComponent status = RendererUtils.getInstance().
- findComponentFor(component, statusId);
-
- if (null != status) {
- statusId = status
- .getClientId(FacesContext.getCurrentInstance());
- } else {
- log.warn(Messages.getMessage(
- Messages.AJAX_STATUS_COMPONENT_NOT_FOWND_WARNING,
- component.getId()));
- }
- }
+
return statusId;
+
+// if (null != statusId) {
+// UIComponent status = RendererUtils.getInstance().
+// findComponentFor(component, statusId);
+//
+// if (null != status) {
+// statusId = status
+// .getClientId(FacesContext.getCurrentInstance());
+// } else {
+// log.warn(Messages.getMessage(
+// Messages.AJAX_STATUS_COMPONENT_NOT_FOWND_WARNING,
+// component.getId()));
+// }
+// }
+// return statusId;
}
public static JSFunctionDefinition buildAjaxOncomplete(String body) {
Modified: root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js/4_0_0.js
===================================================================
--- root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js/4_0_0.js 2009-08-24 16:24:55 UTC (rev 15282)
+++ root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js/4_0_0.js 2009-08-24 16:48:06 UTC (rev 15283)
@@ -308,6 +308,56 @@
}
};
+ var jsfEventsAdapterEventNames = {
+ event: {
+ 'begin': ['onsubmit'],
+ 'success': ['onsuccess', 'oncomplete']
+ },
+ error: ['onerror', 'oncomplete']
+ };
+
+ richfaces.createJSFEventsAdapter = function(handlers) {
+ //hash of handlers
+ //supported are:
+ // - onsubmit
+ // - onsuccess
+ // - onerror
+ // - oncomplete
+ handlers = handlers || {};
+
+ return function(eventData) {
+ var source = eventData.source;
+ //that's request status, not status control data
+ var status = eventData.status;
+ var type = eventData.type;
+
+ var typeHandlers = jsfEventsAdapterEventNames[type];
+ var handlerNames = (typeHandlers || {})[status] || typeHandlers;
+
+ if (handlerNames) {
+ for (var i = 0; i < handlerNames.length; i++) {
+ var handler = handlers[handlerNames[i]];
+ if (handler) {
+ handler.call(source, eventData);
+ }
+ }
+ }
+ };
+ };
+
+ var setGlobalStatusNameVariable = function(statusName) {
+ //TODO: parallel requests
+ if (statusName) {
+ richfaces['statusName'] = statusName;
+ } else {
+ delete richfaces['statusName'];
+ }
+ }
+
+ var getGlobalStatusNameVariable = function() {
+ return richfaces.statusName;
+ }
+
richfaces.ajax = function(source, event, options) {
options = options || {};
var sourceId = (typeof source == 'object' && source.id) ? source.id : source;
@@ -320,38 +370,50 @@
parameters.RICHFACES_AJAX = sourceId;
}
+ var eventsHandler;
+
+ if (options.status) {
+ eventsHandler = richfaces.createJSFEventsAdapter({
+ onsubmit: function() { setGlobalStatusNameVariable(options.status); }
+ });
+ }
+
parameters[sourceId] = sourceId;
+ if (eventsHandler) {
+ parameters['onevent'] = eventsHandler;
+ parameters['onerror'] = eventsHandler;
+ }
jsf.ajax.request(source, event, parameters);
};
var RICHFACES_AJAX_STATUS = "richfaces:ajaxStatus";
- var statusAjaxEventHandler = function(data) {
- var source = data.source;
- var status = data.status;
- var type = data.type;
-
- var methodName;
-
- if (type == 'event') {
- if (status == 'begin') {
- methodName = 'start';
- } else if (status == 'success') {
- methodName = 'success';
- }
- } else if (type == 'error') {
- methodName = 'error';
- }
-
+ var getStatusDataAttributeName = function(statusName) {
+ return statusName ? (RICHFACES_AJAX_STATUS + "@" + statusName) : RICHFACES_AJAX_STATUS;
+ };
+
+ var statusAjaxEventHandler = function(data, methodName) {
if (methodName) {
+ //global status name
+ var statusName = getGlobalStatusNameVariable();
+ var source = data.source;
+
var statusApplied = false;
- var statusContainers = [jQuery(source).parents('form'), jQuery()];
+ var statusDataAttribute = getStatusDataAttributeName(statusName);
+
+ var statusContainers;
+ if (statusName) {
+ statusContainers = [jQuery()];
+ } else {
+ statusContainers = [jQuery(source).parents('form'), jQuery()];
+ }
+
for (var containerIdx = 0; containerIdx < statusContainers.length && !statusApplied;
containerIdx++) {
var statusContainer = statusContainers[containerIdx];
- var statuses = statusContainer.data(RICHFACES_AJAX_STATUS);
+ var statuses = statusContainer.data(statusDataAttribute);
if (statuses) {
for (var statusId in statuses) {
var status = statuses[statusId];
@@ -364,7 +426,7 @@
}
if (!statusApplied) {
- statusContainer.removeData(RICHFACES_AJAX_STATUS)
+ statusContainer.removeData(statusDataAttribute);
}
}
}
@@ -376,9 +438,16 @@
if (!thisFunction.initialized) {
thisFunction.initialized = true;
- jsf.ajax.addOnEvent(statusAjaxEventHandler);
+ var jsfEventsListener = richfaces.createJSFEventsAdapter({
+ onsubmit: function(eventData) { statusAjaxEventHandler(eventData, 'start'); },
+ onerror: function(eventData) { statusAjaxEventHandler(eventData, 'error'); },
+ onsuccess: function(eventData) { statusAjaxEventHandler(eventData, 'success'); },
+ oncomplete: function() { setGlobalStatusNameVariable(null); }
+ });
+
+ jsf.ajax.addOnEvent(jsfEventsListener);
//TODO blocks default alert error handler
- jsf.ajax.addOnError(statusAjaxEventHandler);
+ jsf.ajax.addOnError(jsfEventsListener);
}
};
@@ -414,15 +483,24 @@
return {
register: function() {
initializeStatuses();
- var container = getElement.call(this).parents('form');
- if (container.length == 0) {
+
+ var statusName = this.options.statusName;
+ var dataStatusAttribute = getStatusDataAttributeName(statusName);
+
+ var container;
+ if (statusName) {
container = jQuery();
- };
+ } else {
+ container = getElement.call(this).parents('form');
+ if (container.length == 0) {
+ container = jQuery();
+ };
+ }
- var statuses = container.data(RICHFACES_AJAX_STATUS);
+ var statuses = container.data(dataStatusAttribute);
if (!statuses) {
statuses = {};
- container.data(RICHFACES_AJAX_STATUS, statuses);
+ container.data(dataStatusAttribute, statuses);
}
statuses[this.statusId] = this;
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxStatusRenderer.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxStatusRenderer.java 2009-08-24 16:24:55 UTC (rev 15282)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxStatusRenderer.java 2009-08-24 16:48:06 UTC (rev 15283)
@@ -204,6 +204,8 @@
ScriptHashVariableWrapper.EVENT_HANDLER);
}
+ rendererUtils.addToScriptHash(options, "statusName", attributes.get("name"));
+
if (!options.isEmpty()) {
statusConstructor.addParameter(options);
}
15 years, 4 months
JBoss Rich Faces SVN: r15282 - branches/community/3.3.X/ui/calendar/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-08-24 12:24:55 -0400 (Mon, 24 Aug 2009)
New Revision: 15282
Modified:
branches/community/3.3.X/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
Demo: Calendar cannot be opened
https://jira.jboss.org/jira/browse/RF-7666
Modified: branches/community/3.3.X/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- branches/community/3.3.X/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2009-08-24 15:52:18 UTC (rev 15281)
+++ branches/community/3.3.X/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2009-08-24 16:24:55 UTC (rev 15282)
@@ -361,23 +361,23 @@
}
- public JSFunction getIsDayEnabled(FacesContext context, UIComponent component) {
+ public JSReference getIsDayEnabled(FacesContext context, UIComponent component) {
UICalendar calendar = (UICalendar) component;
String isDayEnabled = (String) calendar.getAttributes().get(
"isDayEnabled");
if (isDayEnabled != null && isDayEnabled.length() != 0) {
- return new JSFunction(isDayEnabled);
+ return new JSReference(isDayEnabled); //new JSFunction(isDayEnabled);
}
return null;
}
- public JSFunction getDayStyleClass(FacesContext context, UIComponent component) {
+ public JSReference getDayStyleClass(FacesContext context, UIComponent component) {
UICalendar calendar = (UICalendar) component;
String dayStyleClass = (String) calendar.getAttributes().get(
"dayStyleClass");
if (dayStyleClass != null && dayStyleClass.length() != 0) {
- return new JSFunction(dayStyleClass);
+ return new JSReference(dayStyleClass);
}
return null;
15 years, 4 months
JBoss Rich Faces SVN: r15281 - in branches/community/3.3.X/ui/contextMenu/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-08-24 11:52:18 -0400 (Mon, 24 Aug 2009)
New Revision: 15281
Modified:
branches/community/3.3.X/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java
branches/community/3.3.X/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
Log:
Parameters not being passed to contextMenu
https://jira.jboss.org/jira/browse/RF-7172
Modified: branches/community/3.3.X/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java
===================================================================
--- branches/community/3.3.X/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java 2009-08-24 15:38:11 UTC (rev 15280)
+++ branches/community/3.3.X/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java 2009-08-24 15:52:18 UTC (rev 15281)
@@ -46,7 +46,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
*/
- protected Class getComponentClass() {
+ protected Class<UIContextMenu> getComponentClass() {
return UIContextMenu.class;
}
@@ -66,18 +66,11 @@
styleClass = "";
}
- writeAttr(writer, HTML.onmousemove_ATTRIBUTE, layer.getAttributes().get("onmousemove"));
- writeAttr(writer, HTML.onmouseout_ATTRIBUTE, layer.getAttributes().get("onmouseout"));
- writeAttr(writer, HTML.onmouseover_ATTRIBUTE, layer.getAttributes().get("onmouseover"));
-
+ getUtils().writeAttribute(writer, HTML.onmousemove_ATTRIBUTE, layer.getAttributes().get("onmousemove"));
+ getUtils().writeAttribute(writer, HTML.onmouseout_ATTRIBUTE, layer.getAttributes().get("onmouseout"));
+ getUtils().writeAttribute(writer, HTML.onmouseover_ATTRIBUTE, layer.getAttributes().get("onmouseover"));
+
writer.writeAttribute(HTML.class_ATTRIBUTE, "rich-menu-list-border " + styleClass, null);
writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none; z-index: 2; " + style, null);
}
-
- private void writeAttr(ResponseWriter writer, final String name, final Object value) throws IOException {
- if (value != null) {
- writer.writeAttribute(name, value, null);
- }
-
- }
}
Modified: branches/community/3.3.X/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
===================================================================
--- branches/community/3.3.X/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2009-08-24 15:38:11 UTC (rev 15280)
+++ branches/community/3.3.X/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2009-08-24 15:52:18 UTC (rev 15281)
@@ -109,11 +109,21 @@
this.element.appendChild(div);
var html = this.evaluator.invoke('getContent', context||{}).join('');
+ html = this.interpolate(html, context);
new Insertion.Top(div, html);
this.menuContent = div;
},
+ interpolate: function (placeholders, context) {
+ for(var k in context) {
+ var v = context[k];
+ var regexp = new RegExp("\\{" + k + "\\}", "g");
+ placeholders = placeholders.replace(regexp, v);
+ }
+ return placeholders;
+ },
+
destroyMenu: function() {
if (this.menuContent) {
window.RichFaces.Memory.clean(this.menuContent);
15 years, 4 months
JBoss Rich Faces SVN: r15280 - root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-08-24 11:38:11 -0400 (Mon, 24 Aug 2009)
New Revision: 15280
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
Log:
rename limitToList -> limitRender
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-24 14:40:14 UTC (rev 15279)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-24 15:38:11 UTC (rev 15280)
@@ -106,7 +106,7 @@
/**
* Attribute to keep
*/
- public static final String LIMITTOLIST_ATTR_NAME = "limitToList";
+ public static final String LIMITTOLIST_ATTR_NAME = "limitRender";
private static Log log = LogFactory.getLog(AjaxRendererUtils.class);
15 years, 4 months
JBoss Rich Faces SVN: r15279 - in root/examples/trunk/richfaces-demo/src/main/webapp: resources/rich/css and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2009-08-24 10:40:14 -0400 (Mon, 24 Aug 2009)
New Revision: 15279
Added:
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/page.css
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/img/footer_background.png
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/img/header_background.png
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/page.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel/
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel/usage.xhtml
Log:
continue rf-demo
Added: root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/page.css
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/page.css (rev 0)
+++ root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/page.css 2009-08-24 14:40:14 UTC (rev 15279)
@@ -0,0 +1,74 @@
+.rich-page{width:100%;}
+.body{
+ background: #FFFFFF;
+ margin:0px;
+}
+.header_bg{
+ background-image:url(#{resource['rich/img/header_background.png']});
+ border-bottom:1px solid;
+ border-bottom-color:#FFFFFF;
+ background-color:#BED6F8;
+ background-repeat:repeat-x;
+ background-position:top left;
+}
+
+.footer_bg{
+ background-image:url(#{resource['rich/img/footer_background.png']});
+ border-top:1px solid;
+ border-top-color:#FFFFFF;
+ background-color:#BED6F8;
+ background-repeat:repeat-x;
+ background-position:center left;
+}
+
+.menu_col{
+ background:#FFFFFF;
+ vertical-align:top;
+ border-top:2px solid;
+ border-top-color:#BED6F8;
+ border-right:2px solid;
+ border-right-color:#BED6F8;
+ border-bottom:2px solid;
+ border-bottom-color:#BED6F8;
+}
+
+.content_col{
+ background:#FFFFFF;
+ vertical-align:top;
+ width:100%;
+ border-top:2px solid;
+ border-top-color:#BED6F8;
+ border-bottom:2px solid;
+ border-bottom-color:#BED6F8;
+}
+*.menu_col, *.content_col, *.footer_bg{
+ font-family:Arial, Verdana, sans-serif ;
+ color:#000000;
+ font-size:11px;
+}
+*.header_content{
+ font-family:Arial, Verdana, sans-serif;
+ color:#000000;
+ font-size:11px;
+}
+
+
+.page_size {
+ width : 100%
+ height : 100%
+}
+
+
+.header_content {
+ margin : 0px 0px 0px 0px
+ height : 95px position : relative
+}
+
+.spacer{font-size : 1px}
+
+
+.footer_bg_content {
+ margin : 0px 0px 0px 0px
+ height : 45px
+ position : relative
+}
\ No newline at end of file
Added: root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/img/footer_background.png
===================================================================
(Binary files differ)
Property changes on: root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/img/footer_background.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/img/header_background.png
===================================================================
(Binary files differ)
Property changes on: root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/img/header_background.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/page.xhtml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/page.xhtml (rev 0)
+++ root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/page.xhtml 2009-08-24 14:40:14 UTC (rev 15279)
@@ -0,0 +1,70 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:composite="http://java.sun.com/jsf/composite">
+ <head>
+ <title>page</title>
+ </head>
+<body>
+
+<composite:interface>
+ <composite:attribute name="style" />
+ <composite:attribute name="styleClass"/>
+ <composite:attribute name="headerClass"/>
+ <composite:attribute name="bodyClass"/>
+ <composite:attribute name="sidebarClass"/>
+</composite:interface>
+<composite:implementation>
+<h:outputText value="<!DOCTYPE html PUBLIC "e;-//W3C//DTD XHTML 1.0 Transitional//EN"e;
+"e;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"e;>" escape="false"/>
+<html>
+<h:head>
+ <title>#{cc.attrs.pageTitle}</title>
+ <composite:renderFacet name="pageHeader"/>
+</h:head>
+<h:body>
+ <h:outputStylesheet name="rich/css/page.css" />
+ <table border="0" cellpadding="0" cellspacing="0" class="rich-page #{cc.attrs.pageClass}">
+ <tbody>
+ <tr>
+ <td class="header_bg">
+ <div class="header_content rich-page-header #{cc.attrs.headerClass}">
+ <composite:renderFacet name="header"/>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td width="100%" height="100%" class="bg_tabbody">
+ <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%" class="rich-page-content #{cc.attrs.contentClass}">
+ <tbody>
+ <tr>
+ <td class="menu_col rich-page-sidebar #{cc.attrs.sidebarClass}">
+ <div class="menu_width spacer" style="width:#{cc.attrs.sidebarWidth}px"></div>
+ <composite:renderFacet name="sidebar"/>
+ </td>
+ <td class="content_col rich-page-body #{cc.attrs.bodyClass}">
+ <composite:insertChildren />
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td class="footer_bg">
+ <div class="footer_bg_content rich-page-footer #{cc.attrs.footerClass}">
+ <composite:renderFacet name="footer"/>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</h:body>
+</html>
+</composite:implementation>
+</body>
+</html>
Added: root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel/usage.xhtml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel/usage.xhtml (rev 0)
+++ root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel/usage.xhtml 2009-08-24 14:40:14 UTC (rev 15279)
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:rich="http://java.sun.com/jsf/composite/rich"
+ xmlns:a4j="http://richfaces.org/a4j">
+
+<ui:composition>
+ <h:form>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Register form" />
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{userBean.name}" required="true"
+ validatorMessage="Nickname should countains of at least 3 characters"
+ id="name">
+ <a4j:ajax event="blur" execute="@this" render="namemessage"/>
+ <f:validateLength minimum="3" />
+ </h:inputText>
+ <a4j:outputPanel layout="block" id="namemessage">
+ <h:message for="name" style="color:red"/>
+ </a4j:outputPanel>
+ <h:outputText value="Password" />
+ <h:inputSecret value="#{userBean.password}" id="pass" required="true"
+ validatorMessage="Password should consist of at least 6 characters" >
+ <a4j:ajax event="blur" execute="@this" render="passmessage"/>
+ <f:validateLength minimum="6"/>
+ </h:inputSecret>
+ <a4j:outputPanel layout="block" id="passmessage">
+ <h:message for="pass" style="color:red"/>
+ </a4j:outputPanel>
+ <h:outputText value="Age:" />
+ <h:inputText value="#{userBean.age}" id="age" required="true"
+ validatorMessage="You must be 21 or older to register">
+ <f:validateLongRange minimum="21" />
+ <a4j:ajax event="blur" execute="@this" render="agemessage"/>
+ </h:inputText>
+ <a4j:outputPanel layout="block" id="agemessage">
+ <h:message for="age" style="color:red"/>
+ </a4j:outputPanel>
+ </h:panelGrid>
+ <h:commandButton action="#{userBean.store}" value="Register" type="button">
+ <a4j:ajax execute="@form"/>
+ </h:commandButton>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:outputText value="#{userBean.recordStatus}" id="out" style="color:green;"/>
+ </a4j:outputPanel>
+ </rich:panel>
+ </h:form>
+</ui:composition>
+
+</html>
\ No newline at end of file
Added: root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel.xhtml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel.xhtml (rev 0)
+++ root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel.xhtml 2009-08-24 14:40:14 UTC (rev 15279)
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="/templates/main.xhtml">
+ <ui:define name="body">
+ <p>
+ <b>a4j:outputPanel</b> component designed to provide next features:
+ <ul>
+ <li><b>Automaticall updates</b> of the child content on Ajax requests</li>
+ <li>Wrapper component for <b>conditional rendering of nested elements</b> via Ajax</li>
+ <li><b>Configurable layouts</b>:
+ <ul>
+ <li>inline - rendered as span element</li>
+ <li>block - rendered as div element</li>
+ <li>none - special layout for nested components confitional rendering cases</li>
+ </ul>
+ </li>
+ <li></li>
+ </ul>
+ </p>
+ <p>
+ In the sample you could see how <b>h:message components inserted dynamically</b> if exist.
+ Also user record <b>storing status updated automatically</b> after request without mentioning
+ in <b>render</b> property.
+
+ </p>
+ <fieldset>
+ <legend>Sample</legend>
+ <ui:include src="/richfaces/outputPanel/usage.xhtml" />
+ </fieldset>
+ </ui:define>
+</ui:composition>
+
+</html>
\ No newline at end of file
15 years, 4 months
JBoss Rich Faces SVN: r15278 - in root/examples/trunk/richfaces-demo/src/main: java/org/richfaces/demo/mediaOutput and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2009-08-24 10:34:56 -0400 (Mon, 24 Aug 2009)
New Revision: 15278
Modified:
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/common/UserBean.java
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/mediaOutput/MediaBean.java
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/mediaOutput/flashUsage.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/templates/includes/navigation.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/templates/main.xhtml
Log:
continue rf-demo
Modified: root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/common/UserBean.java
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/common/UserBean.java 2009-08-24 14:17:30 UTC (rev 15277)
+++ root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/common/UserBean.java 2009-08-24 14:34:56 UTC (rev 15278)
@@ -1,14 +1,14 @@
package org.richfaces.demo.common;
import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
@ManagedBean(name = "userBean")
-@SessionScoped
+@RequestScoped
public class UserBean {
- private String name="";
- private java.lang.Integer screenWidth;
- private java.lang.Integer screenHeight;
+ private String name="";
+ private String password="";
private String job;
private String address;
private String city;
@@ -40,22 +40,6 @@
this.name = name;
}
- public java.lang.Integer getScreenWidth() {
- return screenWidth;
- }
-
- public void setScreenWidth(java.lang.Integer screenWidth) {
- this.screenWidth = screenWidth;
- }
-
- public java.lang.Integer getScreenHeight() {
- return screenHeight;
- }
-
- public void setScreenHeight(java.lang.Integer screenHeight) {
- this.screenHeight = screenHeight;
- }
-
public String nameItJohn() {
setName("John");
return null;
@@ -105,4 +89,12 @@
this.age = age;
}
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
}
Modified: root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/mediaOutput/MediaBean.java
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/mediaOutput/MediaBean.java 2009-08-24 14:17:30 UTC (rev 15277)
+++ root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/mediaOutput/MediaBean.java 2009-08-24 14:34:56 UTC (rev 15278)
@@ -64,7 +64,7 @@
loader = getClass().getClassLoader();
}
- InputStream stream = loader.getResourceAsStream("org/richfaces/demo/mediaoutput/text.swf");
+ InputStream stream = loader.getResourceAsStream("org/richfaces/demo/mediaOutput/text.swf");
if (stream != null) {
try {
copy(stream, out);
Modified: root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/mediaOutput/flashUsage.xhtml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/mediaOutput/flashUsage.xhtml 2009-08-24 14:17:30 UTC (rev 15277)
+++ root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/mediaOutput/flashUsage.xhtml 2009-08-24 14:34:56 UTC (rev 15278)
@@ -6,9 +6,8 @@
xmlns:a4j="http://richfaces.org/a4j">
<ui:composition>
-
-
- <p>SWF Movie:</p>
+ <script src="#{facesContext.externalContext.requestContextPath}/script/swfobject.js" type="text/javascript"/>
+ <p>SWF Movie:</p>
<a4j:outputPanel id="flashPanelDynamic">
<a4j:mediaOutput element="a" id="swfLink" style="display: none;" cacheable="false" session="true"
@@ -21,10 +20,10 @@
</a4j:outputPanel>
<script type="text/javascript">
- var flashvars = {};
- var params = {};
- var attributes = {};
- swfobject.embedSWF('swfLink').href, $('myFlashContent')", "200", "200", "9.0.0", false, flashvars, params, attributes);
+ var flashvars = {};
+ var params = {};
+ var attributes = {};
+ swfobject.embedSWF(document.getElementById('page:swfLink').href, document.getElementById('myFlashContent'), "200", "200", "9.0.0", false, flashvars, params, attributes);
</script>
</a4j:outputPanel>
Modified: root/examples/trunk/richfaces-demo/src/main/webapp/templates/includes/navigation.xhtml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/templates/includes/navigation.xhtml 2009-08-24 14:17:30 UTC (rev 15277)
+++ root/examples/trunk/richfaces-demo/src/main/webapp/templates/includes/navigation.xhtml 2009-08-24 14:34:56 UTC (rev 15278)
@@ -17,6 +17,8 @@
value="#{facesContext.externalContext.requestContextPath}/richfaces/push.jsf">a4j:push</h:outputLink>
<h:outputLink
value="#{facesContext.externalContext.requestContextPath}/richfaces/status.jsf">a4j:status</h:outputLink>
+ <h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/richfaces/outputPanel.jsf">a4j:outputPanel</h:outputLink>
</h:panelGrid>
</rich:panel>
</ui:composition>
Modified: root/examples/trunk/richfaces-demo/src/main/webapp/templates/main.xhtml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/templates/main.xhtml 2009-08-24 14:17:30 UTC (rev 15277)
+++ root/examples/trunk/richfaces-demo/src/main/webapp/templates/main.xhtml 2009-08-24 14:34:56 UTC (rev 15278)
@@ -1,33 +1,26 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-<h:head>
- <link rel="stylesheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/CSS/yuiLayouts/reset-fonts-grids.css"/>
- <link rel="stylesheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/CSS/yuiLayouts/grids.css"/>
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:rich="http://java.sun.com/jsf/composite/rich">
+<h:head>
</h:head>
<h:body>
-<div id="doc2" class="yui-t2"> <!-- change class to change preset -->
- <div id="hd">
- <center>RichFaces 4.0 Demo</center>
- </div>
- <div id="bd">
- <div class="yui-b">
- <ui:include src="/templates/includes/navigation.xhtml" />
- </div>
- <div id="yui-main">
- <div class="yui-b">
- <ui:insert name="body">
- Body content missed
- </ui:insert>
- </div>
- </div>
- </div>
- <div id="ft">
- <i><center>Footer</center> </i>
- </div>
- </div>
-</h:body>
+ <ui:composition>
+ <rich:page id="page">
+ <f:facet name="header">
+ <h1>Welcome to RichFaces demo!</h1>
+ </f:facet>
+ <f:facet name="sidebar">
+ <ui:include src="/templates/includes/navigation.xhtml" />
+ </f:facet>
+ <ui:insert name="body">
+ Body content missed
+ </ui:insert>
+ <f:facet name="footer">
+ footer
+ </f:facet>
+ </rich:page>
+ </ui:composition>
+</h:body>
</html>
\ No newline at end of file
15 years, 4 months
JBoss Rich Faces SVN: r15277 - root/examples/trunk/components/core-demo/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-08-24 10:17:30 -0400 (Mon, 24 Aug 2009)
New Revision: 15277
Modified:
root/examples/trunk/components/core-demo/src/main/webapp/WEB-INF/web.xml
Log:
remove facelet library for the a4j:ajax
Modified: root/examples/trunk/components/core-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- root/examples/trunk/components/core-demo/src/main/webapp/WEB-INF/web.xml 2009-08-24 14:16:01 UTC (rev 15276)
+++ root/examples/trunk/components/core-demo/src/main/webapp/WEB-INF/web.xml 2009-08-24 14:17:30 UTC (rev 15277)
@@ -19,11 +19,6 @@
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
-
- <context-param>
- <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
- <param-value>/WEB-INF/ajax-taglib.xml</param-value>
- </context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
15 years, 4 months
JBoss Rich Faces SVN: r15276 - in root/ui/trunk/components/core/src/main: templates/org/ajax4jsf/renderkit/html and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-08-24 10:16:01 -0400 (Mon, 24 Aug 2009)
New Revision: 15276
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml
Log:
fix NPE then attribute value null
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java 2009-08-24 13:37:39 UTC (rev 15275)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java 2009-08-24 14:16:01 UTC (rev 15276)
@@ -26,6 +26,7 @@
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
+import javax.faces.component.ValueHolder;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
@@ -83,29 +84,51 @@
}
return onClick.toString();
}
-//
-// public void encodeChildren(FacesContext context, UIComponent component)
-// throws IOException {
-// renderChildren(context, component);
-// }
-//
-// public Object getValue(UIComponent uiComponent) {
-// if (uiComponent instanceof ValueHolder) {
-// return ((ValueHolder) uiComponent).getValue();
-// }
-// return uiComponent.getAttributes().get("value");
-// }
-//
-// public String getType(UIComponent uiComponent) {
-// String type;
-// if (uiComponent instanceof HtmlCommandButton) {
-// type = ((HtmlCommandButton) uiComponent).getType();
-// } else {
-// type = (String) uiComponent.getAttributes().get("type");
-// }
-// if (type == null) {
-// type = "button";
-// }
-// return type;
-// }
+
+ public String getStringValue(UIComponent component) {
+ Object value = getValue(component);
+ return convertToString(value);
+ }
+
+ protected String convertToString(Object obj ) {
+ return ( obj == null ? "" : obj.toString() );
+ }
+
+ protected String convertToString(boolean b ) {
+ return String.valueOf(b);
+ }
+
+ protected String convertToString(int b ) {
+ return b!=Integer.MIN_VALUE?String.valueOf(b):"";
+ }
+
+ protected String convertToString(long b ) {
+ return b!=Long.MIN_VALUE?String.valueOf(b):"";
+ }
+/*
+ public void encodeChildren(FacesContext context, UIComponent component)
+ throws IOException {
+ renderChildren(context, component);
+ } */
+
+ public Object getValue(UIComponent component) {
+ if (component instanceof ValueHolder) {
+ return ((ValueHolder) component).getValue();
+ }
+ return component.getAttributes().get("value");
+ }
+
+ /*
+ public String getType(UIComponent uiComponent) {
+ String type;
+ if (uiComponent instanceof HtmlCommandButton) {
+ type = ((HtmlCommandButton) uiComponent).getType();
+ } else {
+ type = (String) uiComponent.getAttributes().get("type");
+ }
+ if (type == null) {
+ type = "button";
+ }
+ return type;
+ }*/
}
Modified: root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml
===================================================================
--- root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml 2009-08-24 13:37:39 UTC (rev 15275)
+++ root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml 2009-08-24 14:16:01 UTC (rev 15276)
@@ -15,7 +15,7 @@
href="#"
class="#{component.attributes['styleClass']}"
>
- #{component.attributes['value']}
+ #{this.getStringValue(component)}
<cdk:body>
<cdk:call expression="renderChildren(context,component);" />
</cdk:body>
15 years, 4 months