Skip to Content
author's profile photo Former Member
Former Member

About Item Events

Hi,

I had Desigened A form and It contains some Contrls to it,

I had written code to Whne item pressed, it will not working.

Code Written is

Public Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles sbo_application.ItemEvent

BubbleEvent = True

'Dim EventEnum As SAPbouiCOM.BoEventTypes

'EventEnum = pVal.EventType

If (FormUID = "frmGrid") And (pVal.ItemUID = "BUTTON") And _

(pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) And (pVal.BeforeAction = False) Then

sbo_application.SetStatusBarMessage("BUTTON CLICKED")

End If

End Sub

So Please Give me solution

Regards

Srinivas

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Mar 31, 2008 at 07:16 AM

    sura,

    there are only 3 possibitlies why it don't work:

    1.) the FormUID is wrong - maybe you mixed it up whit pval.FormType

    2.) the ItemUID is wrong

    3.) you forgot et_ITEM_PRESSED in your EventFilter

    regards

    David

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 31, 2008 at 07:21 AM

    Srinivas,

    In ur code first u assign bubbleevent=true and then check bubblevent=false.

    Can u tell me for Wht purpose u using this button press??

    Regards,

    Anitha

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 31, 2008 at 08:55 AM

    Hi Srinivas,

    Not getting an event has additional reasons: bubble event = false from aprevious event for example (if you alreadey catched a click event and set Bubble Event = false, the next event will not be fired)

    Do you catch other events? How about Click event (it is also sent when pressing buttons)

    Can you specify if you don't get the event at all or you just fail in the status bar code line?

    Regarding the event filter:

    - If you don't set the event filter at all in your code - you are supposed to get all the events.

    - If you have filter, then only the events you choose, will be sent to you. You can find full example in the SDK sample. This is only in short:

    Private Sub SetFilters()
    
    '// Create a new EventFilters object
        Set oFilters = New SAPbouiCOM.EventFilters
        
    '// add an event type to the container
    '// this method returns an EventFilter object
        Set oFilter = oFilters.Add(et_CLICK)
        
    '// aggign the form type on which the event would be processed
        oFilter.Add 139 'Orders Form
        oFilter.Add 142 'Purchase Form
        
        Set oFilter = oFilters.Add(et_KEY_DOWN)
        
    '// aggign the form type on which the event would be processed
        oFilter.Add 139 'Orders Form
        
    '// For a list of all form types see the help or use the
    '// Tools -> User Tools -> Display Debug Information option
    '// in the SBO application
    '// then open the desired form and hover over it with the mouse
    '// the form's type will apear in the lower left side of the screen
        
        
    '// Setting the application with the EventFilters object
    '// in this case we will process a click event for form types 142 and 139
    '// and we will process a key down event for for form type 139
    
        SBO_Application.SetFilter oFilters

    Hope it helps,

    Renana

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.