Bubble Event Disadvantages in FormDataEvent

Good day,
Recently I've been experiencing some trouble using the bubbleevent = false in the formdataevent.
Correct me if I'm wrong, but what I have appreciated is that if the Addon hangs while it's executing the formdataevent, the database can suffer some damages.
I've recently had a problem while developing an Addon where all I do is validate if a user introduced some userfields in the Incoming Payments Form. If the validation is not met, then i turn the bubble event = false in the formdataevent. What happened was that in the precise moment that i was debugging my application, I stopped the addon from running and the payment was added without any problem. But from there on, each time I try to cancel an incoming payment, i get the following error: [Incoming Payment - Cancelled] 'Payment field cannot be updated (ODBC 1029)' [Message 131 - 183]. My guess is that for an unknown reason, the database was corrupted.
Many of you could ask Why I don't do these validations in the ItemEvent Event. I've noticed that it can be validated while using the itemevent, except in the case that you try to close the form by clicking the X in the top of the form. The application asks if you want to save changes, and if you click "Yes", then you won't be able to detect that the user is handling a data event, unless you catch the event in the FormDataEvent, I think that to handle this kind of situations is why the FormDataEvent was created.
I've also noticed that you can't use the status bar for diplaying messages when setting the bubbleevent = false in the FormDataEvent. You always get the internal error message which overrides the message that you posted when the error occurred.
What I would like to know is::
1) Is there any publication of best practices while using the FormDataEvent event.
2) Which is the safest way to handle these kind of situations.
3) Is there any known issue regarding to the FormDataEvent damaging the database integrity.
Any help or comment will be truly appreciated.
Sincerely,
Antonio Burgos
Edited by: Paul Finneran on Sep 9, 2008 10:20 AM

Hi,
well, i know only 2 workarounds:
1.) trap the SBO_SP_TransactionNotification stored procedure -> Petr is the stored procedure guru
2.a.) trap the itempressed on OK AND Cancel Button.
your problem till now was that the message comes with -> Data has changed. Save ?
why you don't change to modus to OK_MODE and the form closes without system message ?
2.b.) or send a key to the system message window -> first send tab (to jump to no) and than send enter.
lg David

