Skip to Content
0
Jul 08, 2010 at 12:24 AM

Event dead loop in updating column value of a matrix

30 Views

Hi,

I need to do some auto calculation in a matrix. In my matrix, i have column A and B. If user enter a value in column A and leave the column then my add-on will do some calculation and assign a new value to column B, same thing on column B. In my event filtering, i use

"pVal.FormType == xxx && pVal.ItemUID == "xx" && pVal.ColUID == "U_xx" && pVal.EventType == SAPbouiCOM.BoEventTypes.et_LOST_FOCUS && !pVal.BeforeAction"

to capture the event. But then my add-on enter into a dead loop. It seems when i write a value to column B in column A event it will trigger LOST_FOCUS event in column B and then it trigger same event of column A, and then it enters into a dead loop. In SAP B1 client, i can see the two columns start refreshing endlessly.

Apparently, when assigning a value into a column B during event of column A, it will trigger LOST_FOCUS event of column B. That's the only reason i strongly suspect that. Is there any one know the solution for my situation?

Thanks,

Lan

P.S. i first get the object of the textbox in the matrix, and use "oEditText.value = new_value" to assign the value.

Edited by: ZHANGLAN on Jul 8, 2010 2:26 AM