Author: maksimkaszynski
Date: 2007-07-31 11:58:04 -0400 (Tue, 31 Jul 2007)
New Revision: 1957
Added:
trunk/sandbox/api/src/main/java/org/richfaces/component/ScriptExportable.java
Modified:
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
Log:
added ScriptExportable interface
Added: trunk/sandbox/api/src/main/java/org/richfaces/component/ScriptExportable.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/component/ScriptExportable.java
(rev 0)
+++
trunk/sandbox/api/src/main/java/org/richfaces/component/ScriptExportable.java 2007-07-31
15:58:04 UTC (rev 1957)
@@ -0,0 +1,13 @@
+/**
+ *
+ */
+package org.richfaces.component;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface ScriptExportable {
+ public String getScriptVar();
+ public void setScriptVar(String s);
+}
Modified:
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
===================================================================
---
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-07-31
15:32:25 UTC (rev 1956)
+++
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-07-31
15:58:04 UTC (rev 1957)
@@ -45,7 +45,7 @@
*
*/
-public abstract class UIScrollableGrid extends UIDataAdaptor implements AjaxComponent,
Sortable, Selectable{
+public abstract class UIScrollableGrid extends UIDataAdaptor implements AjaxComponent,
Sortable, Selectable, ScriptExportable{
public static final String COMPONENT_TYPE =
"org.richfaces.component.ScrollableGrid";
Modified:
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
===================================================================
---
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-07-31
15:32:25 UTC (rev 1956)
+++
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-07-31
15:58:04 UTC (rev 1957)
@@ -420,8 +420,14 @@
}
public String getJavaScriptVarName(FacesContext context, UIScrollableGrid grid) {
- String id = grid.getBaseClientId(context);
- return "window.Richfaces_ScrollableGrid_" +
id.replaceAll("[^A-Za-z0-9_]", "_");
+
+ String name = grid.getScriptVar();
+ if (name == null) {
+ String id = grid.getBaseClientId(context);
+ name = "Richfaces_ScrollableGrid_" +
id.replaceAll("[^A-Za-z0-9_]", "_");
+ }
+
+ return "window." + name;
}
public String createClientScrollableGrid(FacesContext context, UIScrollableGrid grid) {
Show replies by date