Author: pyaschenko
Date: 2011-03-12 05:02:45 -0500 (Sat, 12 Mar 2011)
New Revision: 22177
Modified:
branches/4.0.X/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
branches/4.0.X/ui/input/ui/src/main/templates/inplaceInput.template.xml
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTestDefault.xmlunit.xml
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTestEdit.xmlunit.xml
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTestWithControls.xmlunit.xml
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml
Log:
https://jira.jboss.org/browse/RF-10690
Reviewed by Nick Belaevski
Modified:
branches/4.0.X/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
---
branches/4.0.X/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2011-03-11
19:31:01 UTC (rev 22176)
+++
branches/4.0.X/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2011-03-12
10:02:45 UTC (rev 22177)
@@ -14,12 +14,15 @@
this.showControls = mergedOptions.showControls;
this.getInput().bind("focus", $.proxy(this.__editHandler, this));
if(this.showControls) {
+ var btnContainer = document.getElementById(id+"Btn");
+ if (btnContainer) {
+ btnContainer.tabIndex=-1;
+ }
this.okbtn = $(document.getElementById(id+"Okbtn"));
this.cancelbtn = $(document.getElementById(id+"Cancelbtn"));
this.okbtn.bind("mousedown", $.proxy(this.__saveBtnHandler,
this));
this.cancelbtn.bind("mousedown", $.proxy(this.__cancelBtnHandler,
this));
}
- this.focusElement = $(document.getElementById(id+"Focus"));
};
rf.ui.InplaceBase.extend(rf.ui.InplaceInput);
@@ -51,6 +54,7 @@
},
__keydownHandler: function(e) {
+ this.tabBlur = false;
switch(e.keyCode || e.which) {
case rf.KEYS.ESC:
e.preventDefault();
@@ -62,6 +66,9 @@
this.save();
this.onblur(e);
break;
+ case rf.KEYS.TAB:
+ this.tabBlur = true;
+ break;
}
},
@@ -117,7 +124,11 @@
},
onhide: function() {
- this.focusElement.focus();
+ if (this.tabBlur) {
+ this.tabBlur = false;
+ }else {
+ this.getInput().focus();
+ }
},
onfocus: function(e) {
@@ -128,7 +139,7 @@
}
},
- onblur: function(e) {
+ onblur: function(e) {
if(this.__isFocused()) {
this.__setFocused(false);
this.invokeEvent.call(this, "blur", document.getElementById(this.id),
e);
Modified: branches/4.0.X/ui/input/ui/src/main/templates/inplaceInput.template.xml
===================================================================
--- branches/4.0.X/ui/input/ui/src/main/templates/inplaceInput.template.xml 2011-03-11
19:31:01 UTC (rev 22176)
+++ branches/4.0.X/ui/input/ui/src/main/templates/inplaceInput.template.xml 2011-03-12
10:02:45 UTC (rev 22177)
@@ -50,9 +50,9 @@
</span>
<c:if test="#{!component.attributes['disabled']}">
- <input id="#{clientId}Focus" type="image"
style="position: absolute; top: 0px; left: 0px; outline-style: none;"
class="rf-ii-none"/>
+ <input id="#{clientId}Focus" type="image"
tabindex="-1" style="position: absolute; top: 0px; left: 0px;
outline-style: none;" class="rf-ii-none"/>
<span id="#{clientId}Edit" class="#{getEditStyleClass(component,
inplaceState)}">
- <input id="#{clientId}Input" autocomplete="off"
name="#{clientId}"
+ <input id="#{clientId}Input" autocomplete="off"
name="#{clientId}"
type="text" value="#{getInputValue(facesContext,
component)}" class="rf-ii-fld" style="width:
#{getInputWidth(component)};" cdk:passThrough="tabindex">
<cdk:call expression="renderInputHandlers(facesContext,
component);"/>
</input>
@@ -70,12 +70,14 @@
id="#{clientId}Okbtn"
src="#{getResourcePath(facesContext, 'org.richfaces',
'ico_ok.gif')}"
class="rf-ii-btn"
onmousedown="this.className='rf-ii-btn-p'"
- onmouseout="this.className='rf-ii-btn'"
onmouseup="this.className='rf-ii-btn'" />
+ onmouseout="this.className='rf-ii-btn'"
onmouseup="this.className='rf-ii-btn'"
+ tabindex="-1" />
<input type="image"
id="#{clientId}Cancelbtn"
src="#{getResourcePath(facesContext,'org.richfaces',
'ico_cancel.gif')}"
class="rf-ii-btn"
onmousedown="this.className='rf-ii-btn-press'"
- onmouseout="this.className='rf-ii-btn'"
onmouseup="this.className='rf-ii-btn'" />
+ onmouseout="this.className='rf-ii-btn'"
onmouseup="this.className='rf-ii-btn'"
+ tabindex="-1" />
<br />
</span>
</span>
Modified:
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTestDefault.xmlunit.xml
===================================================================
---
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTestDefault.xmlunit.xml 2011-03-11
19:31:01 UTC (rev 22176)
+++
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTestDefault.xmlunit.xml 2011-03-12
10:02:45 UTC (rev 22177)
@@ -2,7 +2,7 @@
<span class="rf-ii-lbl rf-ii-dflt-lbl"
id="form:inplaceInputDefaultLabel">Edit Text</span>
<input class="rf-ii-none" id="form:inplaceInputDefaultFocus"
style="position: absolute; top: 0px; left: 0px; outline-style: none;"
- type="image" />
+ type="image" tabindex="-1" />
<span class="rf-ii-fld-cntr rf-ii-none"
id="form:inplaceInputDefaultEdit">
<input autocomplete="off" class="rf-ii-fld"
id="form:inplaceInputDefaultInput"
name="form:inplaceInputDefault" style="width: 100%;"
type="text" />
Modified:
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTestEdit.xmlunit.xml
===================================================================
---
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTestEdit.xmlunit.xml 2011-03-11
19:31:01 UTC (rev 22176)
+++
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTestEdit.xmlunit.xml 2011-03-12
10:02:45 UTC (rev 22177)
@@ -2,7 +2,7 @@
<span class="rf-ii-lbl rf-ii-dflt-lbl"
id="form:inplaceInputEditLabel">Edit Text</span>
<input class="rf-ii-none" id="form:inplaceInputEditFocus"
style="position: absolute; top: 0px; left: 0px; outline-style: none;"
- type="image" />
+ type="image" tabindex="-1" />
<span class="rf-ii-fld-cntr" id="form:inplaceInputEditEdit">
<input autocomplete="off" class="rf-ii-fld"
id="form:inplaceInputEditInput"
name="form:inplaceInputEdit" style="width: 100%;"
type="text" />
@@ -13,17 +13,19 @@
<span class="rf-ii-btn-shdw-l"></span>
<span class="rf-ii-btn-shdw-r"></span>
<span class="rf-ii-btn-shdw-b"></span>
- <span id="form:inplaceInputEditBtn" style="position :
relative">
+ <span id="form:inplaceInputEditBtn" style="position :
relative" tabindex="-1">
<input class="rf-ii-btn" id="form:inplaceInputEditOkbtn"
onmousedown="this.className='rf-ii-btn-p'"
onmouseout="this.className='rf-ii-btn'"
onmouseup="this.className='rf-ii-btn'"
src="/javax.faces.resource/ico_ok.gif.jsf?ln=org.richfaces"
- type="image" />
+ type="image"
+ tabindex="-1" />
<input class="rf-ii-btn"
id="form:inplaceInputEditCancelbtn"
onmousedown="this.className='rf-ii-btn-press'"
onmouseout="this.className='rf-ii-btn'"
onmouseup="this.className='rf-ii-btn'"
src="/javax.faces.resource/ico_cancel.gif.jsf?ln=org.richfaces"
- type="image" />
+ type="image"
+ tabindex="-1" />
<br />
</span>
</span>
Modified:
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTestWithControls.xmlunit.xml
===================================================================
---
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTestWithControls.xmlunit.xml 2011-03-11
19:31:01 UTC (rev 22176)
+++
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTestWithControls.xmlunit.xml 2011-03-12
10:02:45 UTC (rev 22177)
@@ -2,7 +2,7 @@
<span class="rf-ii-lbl rf-ii-dflt-lbl"
id="form:inplaceInputWithControlsLabel">Edit Text</span>
<input class="rf-ii-none"
id="form:inplaceInputWithControlsFocus"
style="position: absolute; top: 0px; left: 0px; outline-style: none;"
- type="image" />
+ type="image" tabindex="-1" />
<span class="rf-ii-fld-cntr rf-ii-none"
id="form:inplaceInputWithControlsEdit">
<input autocomplete="off" class="rf-ii-fld"
id="form:inplaceInputWithControlsInput"
name="form:inplaceInputWithControls"
@@ -14,17 +14,19 @@
<span class="rf-ii-btn-shdw-l"></span>
<span class="rf-ii-btn-shdw-r"></span>
<span class="rf-ii-btn-shdw-b"></span>
- <span id="form:inplaceInputWithControlsBtn" style="position :
relative">
+ <span id="form:inplaceInputWithControlsBtn" style="position :
relative" tabindex="-1">
<input class="rf-ii-btn"
id="form:inplaceInputWithControlsOkbtn"
onmousedown="this.className='rf-ii-btn-p'"
onmouseout="this.className='rf-ii-btn'"
onmouseup="this.className='rf-ii-btn'"
src="/javax.faces.resource/ico_ok.gif.jsf?ln=org.richfaces"
- type="image" />
+ type="image"
+ tabindex="-1" />
<input class="rf-ii-btn"
id="form:inplaceInputWithControlsCancelbtn"
onmousedown="this.className='rf-ii-btn-press'"
onmouseout="this.className='rf-ii-btn'"
onmouseup="this.className='rf-ii-btn'"
src="/javax.faces.resource/ico_cancel.gif.jsf?ln=org.richfaces"
- type="image" />
+ type="image"
+ tabindex="-1" />
<br />
</span>
</span>
Modified:
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml
===================================================================
---
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml 2011-03-11
19:31:01 UTC (rev 22176)
+++
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestEdit.xmlunit.xml 2011-03-12
10:02:45 UTC (rev 22177)
@@ -11,7 +11,7 @@
<span class="rf-is-shdw-l"></span>
<span class="rf-is-shdw-r"></span>
<span class="rf-is-shdw-b"></span>
- <span id="form:inplaceSelectEditBtn" style="position :
relative;">
+ <span id="form:inplaceSelectEditBtn" style="position :
relative;" tabindex="-1">
<input class="rf-is-btn" id="form:inplaceSelectEditOkbtn"
onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
onmouseup="this.className='rf-is-btn'"
src="/javax.faces.resource/ico_ok.gif.jsf?ln=org.richfaces"
type="image" />
<input class="rf-is-btn"
id="form:inplaceSelectEditCancelbtn"
onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
onmouseup="this.className='rf-is-btn'"
src="/javax.faces.resource/ico_cancel.gif.jsf?ln=org.richfaces"
type="image" />
<br />
Modified:
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml
===================================================================
---
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml 2011-03-11
19:31:01 UTC (rev 22176)
+++
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceSelectTestWithControls.xmlunit.xml 2011-03-12
10:02:45 UTC (rev 22177)
@@ -11,7 +11,7 @@
<span class="rf-is-shdw-l"></span>
<span class="rf-is-shdw-r"></span>
<span class="rf-is-shdw-b"></span>
- <span id="form:inplaceSelectWithControlsBtn" style="position :
relative;">
+ <span id="form:inplaceSelectWithControlsBtn" style="position :
relative;" tabindex="-1">
<input class="rf-is-btn"
id="form:inplaceSelectWithControlsOkbtn"
onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
onmouseup="this.className='rf-is-btn'"
src="/javax.faces.resource/ico_ok.gif.jsf?ln=org.richfaces"
type="image" />
<input class="rf-is-btn"
id="form:inplaceSelectWithControlsCancelbtn"
onmousedown="this.className='rf-is-btn-press'"
onmouseout="this.className='rf-is-btn'"
onmouseup="this.className='rf-is-btn'"
src="/javax.faces.resource/ico_cancel.gif.jsf?ln=org.richfaces"
type="image" />
<br />