JBoss Rich Faces SVN: r12033 - trunk/ui/calendar/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-25 12:01:00 -0500 (Thu, 25 Dec 2008)
New Revision: 12033
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-5390
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-12-25 16:55:44 UTC (rev 12032)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-12-25 17:01:00 UTC (rev 12033)
@@ -310,6 +310,11 @@
// TODO nick - nick - queue this event when ValueChangeEvent is
// queued?
new AjaxEvent(component).queue();
+
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ if (ajaxContext.isAjaxRequest(context)) {
+ ajaxContext.addAreasToProcessFromComponent(context, component);
+ }
}
String selectedDateString = (String) requestParameterMap.get(clientId
@@ -456,11 +461,6 @@
Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, calendar, params);
options.put("calendar", JSReference.THIS);
- boolean isSingle = ((Boolean) calendar.getAttributes()
- .get("ajaxSingle")).booleanValue();
- if (isSingle) {
- options.put("single", JSReference.TRUE);
- }
String oncomplete = AjaxRendererUtils.getAjaxOncomplete(calendar);
JSFunctionDefinition oncompleteDefinition = new JSFunctionDefinition();
16 years, 2 months
JBoss Rich Faces SVN: r12032 - in trunk/framework: impl/src/main/java/org/ajax4jsf/context and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-25 11:55:44 -0500 (Thu, 25 Dec 2008)
New Revision: 12032
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java
Log:
https://jira.jboss.org/jira/browse/RF-5390
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2008-12-25 13:51:03 UTC (rev 12031)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2008-12-25 16:55:44 UTC (rev 12032)
@@ -76,6 +76,12 @@
public abstract void addRegionsFromComponent(UIComponent component);
+ /**
+ * @param component
+ * @since 3.3.0
+ */
+ public abstract void addAreasToProcessFromComponent(FacesContext context, UIComponent component);
+
public abstract Set<String> getAjaxAreasToRender();
public abstract Set<String> getAjaxAreasToProcess();
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-12-25 13:51:03 UTC (rev 12031)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-12-25 16:55:44 UTC (rev 12032)
@@ -333,6 +333,36 @@
}
}
+ /**
+ * Add IDs of regions to process
+ *
+ * @see org.ajax4jsf.context.AjaxContext#addAreasToProcessFromComponent(javax.faces.component.UIComponent)
+ */
+ @Override
+ public void addAreasToProcessFromComponent(FacesContext context, UIComponent component) {
+ RendererUtils rendererUtils = RendererUtils.getInstance();
+
+ Set<String> areasToProcess = AjaxRendererUtils.getAjaxAreasToProcess(component);
+ if (areasToProcess != null) {
+ Set<String> convertedAreaIds = new HashSet<String>();
+
+ for (String areaId : areasToProcess) {
+ UIComponent areaComponent = rendererUtils.findComponentFor(component, areaId);
+ if (areaComponent != null) {
+ convertedAreaIds.add(areaComponent.getClientId(context));
+ } else {
+ convertedAreaIds.add(areaId);
+ }
+ }
+
+ if (this.ajaxAreasToProcess == null) {
+ this.ajaxAreasToProcess = convertedAreaIds;
+ } else {
+ this.ajaxAreasToProcess.addAll(convertedAreaIds);
+ }
+ }
+ }
+
public void addComponentToAjaxRender(UIComponent component) {
this.ajaxAreasToRender.add(AjaxRendererUtils.getAbsoluteId(component));
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2008-12-25 13:51:03 UTC (rev 12031)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2008-12-25 16:55:44 UTC (rev 12032)
@@ -103,6 +103,11 @@
public static final String AJAX_REGIONS_ATTRIBUTE = "reRender";
+ /**
+ * @since 3.3.0
+ */
+ public static final String AJAX_PROCESS_ATTRIBUTE = "process";
+
private static final Class<?> OBJECT_ARRAY_CLASS = (new Object[0]).getClass();
public static final String VALUE_ATTR = "value";
@@ -509,6 +514,25 @@
}
/**
+ * Returns set of areas to be processed as a result of this component action invocation
+ *
+ * @param component
+ * @return set of IDs that should be processed as a
+ * @since 3.3.0
+ */
+ public static Set<String> getAjaxAreasToProcess(UIComponent component) {
+ Object areas;
+
+ if (component instanceof AjaxComponent) {
+ areas = ((AjaxComponent) component).getProcess();
+ } else {
+ areas = component.getAttributes().get(AjaxRendererUtils.AJAX_PROCESS_ATTRIBUTE);
+ }
+
+ return asSet(areas);
+ }
+
+ /**
* Convert parameter ( Collection, List, array, String, comma-separated
* String ) to list of srings. TODO - when move to JDK 5, change to
* List<String>
Modified: trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java
===================================================================
--- trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java 2008-12-25 13:51:03 UTC (rev 12031)
+++ trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java 2008-12-25 16:55:44 UTC (rev 12032)
@@ -68,6 +68,15 @@
}
/* (non-Javadoc)
+ * @see org.ajax4jsf.context.AjaxContext#addAreasToProcessFromComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ @Override
+ public void addAreasToProcessFromComponent(FacesContext context, UIComponent component) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
* @see org.ajax4jsf.context.AjaxContext#addRenderedArea(java.lang.String)
*/
@Override
16 years, 2 months
JBoss Rich Faces SVN: r12031 - trunk/ui/dataTable/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-25 08:51:03 -0500 (Thu, 25 Dec 2008)
New Revision: 12031
Modified:
trunk/ui/dataTable/src/main/config/component/colgroup.xml
trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
Log:
https://jira.jboss.org/jira/browse/RF-4569
Modified: trunk/ui/dataTable/src/main/config/component/colgroup.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/colgroup.xml 2008-12-25 00:34:22 UTC (rev 12030)
+++ trunk/ui/dataTable/src/main/config/component/colgroup.xml 2008-12-25 13:51:03 UTC (rev 12031)
@@ -63,7 +63,7 @@
<property disabled="false" hidden="true">
<name>sortExpression</name>
<classname>java.lang.String</classname>
- <description>DEPRECATED(use sortBy)Attribute defines a bean property which is used for sorting of a column</description>
+ <description>Attribute defines a bean property which is used for sorting of a column</description>
</property>
<property elonly="true">
<name>filterMethod</name>
Modified: trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
===================================================================
--- trunk/ui/dataTable/src/main/config/component/columnAttributes.ent 2008-12-25 00:34:22 UTC (rev 12030)
+++ trunk/ui/dataTable/src/main/config/component/columnAttributes.ent 2008-12-25 13:51:03 UTC (rev 12031)
@@ -52,7 +52,7 @@
<property>
<name>sortExpression</name>
<classname>java.lang.String</classname>
- <description>DEPRECATED(use sortBy)Attribute defines a bean property which is used for sorting of a column</description>
+ <description>Attribute defines a bean property which is used for sorting of a column</description>
</property>
<property>
<name>sortBy</name>
16 years, 2 months
JBoss Rich Faces SVN: r12030 - trunk/ui/tree/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-24 19:34:22 -0500 (Wed, 24 Dec 2008)
New Revision: 12030
Modified:
trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-5464
Modified: trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2008-12-25 00:32:47 UTC (rev 12029)
+++ trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2008-12-25 00:34:22 UTC (rev 12030)
@@ -201,7 +201,7 @@
}
if (resource != null) {
- variables.setVariable("folder", resource);
+ variables.setVariable("folderIcon", resource);
}
resource = ViewUtil.getResourceURL(treeNode.getIconCollapsed());
@@ -228,7 +228,7 @@
}
if (resource != null) {
- variables.setVariable("leaf", resource);
+ variables.setVariable("leafIcon", resource);
}
}
16 years, 2 months
JBoss Rich Faces SVN: r12029 - trunk/ui/tree/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-24 19:32:47 -0500 (Wed, 24 Dec 2008)
New Revision: 12029
Modified:
trunk/ui/tree/src/main/templates/htmlTreeNode.jspx
Log:
https://jira.jboss.org/jira/browse/RF-5464
Modified: trunk/ui/tree/src/main/templates/htmlTreeNode.jspx
===================================================================
--- trunk/ui/tree/src/main/templates/htmlTreeNode.jspx 2008-12-25 00:04:10 UTC (rev 12028)
+++ trunk/ui/tree/src/main/templates/htmlTreeNode.jspx 2008-12-25 00:32:47 UTC (rev 12029)
@@ -23,18 +23,20 @@
var="expanded" />
<f:resource
name="images/iconFolder.gif"
- var="folder" />
+ var="folderIcon" />
<f:resource
name="images/iconLeaf.gif"
- var="leaf" />
+ var="leafIcon" />
<f:call name="initializeLines" />
<f:call name="initializeResources" />
+ <c:object var="leaf" type="boolean" value="#{component.UITree.leaf}" />
+
<table border="0" cellpadding="0" cellspacing="0" id="#{clientId}" class="dr-tree-full-width rich-tree-node">
<tbody>
- <tr id="#{clientId}:mainRow" onclick="#{component.attributes['onclick']} #{this:getToggleScript(context, component, 'mainRow')}" >
+ <tr id="#{clientId}:mainRow" onclick="#{component.attributes['onclick']} #{!leaf ? this:getToggleScript(context, component, 'mainRow') : ''}" >
<f:call name="encodeAttributeParameters" />
<f:call name="utils.encodePassThruWithExclusions">
@@ -56,7 +58,6 @@
<div>
<jsp:scriptlet>
<![CDATA[
- boolean leaf = component.getUITree().isLeaf();
if (leaf) {
]]>
</jsp:scriptlet>
@@ -196,7 +197,7 @@
} else {
]]>
</jsp:scriptlet>
- <img src="#{leaf}" alt="" class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
+ <img src="#{leafIcon}" alt="" class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
<jsp:scriptlet>
<![CDATA[
}
@@ -221,7 +222,7 @@
} else {
]]>
</jsp:scriptlet>
- <img src="#{folder}" alt="" class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
+ <img src="#{folderIcon}" alt="" class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
<jsp:scriptlet>
<![CDATA[
}
16 years, 2 months
JBoss Rich Faces SVN: r12028 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-24 19:04:10 -0500 (Wed, 24 Dec 2008)
New Revision: 12028
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js
Log:
comment fixed
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js 2008-12-24 20:29:22 UTC (rev 12027)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js 2008-12-25 00:04:10 UTC (rev 12028)
@@ -102,7 +102,7 @@
}
return val;
}
-//TODO: jsDoc this Satanism
+//TODO: jsDoc this code
Richfaces.borders = {l: 'border-left-width', r: 'border-right-width', t: 'border-top-width', b: 'border-bottom-width'},
Richfaces.paddings = {l: 'padding-left', r: 'padding-right', t: 'padding-top', b: 'padding-bottom'},
Richfaces.margins = {l: 'margin-left', r: 'margin-right', t: 'margin-top', b: 'margin-bottom'}
\ No newline at end of file
16 years, 2 months
JBoss Rich Faces SVN: r12027 - in trunk/ui/tree/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-24 15:29:22 -0500 (Wed, 24 Dec 2008)
New Revision: 12027
Modified:
trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
trunk/ui/tree/src/main/templates/htmlTree.jspx
Log:
https://jira.jboss.org/jira/browse/RF-5442
Modified: trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2008-12-24 18:53:06 UTC (rev 12026)
+++ trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2008-12-24 20:29:22 UTC (rev 12027)
@@ -570,15 +570,6 @@
return buffer.toString();
}
- protected String getScriptContributions(FacesContext context, UITree tree) {
- return super.getScriptContributions(getJavaScriptVarName(context, tree), context, tree);
- }
-
- protected String getJavaScriptVarName(FacesContext context, UITree tree) {
- String id = tree.getBaseClientId(context);
- return "Richfaces_Tree_" + id.replaceAll("[^A-Za-z0-9_]", "_");
- }
-
private void writeScript(FacesContext context, UITree tree, List encodedAreaIds,
Set renderedAreas) throws IOException {
final ResponseWriter writer = context.getResponseWriter();
@@ -590,20 +581,16 @@
writer.startElement("script", tree);
getUtils().writeAttribute(writer, "type", "text/javascript");
- String varName = getJavaScriptVarName(context, tree);
-
- writer.writeText(varName + ".getNodeElements(" +
- ScriptUtils.toScript(encodedAreaIds) + ");", null);
+ StringBuffer sb = new StringBuffer("$(");
+ sb.append(ScriptUtils.toScript(clientId));
+ sb.append(").component.");
- writer.writeText(varName + ".updateSelection(" +
- ScriptUtils.toScript(getSelectionValue(context, tree)) + ");", null);
+ new JSFunction("refreshAfterAjax", encodedAreaIds, getSelectionValue(context, tree)).appendScript(sb);
+ writer.writeText(sb, null);
writer.endElement("script");
writer.endElement("div");
- renderedAreas.add(tree.getClientId(context)
- + NamingContainer.SEPARATOR_CHAR + "input");
-
renderedAreas.add(scriptId);
}
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
--- trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2008-12-24 18:53:06 UTC (rev 12026)
+++ trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2008-12-24 20:29:22 UTC (rev 12027)
@@ -183,6 +183,11 @@
*/
}
},
+
+ refreshAfterAjax: function(nodeIds, selectedNode) {
+ this.getNodeElements(nodeIds);
+ this.updateSelection(selectedNode);
+ },
getNodeElements: function(nodeIds) {
if (nodeIds) {
Modified: trunk/ui/tree/src/main/templates/htmlTree.jspx
===================================================================
--- trunk/ui/tree/src/main/templates/htmlTree.jspx 2008-12-24 18:53:06 UTC (rev 12026)
+++ trunk/ui/tree/src/main/templates/htmlTree.jspx 2008-12-24 20:29:22 UTC (rev 12027)
@@ -49,20 +49,20 @@
<f:call name="encodeSelectionStateInput" />
<f:clientId var="clientId" />
- <script type="text/javascript">
- var #{this:getJavaScriptVarName(context, component)} =
- new Tree("#{clientId}", "#{clientId}:input", "#{component.switchType}",
- {
- onselect: "#{component.attributes['onselected']}",
- onexpand: "#{component.attributes['onexpand']}",
- oncollapse: "#{component.attributes['oncollapse']}"
- },
- function(event) {
- #{this:getAjaxScript(context, component)}
- },
- #{this:getOptions(context, component)}
- );
- #{this:getScriptContributions(context, component)}
+ <script type="text/javascript">(function() {
+ var tree = new Tree("#{clientId}", "#{clientId}:input", "#{component.switchType}",
+ {
+ onselect: "#{component.attributes['onselected']}",
+ onexpand: "#{component.attributes['onexpand']}",
+ oncollapse: "#{component.attributes['oncollapse']}"
+ },
+ function(event) {
+ #{this:getAjaxScript(context, component)}
+ },
+ #{this:getOptions(context, component)}
+ );
+ #{this:getScriptContributions("tree", context, component)}
+ }());
</script>
<div id="#{clientId}:script" class="dr-tree-h-script">
<script type="text/javascript">
16 years, 2 months
JBoss Rich Faces SVN: r12026 - trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-24 13:53:06 -0500 (Wed, 24 Dec 2008)
New Revision: 12026
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
Log:
https://jira.jboss.org/jira/browse/RF-4595
Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-12-24 18:53:02 UTC (rev 12025)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-12-24 18:53:06 UTC (rev 12026)
@@ -458,4 +458,32 @@
}
}
}
+};
+
+Richfaces.invokeEvent = function(eventFunc, element, eventName, memo) {
+ var result;
+ if (eventFunc) {
+ element = $(element);
+ if (element == document && document.createEvent && !element.dispatchEvent)
+ element = document.documentElement;
+
+ var event;
+ if (document.createEvent) {
+ event = document.createEvent("HTMLEvents");
+ event.initEvent("dataavailable", true, true);
+ } else {
+ event = document.createEventObject();
+ event.eventType = "ondataavailable";
+ }
+
+ event.eventName = eventName;
+ event.rich = {component:this};
+ event.memo = memo || { };
+ try {
+ result = eventFunc.call(element,event);
+ }
+ catch (e) { LOG.warn("Exception: "+e.Message + "\n[on"+eventName + "]"); }
+ }
+ if (result!=false) result = true;
+ return result;
};
\ No newline at end of file
16 years, 2 months
JBoss Rich Faces SVN: r12025 - trunk/samples/listShuttleDemo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-24 13:53:02 -0500 (Wed, 24 Dec 2008)
New Revision: 12025
Modified:
trunk/samples/listShuttleDemo/src/main/webapp/pages/index.jsp
Log:
https://jira.jboss.org/jira/browse/RF-4595
Modified: trunk/samples/listShuttleDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/listShuttleDemo/src/main/webapp/pages/index.jsp 2008-12-24 18:52:59 UTC (rev 12024)
+++ trunk/samples/listShuttleDemo/src/main/webapp/pages/index.jsp 2008-12-24 18:53:02 UTC (rev 12025)
@@ -49,6 +49,8 @@
fastMoveControlsVisible="#{listShuttleDemoBean.fastMoveControlsVisible}"
converter="#{converter}"
onorderchanged="orderChanged(event)"
+ onorderchange="return false;"
+ onlistchange="return false;"
sourceSelection="#{listShuttleDemoBean.sourceSelection}"
targetSelection="#{listShuttleDemoBean.targetSelection}"
16 years, 2 months
JBoss Rich Faces SVN: r12024 - in trunk/ui/inplaceInput/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-24 13:52:59 -0500 (Wed, 24 Dec 2008)
New Revision: 12024
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4595
Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-12-24 18:52:54 UTC (rev 12023)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-12-24 18:52:59 UTC (rev 12024)
@@ -121,7 +121,7 @@
},
edit: function (){
- if (this.invokeEvent(this.events.oneditactivation, this.inplaceInput, "rich:oneditactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
+ if (Richfaces.invokeEvent(this.events.oneditactivation, this.inplaceInput, "rich:oneditactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
this.startEditableState();
if (this.events.oneditactivated) {
this.inplaceInput.fire("rich:oneditactivated", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value});
@@ -275,7 +275,7 @@
},
cancel : function(e, value) {
- if (this.invokeEvent(this.events.onviewactivation, this.inplaceInput, "rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
+ if (Richfaces.invokeEvent(this.events.onviewactivation, this.inplaceInput, "rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
this.endEditableState();
if (!value) {
value = this.valueKeeper.value;
@@ -301,7 +301,7 @@
},
save : function(e) {
- if (this.invokeEvent(this.events.onviewactivation, this.inplaceInput, "rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
+ if (Richfaces.invokeEvent(this.events.onviewactivation, this.inplaceInput, "rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
var userValue = this.tempValueKeeper.value;
this.setValue(userValue);
if (this.events.onviewactivated) {
@@ -338,7 +338,7 @@
this.startChangedState();
if (value != userValue) {
this.tempValueKeeper.value = userValue;
- this.invokeEvent(this.events.onchange, this.inplaceInput, "onchange", userValue);
+ Richfaces.invokeEvent(this.events.onchange, this.inplaceInput, "onchange", userValue);
}
} else {
@@ -350,36 +350,6 @@
return this.valueKeeper.value;
},
- //TODO: remove Bucks
- //TODO: to shared library
- invokeEvent : function(eventFunc, element, eventName, memo) {
- var result;
- if (eventFunc) {
- element = $(element);
- if (element == document && document.createEvent && !element.dispatchEvent)
- element = document.documentElement;
-
- var event;
- if (document.createEvent) {
- event = document.createEvent("HTMLEvents");
- event.initEvent("dataavailable", true, true);
- } else {
- event = document.createEventObject();
- event.eventType = "ondataavailable";
- }
-
- event.eventName = eventName;
- event.rich = {component:this};
- event.memo = memo || { };
- try {
- result = eventFunc.call(element,event);
- }
- catch (e) { LOG.warn("Exception: "+e.Message + "\n[on"+eventName + "]"); }
- }
- if (result!=false) result = true;
- return result;
- },
-
setDefaultText : function() {
this.currentText = this.attributes.defaultLabel;
},
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-12-24 18:52:54 UTC (rev 12023)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-12-24 18:52:59 UTC (rev 12024)
@@ -15,9 +15,9 @@
<h:scripts>
new org.ajax4jsf.javascript.PrototypeScript(),
scripts/comboboxUtils.js,
+ scripts/utils.js,
scripts/inplaceinput.js,
- scripts/inplaceinputstyles.js,
- scripts/utils.js
+ scripts/inplaceinputstyles.js
</h:scripts>
<f:resource var="saveIcon" name="org.richfaces.renderkit.html.images.SaveControlIcon"/>
<f:resource var="cancelIcon" name="org.richfaces.renderkit.html.images.CancelControlIcon"/>
16 years, 2 months