Author: amarkhel
Date: 2010-12-17 14:39:26 -0500 (Fri, 17 Dec 2010)
New Revision: 20668
Added:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/toolbar.js
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarRendererBase.java
trunk/ui/output/ui/src/main/templates/toolbar.template.xml
Log:
RF-9969 Toolbar: attributes for event handlers ignored
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarRendererBase.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarRendererBase.java 2010-12-17
18:54:05 UTC (rev 20667)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarRendererBase.java 2010-12-17
19:39:26 UTC (rev 20668)
@@ -49,8 +49,10 @@
@ResourceDependencies({
@ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"toolbar.js"),
@ResourceDependency(library = "org.richfaces", name =
"toolbar.ecss")
- })
+})
+
public abstract class ToolbarRendererBase extends RendererBase {
public static final String RENDERER_TYPE =
"org.richfaces.ToolbarRenderer";
@@ -376,7 +378,7 @@
for (ComponentAttribute componentAttribute
:ITEMS_HANDLER_ATTRIBUTES.values()) {
Object attr =
component.getAttributes().get(componentAttribute.getComponentAttributeName());
if (attr != null) {
- RenderKitUtils.addToScriptHash(tbEvents,
componentAttribute.getHtmlAttributeName(),
+ RenderKitUtils.addToScriptHash(tbEvents,
componentAttribute.getHtmlAttributeName().substring(2),
attr, null, ScriptHashVariableWrapper.eventHandler);
}
}
@@ -399,7 +401,7 @@
for (ComponentAttribute componentAttribute
:ITEMS_HANDLER_ATTRIBUTES.values()) {
Object attr =
tbg.getAttributes().get(componentAttribute.getComponentAttributeName());
if (attr != null) {
- RenderKitUtils.addToScriptHash(tbgEvents,
componentAttribute.getHtmlAttributeName(),
+ RenderKitUtils.addToScriptHash(tbgEvents,
componentAttribute.getHtmlAttributeName().substring(2),
attr, null, ScriptHashVariableWrapper.eventHandler);
}
}
Added: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/toolbar.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/toolbar.js
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/toolbar.js 2010-12-17
19:39:26 UTC (rev 20668)
@@ -0,0 +1,23 @@
+function toolbarHandlers(options) {
+ if (options.id && options.events) {
+ jQuery('.rf-tb-itm', document.getElementById(options.id)).bind(
+ options.events);
+ }
+ var groups = options.groups;
+ if (groups && groups.length > 0) {
+ var group;
+ var i;
+ for (i in groups) {
+ group = groups[i];
+ if (group) {
+ var groupIds = group.ids;
+ var y;
+ var groupElements = [];
+ for (y in groupIds) {
+ groupElements.push(document.getElementById(groupIds[y]));
+ }
+ jQuery(groupElements).bind(group.events);
+ }
+ }
+ }
+}
Property changes on:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/toolbar.js
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/ui/output/ui/src/main/templates/toolbar.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/toolbar.template.xml 2010-12-17 18:54:05 UTC
(rev 20667)
+++ trunk/ui/output/ui/src/main/templates/toolbar.template.xml 2010-12-17 19:39:26 UTC
(rev 20668)
@@ -19,14 +19,14 @@
height="#{getHeightToolbar(component)}"
class="rf-tb #{component.attributes['styleClass']}"
style="#{ component.attributes['style']}"
- cdk:passThroughWithExclusions="">
+ cdk:passThroughWithExclusions="">
<cdk:call expression="renderColElements(facesContext,
component)" />
<tr class="rf-tb-cntr">
<cdk:body />
</tr>
</table>
<script type="text/javascript">
- #{toScriptArgs(getOptions(component))}
+ toolbarHandlers(#{toScriptArgs(getOptions(component))});
</script>
</cc:implementation>
</cdk:root>
Show replies by date