Work around of deleterow send_event (OpenInsight 64-bit)
At 03 FEB 2021 12:31:50PM Brad Haughn wrote:
I entered this as a bug, but looking for a global work around for now.
When I use a send_event to send a DELETEROW command to an edittable and pass an @VM delimited rowdata that is being deleted, the DELETEROW event gets the rowdata information @FM delimited.
Since we used to disable delete row of most of our edittables by using a send_message to insert the row that was deleted (passed to the event) the @FM information causes an issue.
If you press the delete key when in an edittable the information passed ot the deleterow event is still @VM delimited. It is only if you pass an @VM delimited param of rowdata to the deleterow event with send_event that it converts it to @FM.
We have code on many of our edittables to re-add the deleted row immediately in the DELETEROW event. But since send_event passes the information @FM even though what is passed using send_event is @VM delimited, it is breaking our data. Is there someplace global I can fix this without having to visit every screen in the system?
At 03 FEB 2021 08:16PM Carl Pates wrote:
Hi Brad,
There's no simple workaround for this unfortunately - it has to do with internal mods that were made to avoid problems with passing event arguments from the PS to the engine.
However, if you email me at the address below I can send you a patch for SEND_EVENT that will hopefully stop the delimiter shift when you are using it.
As an aside, the EditTable has an explicit property "AllowRowDelete" to avoid having to do the delete/insert sequence - it is stored as a PS Style bit (PSS_EDT_ALLOWDELETE$) for the edit table - you could write a proc to remove this from your forms.
Here's a non-tested example - use at your own risk / back up first :)
compile subroutine cp_test_set_oiwin_EditTable_psStyle( void ) declare function repository, get_Repos_Entities $insert oiwin_Equates $insert ps_EditTable_Equates $insert rti_SSP_Equates $insert logical compileIDs = "" statError = "" call set_Status( SETSTAT_OK$ ) winList = get_Repos_Entities( @appID<1>, "OIWIN", "" ) if get_Status( statError ) then debug return end xCount = fieldCount( winList, @fm ) for x = 1 to xCount winID = winList<x> bUpdated = FALSE$ call set_Status( SETSTAT_OK$ ) winRec = repository( "ACCESS", winID ) if get_Status( statError ) then debug return end winHdr = winRec[1,@rm,TRUE$] winStruct = winRec[bCol2()+1,@rm,TRUE$] ctrlStructs = winRec[bCol2()+1,@rm,TRUE$] winMenu = winRec[bCol2()+1,@rm,TRUE$] yCount = fieldCount( ctrlStructs, @fm ) for y = 1 to yCount ctrlStruct = ctrlStructs<y> ctrlType = ctrlStruct<0,POS_TYPE$> begin case case ( ctrlType = "EDITTABLE" ) goSub process_EDITTABLE end case next if bUpdated then winRec = winHdr : @rm : winStruct : @rm : ctrlStructs : @rm : winMenu call set_Status( SETSTAT_OK$ ) call repository( "UPDATE", winID, winRec ) if get_Status( statError ) then debug return end compileIDs<-1> = winID end next if bLen( compileIDs ) then xCount = fieldCount( compileIDs, @fm ) for x = 1 to xCount winID = compileIDs<x> call set_Status( SETSTAT_OK$ ) call repository( "TCOMPILE", winID ) if get_Status( statError ) then debug return end next end return process_EDITTABLE: psStyle = ctrlStruct<0,POS_PSSTYLE$,1> if ( psStyle[1,2] _eqc "0x" ) then psStyle = iconv( psStyle[3,\00\], "MX" ) end // Remove the PSS_EDT_ALLOWDELETE$ bit if bitAnd( psStyle, PSS_EDT_ALLOWDELETE$ ) then // Already set so remove psStyle = bitAnd( psStyle, bitNot( PSS_EDT_ALLOWDELETE$ ) ) ctrlStructs<y,POS_PSSTYLE$,1> = "0x" : oconv( psStyle, "MX" ) if bUpdated else bUpdated = TRUE$ end end else // Ignore... null end returnRegards