Hi,
After upgrading to Teamsite 6.7 SP1 we found a weird issue with VF and the onItemChange Event of FormAPI. Values change by the VF editor does not stay if there is an onItemChange event attached to the same field(Even thought the event does not change the value of the field/item at all). Also the onItemChange event will fire multiple times even though the value of the field/item has been been changed at all (The field is still actively editing with VF).
- I was able to reproduce the issue in a different server.
Here is the setup we have:
-We have two fields: one calls ".../long" and other calls ".../short" in a DCT.
-Both attach to custom VisualFormat Editors (dynamically loaded).
-The Visual format editor has a custom function that will change the hightlighted text with an custom text. (etc...change Staples to Staples@).
-An custom onItemChange event to copy the content in the "long" field to the "short" field.
eWebEditProExecCommandHandlers["jsbrand"] = function(sEditorName, strCmdName, strTextData, lData)
{
var strTextData = eWebEditPro[sEditorName].getSelectedText();
var array = top.getScriptFrame().getBrand() ;
var value = ic_getValueFromArray( array , strTextData ) ;
if( value != null )
{
eWebEditPro.instances[sEditorName].asyncCallMethod("pasteHTML", [ value ] , null, new Function());
}
return;
}
IWEventRegistry.addItemHandler( "/bullets/long" , "onItemChange" , copyLongToShort ) ;
function copyLongToShort( item )
{
alert("The value is: " + item.getValue());
var itemName = item.getName() ;
var len = checkLength( item , 150 ) ;
var itemShortName = itemName.substring( 0 , itemName.length - "long".length ) + "short" ;
var itemShort = IWDatacapture.getItem( itemShortName ) ;
if(! item.isRequired() )
{
itemShort.setRequired( !item.isRequired() && ( len > 0 ) ) ;
checkShortLength( itemShort ) ;
}
if( len <= 30 )
{
itemShort.setValue( item.getValue() ) ;
checkShortLength( itemShort ) ;
}
if( len <= 18 )
{
var itemPOSName = itemName.substring( 0 , itemName.length - "long".length ) + "pos" ;
var itemPOS = IWDatacapture.getItem( itemPOSName ) ;
if( itemPOS != null )
{
itemPOS.setValue( item.getValue() ) ;
checkPOSLength( itemPOS ) ;
}
}
}
Environment:
Teamsite 6.7 SP1
Windows 2000 SP4
Client :Windows XP pro SP2.
Have any of you experience this problem before?