cancel
Showing results for 
Search instead for 
Did you mean: 

Event dead loop in updating column value of a matrix

former_member244307
Participant
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member682029
Contributor
0 Kudos

Hi

Why didn't you try the Validate event instead of Lost focus. That is pretty easy for such calculations.

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

Thanks

Anoop

former_member244307
Participant
0 Kudos

Hi Anoop,

Yes, I should use Validate event.

Thanks,

Lan