Event Handlers and Methods

Hi
I am new to web dynpro java . I want to know what are various situations in which Event handlers and Methods are introduced into component controller of  a web dynpro component and situations in which individual component subscribe to event in component controller..
Thanks
prasad

Hi Prasad,
When we write Events and methods inside the component controller those becomes visible throughout the components. So, for example, any action of a view of the component can call such a method of the component controller.
And when we write an Event or Method inside an individual component, it's life cycle remains inside the component only.
This is the basic difference.
Moreover, If you create attributes insdie component controller those becomes known to all methods that are called within a component and can be used by them, provided they have the Public property.
Hope it helps...
Regards,
Sen

Similar Messages

  • Proxies , Event handlers and exceptions

    Hi All,
    I am using an inbound proxy to communicate with CRM system via XI.
    I have to raise event handlers and exception catch using Try,,.. Catch OOps concept in the Proxy. Could anyone have some examples of similar kind of scenarios mentioning step by step. I am expecting a scenario and source code.
    thanks
    Deno

    HI,
    Please look at this thread on error handling:
    http://help.sap.com/saphelp_nw04/helpdata/en/25/a45c3cff8ca92be10000000a114084/content.htm
    Regards
    Vijaya

  • Event Handlers and Callbacks:  Best way to handle?

    I'm writing an actionscript class. I'm wondering how to deal
    with call backs and event handlers within my class. In particular,
    I'm wondering how I might structure my class so that developers
    using it can choose which arguments get passed to the callback
    function as they code. I've been googling and haven't found any
    particularly useful information on this.
    As far as I can tell, it would appear that the parameters
    passed to any callback function are determined at the time I write
    my class as this anonymous function example illustrates.
    var myObj:Object = new MyClass('foo', 'bar');
    myObj.onLoad = function(arg) {
    // the args passed to this anonymous function are dictated
    by the actionscript defnining MyClass
    I have also seen an approach using named functions and a
    class method for setting the event handler which allows a developer
    to pass some object to be used for scoping the named function but
    this also results in the parameters for the callback being
    predetermined by the actionscript that defines the class
    function myLoad(arg) {
    // the args passed to this function are also dictated by the
    actionscript defining MyClass
    var myObj:Object = new MyClass('foo', 'bar');
    myObj.setOnLoadHandler(this, 'myLoad');
    As far as I can tell, neither approach would let a developer
    specify any parameters for the callback functions (onLoad() in the
    first example, myLoad() in the second example). Which of these
    approaches is considered 'best practice'? Also, what would I do if
    I wanted to specify that the callback should operate on a
    particular movieclip on my timeline? How can I pass that
    movieclip's parameter to the callback function?

    You can download the Library from this link. Inside is an example that shows how to handle windows messages/events.
    http://zone.ni.com/devzone/cda/epd/p/id/4394

  • Spry and Iframe event handlers

    Hi,
    I am trying to implement an ajax simulated file upload using
    spry and iframes. With Spry's power to attach event handlers and
    $$() notation for accessiblities is there a way that you can detect
    when an iframe is loaded using any of spry's utilities.?

    there is nothing other than the basic delay in web overlay.
    I suppose the only thing to do would be to create the whole article as HTML, but I'm sure that would be over the top, it would put me off!
    Alistair

  • How to remove event handlers for a content type currently in use?

    Hi,
    We had a SP 2007 solution that managed event handlers as described in
    Brian Wilson's blog regarding event handlers. We then did a in-place upgrade to SP 2010. It so happend that we wanted to remove some of our old event handlers and this is where our problem started. We managed to delete event handlers
    (SPEventReceiverDefinitions) for
    Site and List by using the ui from Brian Wilsons feature "Manage Event Handlers" (ref the link above), but not anyone at all for
    Content Types... It simply wouldn't be deleted
    (remove was grayed out in the ui). 
    We then tried to do it by code. Below is a code snippet illustrating how we tried to delete the event handlers for content types:
    using (SPWeb web = properties.Feature.Parent as SPWeb)
    string targetClassName = "targetClassName.";
    web.AllowUnsafeUpdates = true;
    // Removing Content Type event handlers
    foreach (SPContentType ct in web.ContentTypes)
    for (int i = ct.EventReceivers.Count - 1; i >= 0; i--)
    if (ct.EventReceivers[i].Class.StartsWith(targetClassName))
    ct.EventReceivers[i].Delete();
    ct.Update(true);
    web.Update();
    The Content Types are not sealed and are
    not readonly. When debugging, we can see that the
    Delete() method are called on one of the Content Types we wanted to delete event handlers for. We noted that the
    ct.EventReceivers.Count remains the same, before and after Delete() is called. We did not get any exceptions when running this code.
    When running the code a second time and debugging again, we see that the very same Content Type still has the very same event handler attached... As in, it wasn't deleted....
    We also tried to delete the event handlers through PowerShell as described
    here in the post by Per Jakobsen. However, the script did not really seem to find any EventReceivers... We tried to write the
    $site.AllWebs | % {$_.Lists} | % {$_.ContentTypes} | % {$_.EventReceivers} list to file, but it was empty.. We did however get a long list when writing $site.AllWebs | % {$_.Lists} | % {$_.ContentTypes} to file. We could then in
    that file see the event handler references we want to remove registered to our Content Types, as we did during code debugging earlier on. So PowerShell might still be the way to go here...
    So, does anyone know if there is a way to force this delete through, either by code, PowerShell or some other means? Any help regarding this matter would be very much appreciated :)

    Hi,
    For your information, there's two versions (at least) exists for each content types. One is Site Content Type - exists in Root web and another is list content type. Once you add a content type to a list, a copy of the site content type is taken and stored
    in the list. If you update the site content type, it may or may not affect the list conten type. So make sure you are updating the both - site content and list content type. Once you update site content type with passing paramater true to 'ct.Update(true)',
    the list content types are supposed to updated too.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Try/catching errors occuring in synchronous event handlers

    Hi,
    I know that using try/catch in flash player it is possible to catch only synchronous errors, but recently I ran into code in our application which I strongly believe is synchronous but it behaves as if it wasn't.
    In example below I create event listener and inside try/catch I dispatch event. Handler function throws error. Executing code stops when error is thrown, so message "after throwing error" won't be logged, but try/catch block catches nothing and code executes as if nothing happened after event dispatch.
    Dispatching event on element executes handler method immediately so it is synchronous execution. Event call stack which is displayed in debug versions of flash player, shows every function from creation of class to execution of handler.
    Generally flash applications relays heavily on events and in my case it caused ours users projects to be irreversibly corrupted, because of this continuing to work after error, which I even can't properly detect and handle, cause it's going throught 5 or more event handlers and adding try/catch to each handler would create enormous chaos in my code. So my question is why does flash player behaves like this? Are there any ways to tell compiled SWF file to treat such cases as synchronous calls, f.e. compilation parameters?
    package
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.EventDispatcher;
        import flash.text.TextField;
        public class TestApp extends Sprite
            public var cTextField:TextField;
            public function TestApp()
                cTextField = new TextField();
                cTextField.width = 300;
                cTextField.height = 200;
                addChild(cTextField);
                onAppCreated();
            protected function onAppCreated():void
                var eventName:String = "my_event";
                var caughtError:Boolean = false;
                var dispatcher:EventDispatcher = new EventDispatcher();
                dispatcher.addEventListener(eventName, handler);
                try
                    dispatcher.dispatchEvent(new Event(eventName));
                } catch (error:Error)
                    caughtError = true;
                cTextField.text += caughtError ? "caught error\n" : "error wasn't caught\n";
            protected function handler(event:Event):void
                cTextField.text += "before throwing error\n";
                throw new Error("throw error");
                cTextField.text += "after throwing error\n";

    Okay, nobody bit.  Sorry. 
    The only way to really figure out what is going on is to look at a running example with a C++ debugger.  I'm particularly curious about whether this problem happens in a specific browser/os combination (we may be working around a quirk of that platform), or if it's something that happens everywhere.
    The most effective way to proceed is going to be to file a bug with a simplified, executable example (source and compiled SWF, ideally) that demonstrates the problem.  This will help me route the bug to a developer and get you an answer in the shortest time possible. 
    You can file a bug here:
    http://bugbase.adobe.com/
    If you reply here with the bug number, I'll get it assigned to an engineer.
    Thanks!

  • Unable to Create Event handlers , Plugs

    Hello everyone,
    We've just moved to a new development environment and had our existing WebUI enhancements transported from an old one (which was CRM 7.0 EHP1). The new system was also already in EHP1.
    The problem is we couldn't create any new Event Handlers and Inbound and Outbound plugs in an enhanced component via BSP_WD_CMPWB. Even though the component has already been enhanced, the system keeps on asking for an Access Key to edit SAP Standard objects and behaving as though the component hasn't been enhanced at all.
    Has anyone encountered this before? Any SAP OSS Note to fix the problem?

    Hello,
    Thanks for your replies, the issue has been solved. When the enhancements were transported into the new system the database entries used by the enhancement wizards weren't included into the transport. Basically we had to update the ff tables:
    BSP_WD_GEN -> Table with generated classes
    BSP_WD_EXT_HIST -> Mapping Table source controller class to  Z controller class, and source context class to Z context class

  • Help with Event Handlers with Scope

    I have a question of how I must implement the event handlers with scope, I have problems in the execution of processes BPEL (they are generating exceptions in the dehydration)
    I have two models for event handlers and I need to know which is the best way to implement event handlers.
    Another question is, in what it influences the "variableAccessSerializable" attribute.
    Thanks!
    1) Event Handlers with PartnerLink invocation OUTSIDE Scope
    <invoke name="Invoke_1" partnerLink="PartnerLink1"/>
    <scope name="Scope_1" variableAccessSerializable="yes">
    <eventHandlers>
    <onMessage partnerLink="PartnerLink1"/>
    <onAlarm/>
    </eventHandlers>
    <sequence name="Sequence_1">
    </sequence>
    </scope>
    2) Event Handler with PartnerLink invocation INSIDE scope
    <scope name="Scope_1" variableAccessSerializable="yes">
    <eventHandlers>
    <onMessage partnerLink="PartnerLink1"/>
    <onAlarm/>
    </eventHandlers>
    <sequence name="Sequence_1">
    <invoke name="Invoke_1" partnerLink="PartnerLink1"/>
    </sequence>
    </scope>

    Thanks -- indeed a crucial call might be missing. I was doing
    this until 3 yesterday morning.
    Would this be the correct sample code to use? :
    http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm ?context=Flash_MX_2004&file=00000846.html
    It seems to work (although someone cautions in the page
    comments that it doesn't).
    Part of my trouble in working with AS 2.0 is that I feel I
    shouldn't have to do such complicated things (Delegate classes,
    etc) in order to get simple things done (loading XML files). This
    is not a complaint per se -- rather I feel that I must be missing
    something, that it is my inexperience that is causing me to bend
    through so many hoops: programming "should" be elegant and simple.
    So, any links helpful. Thanks.

  • Problems with .chart-plot-background and event handlers

    Hello. I'm trying to add event handlers to my chart so that the user can be allowed click within the chart itself to perform certain actions like dragging, zooming, etc. To avoid having to deal with handling mouse clicks that lie outside the chart itself (for example on the axes), I've found that:
    .chart-plot-background
    is the Region that gives me the entire chart and nothing else. However, when I attach mouse listeners to this Region, the event is only registered on half of the cells in the chart. If you've seen the default JavaFX Chart background layout, you know that it contains alternating rows of cells with slightly different coloring. I've found that only the rows with the lightest gray coloring actually register a mouse click on them, which makes me believe the dark grey cells are not part of the .chart-plot-background, but something else on top.
    To me, this feels like an oversight in how the regions of the chart are defined. Why can I not get a listener to work on the whole chart and nothing else? Currently the only workaround seems to be to take the Region:
    .chart-content
    instead, and compute the difference between this region and the .chart-plot-background in order to manually suppress mouse clicks that lie outside .chart-plot-background.
    Anyone have suggestions? Is this worth issuing on the JavaFX Jira?

    Hello,
    I'm not an expert on controls, but here is my guess based on your description: when you register an event handler on a "background" node, it is called only when the mouse hovers over the background node - I suppose the light gray is the background with the light gray cells being transparent and dark grey cells being filled. So the behavior seems correct - you can't expect the events to be delivered to background when it is covered by other nodes. I think you really should register the handler on the entire chart and filter out the events you don't want to handle. This however should not require much of computing the difference between the regions, it should be possible to do just something like
    if (!background.contains(event.getX(), event.getY())) {
        return;
    Provided that the background doesn't reach under the axes as well. Note that if there are any different transforms between the background and the node with the handler registered on it, you may need to recompute the coordinates by
    background.sceneToLocal(event.getSceneX(), event.getSceneY());
    And use the contains method on that.

  • Multiple event handlers registered for the same event and error when adding users to sec groups

    Project Server 2013 CU April (May) 2014
    I've created and installed two event handlers (separate dll:s) and both are triggering on Project Published - initially, both are working fine.
    After an IISReset, trying to create a new security group (or add a user to an existing group) will result in an error on the page and a corresponding error in the ULS log - the latter indicating an error in the method security.creategroups, and specifically
    a problem 'An item with the same key has already been added.'
    An SQL trace reveals a break in execution after executing the proc 'pub.MSP_ADMIN_ReadEventReceivers' which returns all registered event handlers.
    In my case, the result of that proc execution shows that there are two event handlers registered with an EVENT_ID of 53 (Project Published) and with ORDER_FIRED set to 1 and 2 respectively.
    I tried removing one of the event receivers using the Central Admin PWA interface and then everything worked just fine - I added the event receiver back again, and everything STILL worked! IISReset and I got the error back again. :-(
    Since there's obviously some problem with reading multiple entries from that table regardless of the ORDER_FIRED differentiation, I tried temporarily modifying one of the '53' entries in the table directly and then the sec group was created just fine!
    I would like to know if anyone else has seen this? I've seen this on three separate installations now after deploying a second event listener onto those systems.
    /Lars Hammarberg
    //Lars Hammarberg www.connecta.se

    Hi Lars,
    yes I have seen the same issue. It is not related to April CU. I had the error before with SP1.
    It is not only an issue with the security groups. At least in our case nothing worked at all. No custom field editing, all Queue Jobs failing.
    For your case I suggest you consolidate your code in one eventhandler.
    Theory says that you can have more than 1 (up to 999) eventhandlers for one Event (http://msdn.microsoft.com/en-us/library/ms481079(v=office.12).aspx) but that seems not to
    work. Not sure, if it worked in earlier versions.
    Kind regards
    Christoph
    Christoph Muelder | Senior Consultant, MCTS, MCSE, MCT | SOLVIN information management GmbH, Germany

  • Acrobat SDK: How to get events and write event handlers in c#

    I am trying out to get events from a pdf doc and handle it in my c# code with the samples that come with Acrobat-SDK. 
    I am yet to understand how I can do it. I am yet to discover the class that provides me the events. All the classes currently expose methods only. It might be that I am missing something for sure.
    Can somebody help?
    My use case is:
    the user will open a pdf doc and my application (or my app can trigger opening the pdf doc)
    when the user selects some text from the pdf doc, my app should get the event
    My event can handle the selection and get the selected text.
    Put a bookmark on the selection in the pdf doc (with additional attributes)
    the pdf doc retains such bookmarks when the pdf is saved.
    bookmarks in the pdf should be available for edit.
    A different app/code should be able to parse and retrieve these bookmarks along with the additional attributes of the bookmark.
    I hope, I have not asked too much.

    There are no “event handlers” for C# in the Acrobat SDK.  You will have to “poll” for things such as selected text.
    Also, I don’t know what sort of “additional attributes” you are thinking about, but that may or may not be possible from C#.

  • Evaluating FXG files - possible to access elements and add event handlers?

    I would like to read an existing FXG file into flash builder and then datamine the file for elements, and add event handlers to those elements.
    For instance, if I have two rectangles in an FXG file (not in the flash builder mxml) and then read it in, I'd like to search for every rectangle and add an event handler that detects a mouse click. If the FXG code changes to three rectangles, I don't want to change my mxml for flash builder.
    Is this possible?

    I'm seeing a pretty tragic death using the following, where theDiagram.fxg is in the assets directory. Does <Graphic> map to a SpriteVisualElement, or is the <Graphic> composed of SpriteVisualElements?
    import assets.theDiagram;
    private var fxgCls:Class = theDiagram as Class;
    private var fxgElement:SpriteVisualElement = new fxgCls() as SpriteVisualElement;
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::updateCallbacks()[E:\dev\4.x\frameworks\projec ts\framework\src\mx\core\UIComponent.as:7093]
    at mx.core::UIComponent/set nestLevel()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:3986]
    at spark.core::SpriteVisualElement/http://www.adobe.com/2006/flex/mx/internal::addingChild()[E:\dev\4.x\frameworks\projects\s park\src\spark\core\SpriteVisualElement.as:2106]
    at spark.core::SpriteVisualElement/addChild()[E:\dev\4.x\frameworks\projects\spark\src\spark \core\SpriteVisualElement.as:2070]
    at assets::theDiagram_Text_16710627/createText()
    at assets::theDiagram_Text_16710627()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at mx.core::FlexSprite()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\FlexSprite.as: 61]
    at spark.core::SpriteVisualElement()[E:\dev\4.x\frameworks\projects\spark\src\spark\core\Spr iteVisualElement.as:87]
    at assets::theDiagram()[assets/theDiagram-generated.as:10]
    at SpecViewer()[SpecViewer.mxml:22]
    at _SpecViewer_mx_managers_SystemManager/create()
    at mx.managers.systemClasses::ChildManager/initializeTopLevelWindow()[E:\dev\4.x\frameworks\ projects\framework\src\mx\managers\systemClasses\ChildManager.as:304]
    at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\4.x\frameworks\projects\fram ework\src\mx\managers\SystemManager.as:2810]
    at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::kickOff()[E:\dev\4.x\frameworks\projects\frame work\src\mx\managers\SystemManager.as:2637]
    at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::preloader_completeHandler()[E:\dev\4.x\framewo rks\projects\framework\src\mx\managers\SystemManager.as:2539]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::Preloader/timerHandler()[E:\dev\4.x\frameworks\projects\framework\src\mx\p reloaders\Preloader.as:515]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()

  • Can I use classes and methods for a maintenance view events?

    Hello experts,
    Instead of perform/form, can I instead use classes and methods, etc for a given maintenance view event, lets say for example I want to use event '01' which is before saving records in the database. Help would be greatly appreciated. Thanks a lot guys!

    Hi viraylab,
    1. The architecture provided by maintenance view
       for using EVENTS and our own code inside it -
       It is provided using FORM/PERFORM
       concept only.
    2. At this stage,we cannot use classes.
    3. However, inside the FORM routine,
       we can write what ever we want.
       We can aswell use any abap code, including
       classes and methods.
      (But this classes and methods won't have any
       effect on the EVENT provided by maintenance view)
    regards,
    amit m.

  • How to expose and code the event handlers of a base class?

    I have created a class that inherits NumericUpDown. When I instantiate an object from that class, I can make it visible and have it appear on my form just like any other NUD. How can I get that instantiated object to expose the event handlers of its base
    class, the NUD in this case, so that, for example, I can tell the client what action to take when the value of the instantiated object changes?
    Thanks for your help.

    I am not sure exactly what you mean.  Are you adding your NUD controls to the Form at design time from the toolbox or adding them in code at run time?  If you are adding them to the form from the toolbox then you access the events the same way
    you would a standart NUD control.   If it is at runtime and you have a fixed amount of them you are going to add then you can declare them Class Scoped using the
    WithEvents keyword which will let you access all their events.
    Public Class Form1
    Private WithEvents Nud1 As New NUD
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.Controls.Add(Nud1)
    End Sub
    Private Sub Nud1_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Nud1.ValueChanged
    Me.Text = Nud1.Value.ToString
    End Sub
    End Class
    Public Class NUD
    Inherits NumericUpDown
    'Your custom code to make it work how you want...
    End Class
     If this is not what you are doing then you may need to explain a bit more and show the code you are using so we understand better.
    If you say it can`t be done then i`ll try it

  • [JS] Basic question about event listeners and event handlers

    I am very new to the whole topic of event listeners and event handlers.  I'd run the test for the following problem myself, but I don't know where to start, and I just want to know if it's impossible -- that is, if I'm misunderstanding what event listeners and event handlers do.
    Say I have an InDesign document with a text frame that is linked to an InCopy story.  Can I use an "afterImport" event listener on the text frame to perform some action any time the link to the InCopy story gets updated?  And will the event handler have access to both the story that is imported, and the pathname of the InCopy file?
    Thanks.

    Thank you, Kasyan.
    Both of those are good solutions.
    We are currently using InDesign CS4 and InCopy CS5.  I'm hoping to get them to purchase the whole CS5 suite soon, since I'd like to start writing scripts for InDesign CS5 as soon as possible, as long as I'm going to have to be doing it in the not too distant future anyway.  The greater variety of event handlers sounds like it might be something that is crucial to the project I'm working on, so that adds to the argument for getting CS5.
    Thanks again.  You have no idea how helpful this is.  I made some promises to my boss yesterday that I later realized were  based on assumptions of mine about the InDesign/InCopy system that didn't make any sense, and I was going  to have to retract my promises.  But after reading your response I think I can still deliver, in a slightly different way that I had been thinking before.
    Richard

Maybe you are looking for

  • Few keys won't work after coffee spill

    I realize this subject has been beaten to death because I have done searches here and Google multiple times but I can't seem to find a precise answer for my problem. Yesterday, around noon, my daughter spilled some coffee on the keys of my aluminum 1

  • Automatic Chapter Numbers in a Single Document?

    Hi - Just trying to figure out if there is a way to get auto-numbered chapters in a single document. I've read you can do chapters (autonumbered?) with an InDesign "Book" with separate files, but can you do it in one document? All I've found so far i

  • How to debug the plugin?

        now i can debug the plugin throught avalertnote message box or outputdebugstring ? but can not debug into the adobe ?

  • Export XLR report to excel

    Dear All, Am unable to export XLR report to Excel. Evertime when I try to generate XLR report System gets hanging. Please do the needful Thanks & Regards Venkatesh N

  • I want the feeder on top to pick up the paper and does not work. Brand new printer.

    I have a new printer HP Office Pro 8610 and the paper on tope does not feed. It did for one or two times and stopped.  I did not buy a warranty. I expected the printer to work. Please help.