Similar Messages

  • Bubble Event firing in one company but not another

    Having spent the past 2 days trying to get the installer working (which it finally does thanks to people on this forum!), I've finally pushed my add-in out to people this morning.
    Unfortunately, the bubbleevent seems to be being ignored in all companies bar the test company.
    The code is below. The nominal codes do not begin with "720", so that section is not being fired in either company.
    So, my question is, why would a bubble event work in one company but not another?
    Private Sub oApp_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles oApp.ItemEvent
            Dim NumberRows As Long
            Dim oMatrix As SAPbouiCOM.Matrix
            Dim oRowCount As Integer
            Dim oCheck As SAPbouiCOM.EditText
            Dim oCheck2 As SAPbouiCOM.EditText
            REM Check for Profit Centre and Project Code on each line of Purchase Transactions
            If pVal.FormTypeEx = "142" Or pVal.FormTypeEx = "141" Or pVal.FormTypeEx = "181" Or _
            pVal.FormTypeEx = "139" Or pVal.FormTypeEx = "133" Or pVal.FormTypeEx = "179" Then
                REM Set to active form and Sales/Purchase transaction matrix
                oForm = oApp.Forms.ActiveForm
                oItem = oApp.Forms.Item(FormUID).Items.Item("38")
                oMatrix = oItem.Specific
                If pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And _
                  pVal.Before_Action Then
                    If pVal.ItemUID = "1" Then
                        NumberRows = oMatrix.RowCount
                        For oRowCount = 1 To NumberRows - 1
                            oCheck = oMatrix.Columns.Item("30").Cells.Item(oRowCount).Specific
                            If oCheck.Value = "" Then
                                oApp.MessageBox("Please enter a Profit Centre on row " & oRowCount)
                                BubbleEvent = False
                            End If
                            oCheck = oMatrix.Columns.Item("31").Cells.Item(oRowCount).Specific
                            If oCheck.Value = "" Then
                                oApp.MessageBox("Please enter a Project on row " & oRowCount)
                                BubbleEvent = False
                            End If
                            oCheck = oMatrix.Columns.Item("U_CarReg").Cells.Item(oRowCount).Specific
                            oCheck2 = oMatrix.Columns.Item("1").Cells.Item(oRowCount).Specific
                            If oApp.Company.DatabaseName = "FOLLIS_LIVE" Or oApp.Company.DatabaseName = "FOLLUK_TEST" Then
                                If oCheck.Value = "" And Left(oCheck2.Value, 3) = "720" Then
                                    oApp.MessageBox("Please enter a Car Registration on row " & oRowCount)
                                    BubbleEvent = False
                                    Exit For
                                End If
                            End If
                        Next oRowCount
                    End If
                End If
            End If
            REM Check for Profit Centre and Project Code on each line of Nominal Transactions
            If pVal.FormTypeEx = "392" Or pVal.FormTypeEx = "393" Then
                REM Set to active form, journal matrix
                oItem = oApp.Forms.Item(FormUID).Items.Item("76")
                oMatrix = oItem.Specific
                If pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And _
                  pVal.Before_Action Then
                    If pVal.ItemUID = "1" Then
                        NumberRows = oMatrix.RowCount
                        For oRowCount = 1 To NumberRows - 1
                            oCheck = oMatrix.Columns.Item("23").Cells.Item(oRowCount).Specific
                            If oCheck.Value = "" Then
                                oApp.MessageBox("Please enter a Profit Centre on row " & oRowCount)
                                BubbleEvent = False
                            End If
                            oCheck = oMatrix.Columns.Item("16").Cells.Item(oRowCount).Specific
                            If oCheck.Value = "" Then
                                oApp.MessageBox("Please enter a Project on row " & oRowCount)
                                BubbleEvent = False
                            End If
                        Next oRowCount
                    End If
                End If
            End If
        End Sub

    Hi Daniel,
    Then the only option I see is that the If statement is true in one database, and false on the others.
    If oApp.Company.DatabaseName = "FOLLIS_LIVE" Or oApp.Company.DatabaseName = "FOLLUK_TEST" Then
    If oCheck.Value = "" And Left(oCheck2.Value, 3) = "720" Then
    oApp.MessageBox("Please enter a Car Registration on row " & oRowCount)
    BubbleEvent = False
    Exit For
    End If
    End If
    If oCheck.Value = "" Then
    oApp.MessageBox("Please enter a Project on row " & oRowCount)
    BubbleEvent = False
    End If
    One of this is should be different on the companies.
    Nothing else comes to my mind.
    Regards,
    Ibai Peñ

  • How to Bubble Event  use in SAP??

    Hi all ,
         I have a UDO Addon .I used  one more validation for user fields value in Add /Update as i return  False for validation .B1 bubble Checker  show error for return false.B1 bubble checker not show error with bubble value false for Item add validation .Any one help how to SAP maintain Bubble event for validation but B1 bubble Checker not  showing bubble event false .
    thanks
    surajit

    Hi
    You can bypass that message using the following code , also use message box instead of status bar in form data event ...
    Public Overrides Sub OnStatusBarErrorMessage(ByVal txt As String)
                'ADD YOUR CODE HERE     ...
                Try
                    If txt.Contains("UI_API -7780") Then B1Connections.theAppl.StatusBar.SetText("", 0, BoStatusBarMessageType.smt_None)
                Catch ex As Exception
                End Try
            End Sub
    Refer these threads for more information
    "Action stopped by add-on (UI_API -7780) Message 66000-152"
    Re: Action Stoped by Add-ON
    Re: UDO - How to handle an scenario
    DATA ADD EVENT
    Re: B1DE and screen validation ..
    Re: Validation in Form Data add Event
    Displaying message when canceling event
    Hope this helps
    Arun

  • Bubble Event and System Forms

    Hi together,
    I have a problem with using the BubbleEvent in combination with System-Form-Events:
    Target:
    If someone CLICK on the OK-Button in Systemform "134"
    (Business-Partners-Form), I want to stop the Form being closed.
    Concept:
    using the Item-Event "et_ITEM_PRESSED" and set the BubbleEvent-Flag to false.
    Sample-Code:
    If (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) And _
               (pVal.FormMode = SAPbouiCOM.BoFormMode.fm_OK_MODE) And _
               (pVal.FormTypeEx.Equals("134") = True) And _
               (pVal.ItemUID.Equals("1") = True) And _
               (pVal.BeforeAction = True) Then
                Try
                    BubbleEvent = False
                Catch ex As Exception
                    'check Errors
                End Try
            End If
    Problem and Test:
    Nevertheless the form is being closed. The BubbleEvent-Flag has no effect. As I read in other topics, the 2005 Environment only accept the Bubble-Event in BeforeAction.
    Three Events will be fired (Click on OK-Button):
    et_Click | beforeAction = true
    et_Click | beforeAction = false
    et_Item_pressed | beforeAction = true
    I have used the last Event (Item_pressed). Using the et_Click with beforeAction = true has also no effect.
    The events will always be used individually at the test, not combined.
    Maybe someone can resolve this problem...
    Best regards
    Jochen

    Strange. I implemented a very simple add-on with B1DE
    and added this listener:
        public class Button__134__1 : B1Item {
            public Button__134__1() {
                FormType = "134";
                ItemUID = "1";
            [B1Listener(BoEventTypes.et_ITEM_PRESSED, true)]
            public virtual bool OnBeforeItemPressed(ItemEvent pVal) {
                Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
                Item item = form.Items.Item("1");
                Button button = ((Button)(item.Specific));
                // ADD YOUR ACTION CODE HERE ...
                return false;
    As you can read this listener set the bubble event to
    false for the button 1 in Form 134. The form cannot be
    closed, the event is handled correctly by the add-on. I am
    using 2005 SP1 but I guess it should be working the same
    for your release too.

  • Is there a way to dispatch or bubble events between two pop-up windows?

    Hi. I was wondering if there is a way to dispatch custom
    events between two or more pop-up windows created using the
    PopUpManager?
    I understand how to pass an event from one pop-up window to
    the main application (or FrontController) by dispatching the event
    from Application.application under Cairngorm 2.0.
    However, as I understand it, that will only bubble the event
    through the Application chain of visual controls and not to the
    other pop-up windows created using the PopUpManager.
    I tried dispatching the event directly from the pop-up window
    itself, but the other pop-ups still does not seem to receive the
    event.
    It would be nice to be able to do this so that each non-modal
    pop-up can have some awareness with each other.
    Thank you very much in advance.

    If you have just 2 pop-ups you can have them each do a
    addEventListener on the other, listening for the event (custom or
    otherwise).
    If you have an unpredicatable number, then you devise
    something else. Suppose you have 3 pop-ups, p1, p2, and p3. Let's
    say you also have 1 custom event, E1. Any of those pop-ups is
    capable of dispatching an E1 event and you want all of them to
    receive it.
    Create a class that extends EventDispatcher and instantiate
    an object of that class. Each pop-up "registers" with that class,
    something like:
    controller.addEventListener( "E1", handler ); where handler
    is a function in the pop-up.
    When a pop-up wants to dispatch an E1 event, it does it
    through the controller: controller.dispatchEvent( new E1(data) );
    This will automatically dispatch that event to all the
    pop-ups, including the one that dispatched the event. So a pop-up
    will have to examine the event to see if it sent it and perhaps
    ignore it.

  • Event Bubbling from inside a MediaElement

    Hi,
    Does anyone know how to bubble a custom event from inside a ProxyElement? My ProxyElement wraps the target media inside a SerialElement and prepends a clip. I'm wondering how to dispatch an event which I could capture outside of OSMF (bubbles all the way up to Stage).
    I've tried dispatching from the ProxyElement, the SerialElement it creates, the VideoElement inside the serialElement, and also from the DisplayObjectTrait of each of those. I'm unable to successfully capture it via bubbling.
    In contrast I've modified the AdProxy example (org.osmf.examples.ads.AdProxy) and I can successfully capture a bubbled event dispatched via the displayObject it creates. I believe this may be due to its use of a custom AdProxyDisplayObjectTrait? It doesn't seem to do anything fancy so I'm not sure why it works yet my other attemps don't.
    Speaking of the AdProxy example. If i modify it to create a SerialElement and prepend a clip only the first clip plays correctly, all subseqwuent clips are heard but not seen. Is this a bug or do I need to somehow remove the custom AdProxyDisplayObjectTrait to resolve this issue? The child media claims it correctly has its own DisplayObjectTrait and the dimensions are correct. I'm using OSMF 1.6.1.
    Cheers,
    Tim

    I have a strong sensation that the OSMF project is quite dead.
    no new submits since 2010, the contact form on the offical OSMF
    project website http://www.opensourcemediaframework.com/
    returns a PHP error.
    and many unanswered questions about OSMF in this forum.
    i think it would be wise to not use OSMF if possible, although
    I'm also stuck with it since we are utilizing HDS/PHDS
    protocols which are utilized in the framework.
    otherwise its quite a head-ache.
    I'm unable to get to a video element coming from a proxied element
    that is being produced via an HDS connection.
    and haven't found any solution that works.

  • Possible bug, at least serious problem, in the AS3.0 event architecture

    Event bubbling causes a compiler error when it should not.
    High up in the display list, a
    listener has been added for TypeBEvent which extends
    TypeAEvent.
    Lower in the display list, a
    different object dispatches a TypeAEvent, and sets bubbling to true
    (and possibly, cancellable to false).
    A Type Coercion error (#1034)
    results! The listener receives the bubbled event which is of the
    same type as the base class of the handler event type. The event
    object "cannot be converted" to the TypeBEvent it is
    receiving.
    Circumstances
    This situation came up in a real Flex project, where a video
    player that had been loaded as a module within another module
    dispatched a PROGRESS ProgressEvent, and a listener had been added
    to the higher level module for its ModuleEvent PROGRESS event,
    ModuleEvent subclasses ProgressEvent. The video player bubbled its
    event, and the compiler threw this error: "TypeError: Error #1034:
    Type Coercion failed: cannot convert
    flash.events::ProgressEvent@1f2de0d1 to mx.events.ModuleEvent."
    This compiler error does not make sense from a developer
    perspective, because it means any class lower on the display list
    can break the player (not the program, the player) simply by
    dispatching an event.
    Our team lost a great deal of (expensive) time trying to
    locate the source of this problem, since nothing about the compiler
    error – including the stack trace! – indicated the
    high-level class. In fact, the module developer didn't know
    anything about the high-level class which was compiled to a swc
    library, and the event being dispatched was in the flex class
    library, so neither end of the problem was very visible. Because
    the error only pointed to the video player class the developer
    naturally went into the flex classes first and tried to solve the
    problem in their scope before finally giving up and bringing the
    problem to others on the team.
    Truly a case where the software defeated team workflow.
    Our conclusion
    We love the new event framework but, this seems to come
    pretty close to qualifying as a bug. The high-level event listener
    simply should NOT have received, then choked the player on the
    bubbled base-class event. It should either receive it or not. If it
    did receive the event, the code in the handler could check whether
    the event target was appropriate... but instead the player breaks
    and does not provide any clue as to where, it only indicates the
    dispatching class as a culprit. Even short of fixing the problem,
    improving the error message so that the receiving event handler is
    clearly implicated would be a start.
    Again I am of the opinion that this compiler error should not
    take place at all because the top class subscribed specifically to
    the subclassed event type. A bubbled event that breaks the player
    due to an unrelated listener is just a huge black hole, especially
    when multiple developers are working on different tiers of a
    program.
    Could we get a reply from someone at Adobe on this issue?
    Thanks very much,
    Moses Gunesch

    If you create a metadatatype with a single metdata block, and you reference that in your vm/cm cell attribute using a *one* based index, Excel seems to see the link and it honors it when saving the spreadsheet.
    So, I ended up with something like:
    <c ... cm="1"/> (I'm dealing with cell metadata, but the concept is equivalente to value metadata)
    <metadataTypes count="1">
      <metadataType name="MyMetaType" .../>
    </metadataTypes>
    <futureMetadata count="1" name="MyMetaType">
      <bk>
        <extLst><ext
    uri="http://example" xmlns:x="http://example"><x:val>87</x:val></ext></extLst>
      </bk>
    </futureMetadata>
    <cellMetadata count="1">
      <bk><rc
    t="1" v="0"/></bk> <!-- this is what gets referenced as cm=1 on the cell -->
    </cellMetadata>
    Hope this helps. 

  • Help Understanding Event Model

    I am having trouble getting items initialized ontime. I have
    read the flex 3 development guide and some other docunentation a
    couple of times and i have read other posts on this forum
    concerning the creationComplete event. I still don't have a clear
    picture of how this works.
    The development guide says the following:
    initialize - Dispatched when a component and all its children
    have been created, but before the component size has
    been determined.
    creationComplete - Dispatched when the component has been
    laid out and the component is visible (if appropriate).
    From this, I am assuming that using a creationComplete event
    for a parent object should have access to any component ids on
    child objects.
    However, this is not happening in my code.
    I have the following scenario:
    Container1
    ->Container2 (child of Container1)
    -->Datagrid (child of Container2)
    In container 1, I attempt to register an event listener with
    the itemClick event of the datagrid using the creationComplete
    event. This fails. However, if I move this registration to a click
    event on Container 1, it is successful. So the problem appears to
    be related to instantiation of the datagrid. So why would the
    dataGrid not be instantiated by the time the Container1
    creationComplete event fires?

    "rss181919" <[email protected]> wrote in
    message
    news:gfeqai$gr6$[email protected]..
    >I am having trouble getting items initialized ontime. I
    have read the flex
    >3
    > development guide and some other docunentation a couple
    of times and i
    > have
    > read other posts on this forum concerning the
    creationComplete event. I
    > still
    > don't have a clear picture of how this works.
    >
    > The development guide says the following:
    > initialize - Dispatched when a component and all its
    children have been
    > created, but before the component size has
    > been determined.
    > creationComplete - Dispatched when the component has
    been laid out and the
    > component is visible (if appropriate).
    A lot of this depends. For instance, if Container1 is a
    ViewStack or if
    Container2 is added via addChild, Container2 might or might
    exist at
    creationComplete of Container1. All bets are off on creation
    of children of
    Container2 at creationComplete of Container1 :-).
    > From this, I am assuming that using a creationComplete
    event for a parent
    > object should have access to any component ids on child
    objects.
    >
    > However, this is not happening in my code.
    > I have the following scenario:
    > Container1
    > ->Container2 (child of Container1)
    > -->Datagrid (child of Container2)
    >
    > In container 1, I attempt to register an event listener
    with the itemClick
    > event of the datagrid using the creationComplete event.
    This fails.
    > However,
    > if I move this registration to a click event on
    Container 1, it is
    > successful.
    > So the problem appears to be related to instantiation of
    the datagrid. So
    > why
    > would the dataGrid not be instantiated by the time the
    Container1
    > creationComplete event fires?
    Try dispatching a custom bubbling event from the
    creationComplete event of
    the datagrid that you listen for from Container1. Or, just
    have Container2
    do the handling and generate a custom event based on the
    itemClick. That's
    probably the "Flexier" way to handle it.
    HTH;
    Amy

  • DATA ADD EVENT

    Hi Experts,
        I have checked one condition in FORM DATA ADD EVENT and also I have stop the action using BUBBLE EVENT = False. But its stopping whole add-on. When ever my condition is false , am getting error and its stopping the whole add on.
    Any idea for this error ??
    Regards
    Smith.

    Hi Tomy,
    If you want to do validation or checking before adding data,
    Why dont you do it on Item Event, on Add button, event = click,  and before action = true,
    if condition false then bubble event = false, exit sub
    else , go tru..
    nd.Q

  • Determine Printer From Print Event

    Hi,
    I am trying to use the PrintEvent and ReportDataEvent to handle printing of some forms bypassing SAP.
    From the SDK help.
    "You can use this event as an "exit" point for integrating third-party reporting tools instead of the SAP Business One Document Editor."
    Unfortunately I am unable to obtain the printer that the user selects in the print common dialog. It doesn't seem to be exposed by the UIAPI anywhere.
    There is a field in the PrintEventInfo called WithPrinterPreferences but it is useless without more information as to what the print preferences are.
    The print dialog appears before either the print event or the report data event so I can't stop it appearing using Bubble Event.
    My only workaround is to catch the print and print preview menu events and for specific forms stop them from propagating back to SAP. Then show my own printer selection dialog. The problem with that is I have no way of setting the document as "Printed". The printed field on the form is ReadOnly from the DIAPI. The only way of setting the form printed looks to be calling MarkAsPrinted during the print event.
    Regards Jared

    Hi Jared,
    i know this issue:
    it is possible to catch the print common dialog with .NET functionality.
    but very restriced - you can send "OK" to window - thats it.
    but at least the document has than the status "printed".
    the trick is catching the dialog window with searching the "Form Title".
    lg David

  • Problem catching events from my ComboBoxItemRenderer

    Hi all,
    I have a problem catching a custom event dispatched by my
    custom ComboBoxItemRenderer. In the renderer I dispatch an event as
    follows:
    dispatchEvent(new Event("smallTest",true,true));
    As this is a bubbling event i expected to be able to catch it
    in one of the parent containers. However, the opposite is true.
    Then, lowering my goals i tried to catch the MouseEvent.CLICK event
    raised by the button in the ComboBoxItemRenderer. I failed in the
    same way...
    Somebody has a clue? Thanks in advance!
    (the following is an isolated description of my small problem
    The Mainapp
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()" layout="absolute" xmlns:local="*">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.collections.ArrayCollection;
    [Bindable]
    public var aDataProvider:ArrayCollection = new
    ArrayCollection(
    [ {label:"one", data:1},
    {label:"two", data:2},
    {label:"three", data:3} ]);
    private function init() : void {
    addEventListener("smallTest", doAlert);
    private function doAlert(event : Event) : void {
    Alert.show("yo");
    ]]>
    </mx:Script>
    <mx:ComboBox id="cb" itemRenderer="ComboBoxItemRenderer"
    dataProvider="{aDataProvider}" width="200"/>
    </mx:Application>
    The Renderer
    <?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="100%">
    <mx:Script>
    <![CDATA[
    import mx.core.Application;
    private function doClick() : void {
    dispatchEvent(new Event("smallTest",true,true));
    ]]>
    </mx:Script>
    <mx:Label color="red" text="{data.label}"/>
    <mx:Spacer width="100%"/>
    <mx:Button label="*" width="40" click="doClick()"/>
    </mx:HBox>

    Listening from the combobox (cb) didn't work. Found out that
    the hierarchical parent list from the view of the itemrenderer was
    as follows:
    List18.ListBaseContentHolder21
    List18
    [object _ComboboxTest_mx_managers_SystemManager]
    [object Stage]
    For now, i managed to fix the problem by listening from the
    systemManager but this is more like a hack.

  • Capture event from mxml component

    I have an accordian control in my main mxml application. Each
    item in the control is a custom mxml component that I created that
    consists of a label and some text. When the label is clicked, I
    need to fire off a message to the containing application with a
    string value. I'm not sure how to do this. Here's what I have right
    now. I'm not sure if I'm going down the right track but if I am,
    how do I pass the string argument with the event and then capture
    this event and the argument in the main application?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="200">
    <mx:Script>
    <![CDATA[
    private var _title:String = "";
    private var _desc:String = "";
    [Inspectable(defaultValue=true)]
    public function set Title(title:String):void{
    _title = title;
    public function set Description(desc:String):void{
    _desc = desc;
    private function SetMovie(url:String):void{
    dispatchEvent(new Event("MovieTitle"));
    [Bindable(event="MovieTitle")]
    ]]>
    </mx:Script>
    <mx:VBox>
    <mx:Label id="lblTitle" text="{_title}" width="190"
    click="SetMovie('testmovie.flv');/>
    <mx:Text id="txtDescription" text="{_desc}"
    width="190"/>
    </mx:VBox>
    </mx:Canvas>

    You have several issues, and several options here. First, a
    custom event can pass any data you want, and is not very hard to
    create.
    However, there is a still easier way. All of the Event
    objects have a "target" and "currentTarget" property which give you
    a reference to the object that dispatched the event.
    So, in your component, implement a public property, say like
    this:
    public function get Title():String{
    return _title;
    then in a handler function you can do:
    private function onMovieTitle(event:Event):void {
    var sMovieTitle:String = event.currentTarget.Title; //watch
    out for reserved words, though
    There are two ways to listen for an event. One easy way is to
    use a bubbling event. Some folks advise against bubbling event
    because of potential event name collisions, but this may not be a
    concern for you. It has not yet concerned me enough to make me
    avoid using bubbling.
    The other way is to declare handler on the component itself.
    Also, if you use a metadata tag, you can assign the handler on the
    mxml tag, instead of using addEventListener():
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="200">
    <mx:Metadata>
    [Event(name="MovieTitle", type="flash.events.Event")]
    </mx:Metadata>
    <mx:Script>
    Then, in you main app:
    <myComp id="mc1" ... MovieTitle="onMovieTitle" ...
    Without the metadata, you would do
    mc1.addEventListener("MovieTitle",onMovieTitle)
    Using a bubbling event:
    change the dispatchEvent to this:
    dispatchEvent(new Event("MovieTitle",true)); //the 'true'
    makes it bubble
    Then, in the main app, listen ON the main app(this):
    this.addEventListener("MovieTitle",onMovieTitle);
    Tracy

  • Event problem with SDK 2005

    Hi,
    I want to catch the et_form_unload event of my form to validate if I want to block the form from closing.
    The problem is : we should use the et_FROM_UNLOAD event but if I set bubbleevent to false the form close anyway. (event if beforeaction = true)
    But if I use et_FORM_CLOSE everything works fine except that the et_FORM_CLOSE event is "deprecated in UI API 2004" and in 2 realeses my addon wil not work.
    Any hints ?

    Hi,
    I have seen the comment about et_FORM_CLOSE in the UI API Help for 2004 version...
    But in 2005 SP01 it is already there and it is not anymore marked as deprecated.
    There is even a comment about it in the list of changes. Pay attention this comment refers to <b>2005 SP01</b> version:
    <i><b>Topic</b>
    Added before event to close event. Ignore the bubble event setting in the after event.
    <b>Description</b>
    In this event SAP Business One will throw also before event and not only after event. Due to the fact the SAP Business One now is sending before event the bubble event setting in the after event will be ignore and the user will need to set the bubble setting like in the other type of event in the before.
    <b>Impact for Add-Ons</b>
    In previous versions only 'after' event was sent and the bubble flag was used. From 2005 version SAP Business One will ignore the bubble flag in after event. SAP Business One will send before event as well as after event and will use the bubble flag only in before event.
    <b>Possible Solution</b>
    1. check all place in the code on which close event were used and verify that behavior is kept
    2. check that this event handled only once (not 2 for the before and after)</i>
    I think it will not be deprecated, but to be sure please create a message for support to have it confirmed.
    Hope it helps
    Trinidad.

  • Passing events from externally-loaded SWFs

    Hi,
    We have an externally-loaded swf that acts as a kind-of-a slide show.  After a user selects a particular subject from a mxml-based "menu" application, they push "buttons" in the SWF to go through a presentation, then on the last frame of the swf, I'd like to unload the swf and replace it with another "mxml" application.  How can this be done?  I have not tried to pass/capture events "up" from an externally-loaded swf before.
    Thanks,
    Doug

    Do you own those SWFs?  If so, they should dispatch an event from a known
    place like a SlideShowManager or something like that.
    Other folks "cheat" and bubble events or dispatch off of the systemManager
    and/or top-level application.

  • Dispatching an event.

    Hey all, I can't seem to dispatch an event. Am I just missing something?
    I have a  class called Activities that extends the MovieClip class and it imports the following classes:
    import flash.display.MovieClip;
    import flash.events.EventDispatcher;
    import flash.events.Event;
    import flash.events.MouseEvent;
    in the constructor I have a listener listening for a rollover of various Movie clips on the stage.  (this event is working)
    this.addEventListener(MouseEvent.ROLL_OVER, sendInfo);
    I want to dispatch a custom event (in this case just to my document class) from the sendInfo() function when the roll over happens. like so:
    private function sendInfo(event:MouseEvent):void
         dispatchEvent(new Event("MyEvent"));
         //other stuff in the function
    in my document class named Main I am importing the follwoing classes
    import com.activities.Activities;
    import flash.display.MovieClip;
    import flash.events.Event;
    in the constructor I have the following listener
    addEventListener("MyEvent", eventPassed);
    with the following function:
    function eventPassed(event:Event):void
         trace("works");
    It seems to me that this should work, but when I roll over any of the Movie clips on the stage, it registers I rolled over it (i verified with a trace statement in the sendInfo() function), but does not seem to dispatch the event as the trace statement int he document class is not being called.
    I used this as reference for setting up my custom disptach.
    http://www.learningactionscript3.com/2007/11/20/dispatching-custom-events/
    thanks.

    Hey
    your problem is right here:
    addEventListener("MyEvent", eventPassed);
    your adding the event just right only your event by default is not a bubbling event so when your trying to listen to it globaly it wouldn't work you would need to actually ask for the event directly :
    yourClip.addEventListener("MyEvent", eventPassed);
    now if you want it to bubble (you should avoid it as much as you can to cut down on processing when its not needed)
    you can send a second param to the event diapatchment:
    dispatchEvent(new Event("MyEvent",true));
    so flash knows it should bubble the event all the way up.
    by the way talking about events check out The EventController i don't want to dig to deep into it becouse its off topic but you might find it useful
    Best
    Ben Fhala@

Maybe you are looking for

  • E72 - Honeymoon to Divorce.

    Like many of you here, I've had quite a few mobile phones through the years and it's always a source of great excitement when a brand new phone lands on your desk. The new OS to explore, the Apps, the form factor. The downside of playing around with

  • X220 - problem with SmartAudio echo reduction

    I sometimes use my computer to watch TV shows and skype at the same time with friends that live abroad (i.e. we watch the same TV show and discuss it over skype). I have never had any problems with my previous laptops doing that as long as I used a h

  • Space in table cell content

    Hi, I want to add some space before and after the table cell content. I am using setIntercellSpacing() method to achieve that and I could get the required functionality. But its adding space in the Table Header also which looks odd. Is there any way

  • List of Excise invoices

    Hi gurus, Can we saw a list of excise invoices....is there any transaction code??? like billing document VF05...i want for excise invoices.... Ravikumar

  • Dynamic connection to eBusines Suite

    Hi All, Is it possible to decide eBuiness Suite to be connected at runtime of a BPEL process? Our Requirement: We are creating an application that integrates with different (around 15) ebusiness Suites. We have same procedures compiled in all eBusine