Multirecord issue with or without a grid
Author: gianni.sandigliano@unifacesolutions.com (gianni)
Uniface 9.6.07 - we are facing with a recurring issue with entities showing multiple records in a non modal form either with a grid or without a grid: Example 1: 1) The user is positioned on record 1 of multiocc entity (in this case in a grid) part of a NonModal Form ($curocc("EntityName") = 1) 2) The user click on the row 8 header requesting in this way to go into details for that row 3) The ExtendedTrigger is starting this code RowHeader_LClicked: setocc "EntityName", ROWNUMBER ; ROWNUMBER is equal 8 call myLocalProc ; This local proc is starting another NonModal Form to manage row details 4) The user exit the called form; it does not matter if accepting or quitting it. Note: at this point $curocc("EntityName") = 8 5) The FormGetFocus trigger code in the calling form is started Note: during execution of all the codelines into this trigger, up to "done" instruction added from the compiler, $curocc("EntityName") is equal 8 6) After execution of FormGetFocus if the form is executing a whatever line of code, as an example OccurrenceGetFocus, $curocc("EntityName") is back to 1 instead of 8; if any action is executed at row level at this point is happening on occurrence 1 while the user and the programmer thinks/wants/hope to be on occurrence 8. We made various tests on this Uniface application and the behaviour is consistent when the component called from the external procedure at point #3 is starting its own editing session. If the proc code does not start a new editing session the $curocc("EntityName") is correctly remaining at the value defined in triggers. We have also another example (Example 2) with a small form implementing a search on a column with standard multirecords presentation (not a grid). In this case the calling form form is looked for a string defined in the called form from the user; the called form is repositioned with $setocc on an occurrence containing the searched string. When the user ask to close the search and go back to the calling form the value of the $curocc("EntityName") is automatically restored to the initial value used when the user search was started. Expectation: when active path is changed from proc code it should be maintaned from Uruntime. Any input or suggestion is welcomed. Gianni




