Author: nbelaevski
Date: 2008-06-18 18:50:42 -0400 (Wed, 18 Jun 2008)
New Revision: 9105
Modified:
trunk/sandbox/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx
Log:
JavaScript escapement for hotKey implemented
Modified: trunk/sandbox/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx
===================================================================
--- trunk/sandbox/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx 2008-06-18
22:46:49 UTC (rev 9104)
+++ trunk/sandbox/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx 2008-06-18
22:50:42 UTC (rev 9105)
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
+
<f:root
xmlns:f="http://ajax4jsf.org/cdk/template"
xmlns:c="
http://java.sun.com/jsf/core"
@@ -68,17 +69,25 @@
<![CDATA[
selector = (String) attributes.get("selector");
if (selector != null && selector.length() != 0) {
- selector = HtmlUtil.expandIdSelector(selector, component, context);
+ selector = getUtils().escapeJavaScript(
+ HtmlUtil.expandIdSelector(selector, component, context));
}
]]>
</jsp:scriptlet>
+ <c:object var="key" type="java.lang.Object"
value="#{attributes['key']}"/>
+ <jsp:scriptlet>
+ <![CDATA[
+ key = getUtils().escapeJavaScript(key);
+ ]]>
+ </jsp:scriptlet>
+
<span id="#{clientId}" style="display:none"
x:passThruWithExclusions="id"
<script>
- new
Richfaces.hotKey("#{clientId}","#{attributes['key']}","#{selector}",
#{options}, function(event) { #{attributes['handler']} });
+ new
Richfaces.hotKey("#{clientId}","#{key}","#{selector}",
#{options}, function(event) { #{attributes['handler']} });
</script>
</span>
</f:root>
\ No newline at end of file