Pretius / Pretius-APEX-Enhanced-Lov-Item

Oracle APEX plugin
MIT License
24 stars 11 forks source link

IG - incorrect behavior (problems) #65

Open kdima71 opened 3 years ago

kdima71 commented 3 years ago

Good day!

I have Pretius APEX Enhanced LOV item v.1.1.1

The js code for the Public method «reinit» (enhancedLovItem.js) needs to be modified, otherwise problems will occur when the plugin is running in an interactive grid.

The condition below is incorrect:

if ( pValue.length == 1 && pValue[0].length == 0 ) {
    //empty value
   apex.debug.message(this.C_LOG_WARNING, this.logPrefix, 'reinit', 'Value is not set');
   this._elementSetValue( "" );
   return void(0);
}

At least this condition should be as follows:

if (pValue.length == 0 || (pValue.length == 1 && pValue[0].length == 0) ) { //empty value apex.debug.message(this.C_LOG_WARNING, this.logPrefix, 'reinit', 'Value is not set'); this._elementSetValue( "" ); return void(0); }

In addition, at the end of the method, I commented out the call to the method «this._elementSetValue (pValue)», which I consider superfluous here, since the next call follows «this._promptApplyValues (false)», inside which a similar call is made:

if ( notEmpty ) {
//  this._elementSetValue( pValue );
  this._promptApplyValues( false );
  this._promptRenderTags();
}

I hope that my recommendations will be in demand by both developers and users of this wonderful plugin ....