In JSF2 the JSF bridge is responsible for applying the DOM updates. There is specific code used for updating 'input' elements. To preserve focus the 'input' element attributes are updated instead of having the element replaced entirely. For this to work there is special code for handling certain attributes, 'style' attribute being one of them.
Here's the code:
//'style' attribute special case
var newStyle = source.getAttribute('style');
var oldStyle = target.getAttribute('style');
if (newStyle != oldStyle) {
if (isIE())
{
target.style.setAttribute('cssText', newStyle, 0);
}
else
{
target.setAttribute('style',newStyle);
}
}
Unfortunately the IE specific code does not work as expected. When source.getAttribute('style') is invoked the DOM element's 'style' property is returned instead of the string value. To fix the issue the code needs to be changed slightly:
//'style' attribute special case
if (isIE()) {
var newStyle = source.style.cssText;
var oldStyle = target.style.cssText;
if (newStyle != oldStyle) {
target.style.cssText = newStyle;
}
} else {
var newStyle = source.getAttribute('style');
var oldStyle = target.getAttribute('style');
if (newStyle != oldStyle) {
target.setAttribute('style',newStyle);
}
}
Please check if latest icefaces/trunk passes this test.