Author: abelevich
Date: 2008-04-11 13:15:24 -0400 (Fri, 11 Apr 2008)
New Revision: 7774
Modified:
trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2982, also add addition standart events for the
inplaceselect input
Modified: trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
===================================================================
--- trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2008-04-11 16:08:27
UTC (rev 7773)
+++ trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2008-04-11 17:15:24
UTC (rev 7774)
@@ -97,6 +97,86 @@
<defaultvalue><![CDATA["right"]]></defaultvalue>
</property>
<property>
+ <name>onchange</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; the element value was
changed</description>
+ </property>
+ <property>
+ <name>onfocus</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; the element got the
focus</description>
+ </property>
+ <property>
+ <name>onblur</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; the element lost the
focus</description>
+ </property>
+ <property>
+ <name>onselect</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; the onselect event occurs when you
select some menu item</description>
+ </property>
+ <property>
+ <name>oninputfocus</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; the element got the
focus</description>
+ </property>
+ <property>
+ <name>oninputblur</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; the element lost the
focus</description>
+ </property>
+ <property>
+ <name>oninputclick</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer button is
clicked</description>
+ </property>
+ <property>
+ <name>oninputdblclick</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer button is
double-clicked</description>
+ </property>
+ <property>
+ <name>oninputkeydown</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a key is pressed
down</description>
+ </property>
+ <property>
+ <name>oninputkeypress</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a key is pressed and
released</description>
+ </property>
+ <property>
+ <name>oninputkeyup</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a key is
released</description>
+ </property>
+ <property>
+ <name>oninputmousedown</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; a pointer button is pressed
down</description>
+ </property>
+ <property>
+ <name>oninputmousemove</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved
within</description>
+ </property>
+ <property>
+ <name>oninputmouseout</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved
away</description>
+ </property>
+ <property>
+ <name>oninputmouseover</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved
onto</description>
+ </property>
+ <property>
+ <name>oninputmouseup</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; a pointer button is
released</description>
+ </property>
+ <property>
<name>oneditactivation</name>
<classname>java.lang.String</classname>
<description>The attributes provide a possibility to assign JavaScript on
edit state activation</description>
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
---
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-04-11
16:08:27 UTC (rev 7773)
+++
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-04-11
17:15:24 UTC (rev 7774)
@@ -170,12 +170,13 @@
save : function($super) {
this.applyTmpValue();
- if (((this.attributes.closeOnSelect && !this.attributes.showControls)
&& this.comboList.isList)
+ if (((this.attributes.closeOnSelect && !this.attributes.showControls)
&& this.comboList.isList)
|| (this.clickOnBar || !this.comboList.isList)) {
//bug :
http://jira.jboss.com/jira/browse/RF-2810,
//will be corrected in a future version (
http://jira.jboss.com/jira/browse/RF-2814)
- var unescapeText = this.tempValueKeeper.value.unescapeHTML();
- this.saveValue(this.currentItemValue, unescapeText);
+ this.invokeEvent(this.events.onchange, this.inplaceSelect, "onchange",
{itemValue : this.currentItemValue, itemText : this.tempValueKeeper.value});
+ var unescapeText = this.tempValueKeeper.value.unescapeHTML();
+ this.saveValue(this.currentItemValue, unescapeText);
}
this.comboList.hide();
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-04-11 16:08:27 UTC
(rev 7773)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-04-11 17:15:24 UTC
(rev 7774)
@@ -94,9 +94,26 @@
autocomplete="off"
maxlength='#{component.attributes["inputMaxLength"]}'
readonly="readonly"
- class="rich-inplace-select-field"/>
+ class="rich-inplace-select-field"
+ onselect='#{component.attributes["onselect"]}'
+ onblur='#{component.attributes["oninputblur"]}'
+ onfocus='#{component.attributes["oninputfocus"]}'
+ onclick='#{component.attributes["oninputclick"]}'
+ ondblclick='#{component.attributes["oninputdblclick"]}'
+ onkeydown='#{component.attributes["oninputkeydown"]}'
+ onkeypress='#{component.attributes["oninputkeypress"]}'
+ onkeyup='#{component.attributes["oninputkeyup"]}'
+ onmousedown='#{component.attributes["oninputmousedown"]}'
+ onmousemove='#{component.attributes["oninputmousemove"]}'
+ onmouseout='#{component.attributes["oninputmouseout"]}'
+ onmouseover='#{component.attributes["oninputmouseover"]}'
+ onmouseup='#{component.attributes["oninputmouseup"]}'
+
+ />
<input id="#{clientId}inselArrow" readonly="readonly"
type="Text" value="" class="rich-inplace-select-arrow"
style='display:none;'/>
- <input id='#{clientId}inplaceValue' name='#{clientId'
type='hidden' value='#{fieldValue}'/>
+ <input id='#{clientId}inplaceValue' name='#{clientId'
type='hidden' value='#{fieldValue}'
+ onchange='#{component.attributes["onchange"]}'>
+ </input>
<div id="#{clientId}bar" class="rich-inplace-select-control-set"
style="display:none;">
<jsp:scriptlet>
<![CDATA[
@@ -134,7 +151,7 @@
onmouseover="this.className='rich-inplace-select-control
#{controlHoverClass}'"/>
<input id="#{clientId}cancel" type="image"
src="#{cancelIcon}"
class="rich-inplace-select-control #{controlClass}"
- onmousedown="this.className='rich-inplace-select-control-press
#{controlPressedClass}''"
+ onmousedown="this.className='rich-inplace-select-control-press
#{controlPressedClass}'"
onmouseout="this.className='rich-inplace-select-control
#{controlClass}'"
onmouseup="this.className='rich-inplace-select-control#{controlClass}'"
onmouseover="this.className='rich-inplace-select-control
#{controlHoverClass}'"
@@ -211,7 +228,8 @@
{oneditactivation : #{this:getAsEventHandler(context, component,
"oneditactivation")},
onviewactivation : #{this:getAsEventHandler(context, component,
"onviewactivation")},
oneditactivated : #{this:getAsEventHandler(context, component,
"oneditactivated")},
- onviewactivated : #{this:getAsEventHandler(context, component,
"onviewactivated")}},
+ onviewactivated : #{this:getAsEventHandler(context, component,
"onviewactivated")},
+ onchange : #{this:getAsEventHandler(context, component,
"onchange")}},
Richfaces.InplaceSelect.CLASSES,
['#{clientId}bar', '#{clientId}ok',
'#{clientId}cancel', '#{clientId}buttons',
'#{clientId}btns_shadow'], '#{clientId}inselArrow');
</script>