Author: abelevich
Date: 2010-10-19 05:36:02 -0400 (Tue, 19 Oct 2010)
New Revision: 19601
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectHelper.java
trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml
Log:
fix events rendering
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2010-10-18
23:49:42 UTC (rev 19600)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2010-10-19
09:36:02 UTC (rev 19601)
@@ -130,7 +130,7 @@
@Attribute(events=@EventName("inputkeypress"))
public abstract String getOninputkeypress();
- @Attribute(events=@EventName("oninputkeyup"))
+ @Attribute(events=@EventName("inputkeyup"))
public abstract String getOninputkeypup();
@Attribute(events=@EventName("inputfocus"))
@@ -139,11 +139,11 @@
@Attribute(events=@EventName("inputblur"))
public abstract String getOninputblur();
- @Attribute(events=@EventName("select"))
- public abstract String getOnselect();
+ @Attribute(events=@EventName("inputselect"))
+ public abstract String getOninputselect();
- @Attribute(events=@EventName("change"))
- public abstract String getOnchange();
+ @Attribute(events=@EventName("inputchange"))
+ public abstract String getOninputchange();
//TODO: what is default event?, add onViewActivated, onEditActivated events support
}
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-10-18
23:49:42 UTC (rev 19600)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-10-19
09:36:02 UTC (rev 19601)
@@ -23,6 +23,7 @@
package org.richfaces.component;
import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.Tag;
@@ -45,7 +46,7 @@
public static final String COMPONENT_TYPE = "org.richfaces.InplaceSelect";
public static final String COMPONENT_FAMILY = "org.richfaces.Select";
-
+
@Attribute(defaultValue="InplaceState.ready")
public abstract InplaceState getState();
@@ -73,4 +74,40 @@
@Attribute(defaultValue="rf-is-lst-cord")
public abstract String getListCss();
+ @Attribute(events=@EventName("inputclick"))
+ public abstract String getOninputclick();
+
+ @Attribute(events=@EventName("inputdblclick"))
+ public abstract String getOninputdblclick();
+
+ @Attribute(events=@EventName("inputmousedown"))
+ public abstract String getOninputmousedown();
+
+ @Attribute(events=@EventName("inputmousemove"))
+ public abstract String getOninputmousemove();
+
+ @Attribute(events=@EventName("inputmouseout"))
+ public abstract String getOninputmouseout();
+
+ @Attribute(events=@EventName("inputmouseover"))
+ public abstract String getOninputmouseover();
+
+ @Attribute(events=@EventName("inputmouseup"))
+ public abstract String getOninputmouseup();
+
+ @Attribute(events=@EventName("inputkeydown"))
+ public abstract String getOninputkeydown();
+
+ @Attribute(events=@EventName("inputkeypress"))
+ public abstract String getOninputkeypress();
+
+ @Attribute(events=@EventName("inputkeyup"))
+ public abstract String getOninputkeypup();
+
+ @Attribute(events=@EventName("inputfocus"))
+ public abstract String getOninputfocus();
+
+ @Attribute(events=@EventName("inputblur"))
+ public abstract String getOninputblur();
+
}
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java 2010-10-18
23:49:42 UTC (rev 19600)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelect.java 2010-10-19
09:36:02 UTC (rev 19601)
@@ -66,7 +66,7 @@
@Attribute(events=@EventName("click"))
public abstract String getOnclick();
- @Attribute(events=@EventName("ondblclick"))
+ @Attribute(events=@EventName("dblclick"))
public abstract String getOndblclick();
@Attribute(events=@EventName("focus"))
@@ -96,11 +96,42 @@
@Attribute(events=@EventName("mouseup"))
public abstract String getOnmouseup();
+ @Attribute(events=@EventName("listclick"))
+ public abstract String getOnlistclick();
+
+ @Attribute(events=@EventName("listdblclick"))
+ public abstract String getOnlistdblclick();
+
+ @Attribute(events=@EventName("listmousedown"))
+ public abstract String getOnlistmousedown();
+
+ @Attribute(events=@EventName("listmouseup"))
+ public abstract String getOnlistmouseup();
+
+ @Attribute(events=@EventName("listmouseover"))
+ public abstract String getOnlistmouseover();
+
+ @Attribute(events=@EventName("listmousemove"))
+ public abstract String getOnlistmousemove();
+
+ @Attribute(events=@EventName("listmouseout"))
+ public abstract String getOnlistmouseout();
+
+ @Attribute(events=@EventName("listkeypress"))
+ public abstract String getOnlistkeypress();
+
+ @Attribute(events=@EventName("listkeydown"))
+ public abstract String getOnlistkeydown();
+
+ @Attribute(events=@EventName("listkeyup"))
+ public abstract String getOnlistkeyup();
+
@Attribute(events=@EventName("select"))
public abstract String getOnselect();
@Attribute(events=@EventName("change"))
public abstract String getOnchange();
+ //TODO: add list event attributes
@Attribute(defaultValue = "rf-sel-opt")
public abstract String getItemCss();
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2010-10-18
23:49:42 UTC (rev 19600)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2010-10-19
09:36:02 UTC (rev 19601)
@@ -85,7 +85,7 @@
public static final String OPTIONS_SAVE_ON_BLUR = "saveOnBlur";
- private static final Map<String, ComponentAttribute>
INPLACEINPUT_HANDLER_ATTRIBUTES = Collections
+ protected static final Map<String, ComponentAttribute>
INPLACEINPUT_HANDLER_ATTRIBUTES = Collections
.unmodifiableMap(ComponentAttribute.createMap(
new ComponentAttribute(HtmlConstants.ONCLICK_ATTRIBUTE)
.setEventNames("inputclick")
@@ -124,13 +124,13 @@
.setEventNames("inputfocus")
.setComponentAttributeName("oninputfocus"),
new ComponentAttribute(HtmlConstants.ONCHANGE_ATTRIBUTE)
-
.setEventNames("change").setComponentAttributeName(
- "onchange"),
+
.setEventNames("inputchange").setComponentAttributeName(
+ "oninputchange"),
new ComponentAttribute(HtmlConstants.ONSELECT_ATTRIBUTE)
-
.setEventNames("select").setComponentAttributeName(
- "onselect")));
+
.setEventNames("inputselect").setComponentAttributeName(
+ "oninputselect")));
- protected void renderInputHandlers(FacesContext facesContext,
+ public void renderInputHandlers(FacesContext facesContext,
UIComponent component) throws IOException {
RenderKitUtils.renderPassThroughAttributesOptimized(facesContext,
component, INPLACEINPUT_HANDLER_ATTRIBUTES);
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java 2010-10-18
23:49:42 UTC (rev 19600)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java 2010-10-19
09:36:02 UTC (rev 19601)
@@ -23,7 +23,6 @@
package org.richfaces.renderkit;
import java.io.IOException;
-import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -59,13 +58,6 @@
public static final String OPTIONS_VISIBLE = "visible";
- private static final Map<String, ComponentAttribute>
INPLACESELECT_HANDLER_ATTRIBUTES =
Collections.unmodifiableMap(ComponentAttribute.createMap(
- new
ComponentAttribute(HtmlConstants.ONCHANGE_ATTRIBUTE).setEventNames("change").
- setComponentAttributeName("onchange"),
- new
ComponentAttribute(HtmlConstants.ONSELECT_ATTRIBUTE).setEventNames("select").
- setComponentAttributeName("onselect")
- ));
-
@Override
protected String getScriptName() {
return "new RichFaces.ui.InplaceSelect";
@@ -79,9 +71,13 @@
SelectHelper.encodeItems(facesContext, component, clientSelectItems,
HtmlConstants.SPAN_ELEM);
}
+ public void renderListHandlers(FacesContext facesContext, UIComponent component)
throws IOException {
+ RenderKitUtils.renderPassThroughAttributesOptimized(facesContext, component,
SelectHelper.SELECT_LIST_HANDLER_ATTRIBUTES);
+ }
+
@Override
- protected void renderInputHandlers(FacesContext facesContext, UIComponent component)
throws IOException {
- RenderKitUtils.renderPassThroughAttributesOptimized(facesContext, component,
INPLACESELECT_HANDLER_ATTRIBUTES);
+ public void renderInputHandlers(FacesContext facesContext, UIComponent component)
throws IOException {
+ RenderKitUtils.renderPassThroughAttributesOptimized(facesContext, component,
INPLACEINPUT_HANDLER_ATTRIBUTES);
}
public String getSelectInputLabel(FacesContext facesContext, UIComponent component)
{
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectHelper.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectHelper.java 2010-10-18
23:49:42 UTC (rev 19600)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectHelper.java 2010-10-19
09:36:02 UTC (rev 19601)
@@ -49,6 +49,7 @@
public static final String OPTIONS_LIST_ITEMS = "items";
+
public static final Map<String, ComponentAttribute>
SELECT_LIST_HANDLER_ATTRIBUTES = Collections
.unmodifiableMap(ComponentAttribute.createMap(
new ComponentAttribute(HtmlConstants.ONCLICK_ATTRIBUTE)
Modified: trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-10-18 23:49:42
UTC (rev 19600)
+++ trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-10-19 09:36:02
UTC (rev 19601)
@@ -37,8 +37,7 @@
<cdk:object type="java.util.List"
type-arguments="InplaceSelectBaseRenderer.ClientSelectItem"
name="clientSelectItems"
value="#{getConvertedSelectItems(facesContext, component)}" />
- <span id="#{clientId}" class="#{getStateStyleClass(component,
inplaceState)}"
- cdk:passThroughWithExclusions="id class">
+ <span id="#{clientId}" class="#{getStateStyleClass(component,
inplaceState)}" cdk:passThroughWithExclusions="id class">
<span id="#{clientId}Label" class="rf-is-lbl">
#{inplaceValue}
@@ -80,6 +79,7 @@
</span>
</c:if>
<span id="#{clientId}List" style="#{getListStyles(facesContext,
component)}" class="rf-is-lst-cord">
+ <cdk:call expression="renderListHandlers(facesContext,
component);"/>
<span class="rf-is-lst-pos" style="width:
#{component.attributes['listWidth']}">
<span class="rf-is-shdw">
<span class="rf-is-shdw-t"></span>