on 10-09-2008 10:18 AM
Hi All,
In my addOn ItemEvent is executing multiple times.(3 to 4 times).What is this issue and how should i solve this problem?
Kindly give me the solution.....:-)
Thanx in advance
Mohana
Hi,
perhaps, when you change value on one field (textbox,Combo,etc...) your addon changes values on several field on your form... so ItemEvent fired each time you "update" each item/field...
... it seems your should verify with pval.InnerEvent porperty to avoid execute 3 or 4 times Itemevent.
Kinds regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
(stranged... the follow response went to another forum question!:S)
You should searching in sdk Help for clearing...
You may something like that (example in pseudoCode):
InnerEvent function()
begin
if pval.beforeaction =true then
select case pval.itemuid
case 'txtA':
if pval.innerevent = false then
'note: innerEvent= false means a directed action of end user
update information in txtB (for example..)
end if
case 'txtB':
if pval.innerevent =true then
'note: innerEvent=true means an action not directed caused by end user
... do something
end if
endselect
else
endif
end
I hope help you
Kinds Regards
You should searching in sdk Help for clearing...
You may something like that (example in pseudoCode):
InnerEvent function()
begin
if pval.beforeaction =true then
select case pval.itemuid
case 'txtA':
if pval.innerevent = false then
*'note: innerEvent= false means a directed action of end user*
update information in txtB (for example..)
end if
case 'txtB':
if pval.innerevent =true then
*'note: innerEvent=true means an action not directed caused by end user*
... do something
end if
endselect
else
endif
end
I hope help you
Kinds Regards
Hi..
give exit sub or pVal.InnerEvent = False
Regards..
Billa 2007
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
1) You can use SetFilters(...) to filter events for your form (see function example below).
Select only filters what you need. Call function when Add-on loading...
2) In the Events Handler Subs add conditions for pVal.EventType and set BubbleEvent..
Regards
Sierdna S.
Private Sub SetFilters()
Dim oFilters As SAPbouiCOM.EventFilters = Nothing
Dim oFilter As SAPbouiCOM.EventFilter = Nothing
Try
'// Create a new EventFilters object
oFilters = New SAPbouiCOM.EventFilters
'// MENU_CLICK
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_MENU_CLICK)
oFilter.AddEx("169") 'Menu
oFilter = Nothing
'// FORM_DATA_ADD
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD)
oFilter.AddEx("140") '
oFilter = Nothing
'// FORM_DATA_LOAD
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD)
oFilter.AddEx("YOUR_FORM_TYPEEX") '
oFilter = Nothing
'// FORM_DATA_UPDATE
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE)
oFilter.AddEx("YOUR_FORM_TYPEEX") '
oFilter = Nothing
'// FORM_ACTIVATE
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE)
oFilter.AddEx("YOUR_FORM_TYPEEX") '
oFilter = Nothing
'// FORM_CLOSE
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_CLOSE)
oFilter.AddEx("YOUR_FORM_TYPEEX") '
oFilter = Nothing
'// FORM_LOAD
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
oFilter.AddEx("YOUR_FORM_TYPEEX") '
oFilter = Nothing
'// FORM_UNLOAD
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD)
oFilter.AddEx("YOUR_FORM_TYPEEX") '
oFilter = Nothing
'// RIGHT_CLICK
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_RIGHT_CLICK)
oFilter.AddEx("YOUR_FORM_TYPEEX") '
oFilter = Nothing
'// ITEM_PRESSED
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED)
oFilter.AddEx("YOUR_FORM_TYPEEX") '
oFilter = Nothing
'// KEY_DOWN
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_KEY_DOWN)
oFilter.AddEx("YOUR_FORM_TYPEEX") '
oFilter = Nothing
'// VALIDATE
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_VALIDATE)
oFilter.AddEx("YOUR_FORM_TYPEEX") '
oFilter = Nothing
'// DOUBLE_CLICK
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_DOUBLE_CLICK)
oFilter.AddEx("YOUR_FORM_TYPEEX") '
oFilter = Nothing
'// CHOOSE_FROM_LIST
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST)
oFilter.AddEx("YOUR_FORM_TYPEEX") '
oFilter = Nothing
'// Setting the application with the EventFilters object
SBO_Application.SetFilter(oFilters)
Catch ex As Exception
' log exception
Finally
oFilter = Nothing
oFilters = Nothing
System.GC.Collect() 'Release the handle to the table
End Try
End Sub
Edited by: Sierdna S on Oct 9, 2008 2:47 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.