Dispatching Event in ItemRenderer Component?

Am I going about this the right way? Here's my situation:
I have a custom itemRenderer for a List. This itemRenderer consists mainly of a checkbox and label, but has a few additional details in it (which is why I'm not using a drop-in itemRenderer). I want to detect when the selection of the checkbox changes, so I was thinking of creating a custom event in the itemRenderer and then bubbling it up to the list.
Or is there a way I can detect when a user checks a checkbox from the lists itself?
Thanks!

I found this article which explains this topic very well also: http://weblogs.macromedia.com/pent/archives/2008/03/itemrenderers_p_2.html
(It appears that these may be referencing the same series of articles on different sites.)
However, I am now conflicted, because if I the version without bubbling, I am tying the itemRenderer directly to my component; whereas with bubbling I don't need to make that association. I may opt for the bubbling route after all, because I want to keep my itemRenderers generic enough to use in any of my custom controls, and not just in a certain type.
For more clarification: the hangup is where the event gets triggered on the listData.owner. To do this, it appears that it must be type-cast first, and then manipulated. Any ideas on how to get around that? Here's Peter's example:
====================================
First, you have to add metadata to the CatalogList control to let the compiler know the control dispatches the event:
     import events.BuyBookEvent;
     import mx.controls.TileList;
     [Event(name="buyBook",type="events.BuyBookEvent")]
     public class CatalogList extends TileList
Second, add a function to CatalogList to dispatch the event. This function will be called by the itemRenderer instances:
          public function dispatchBuyEvent( item:Object ) : void
               var event:BuyBookEvent = new BuyBookEvent();
               event.bookData = item;
               dispatchEvent( event );
Third, change the Buy button code in the itemRenderer to invoke the function:
               <mx:Button label="Buy" fillColors="[0x99ff99,0x99ff99]">
                    <mx:click>
                    <![CDATA[
                         (listData.owner as CatalogList).dispatchBuyEvent(data);
                    ]]>
                    </mx:click>
               </mx:Button>
Now the Button in the itemRenderer can simply invoke a function in the list control with the data for the record (or anything else that is appropriate for the action) and pass the responsibility of interfacing with the rest fo the application onto the list control.
====================================

Similar Messages

  • Dispatch event from itemrenderer

    Greetings.
    i've got a main applicationxml: main.mxml
    followed by a component: optionbox.mxml, being loaded in the
    main.mxml.
    in optionbox.mxml another component is loaded:
    optionCanvas.mxml
    inhere, a datagrid is being created with a custom
    itemrenderer: itemsRenderer.mxml
    in this itemsRenderer (wich alters the display of the cells)
    is an image located.
    when you click this image, an object has to be dispatched to
    the main.mxml.
    how can I do this? It works when I dispatch from a component,
    but not from an itemrenderer.
    can anyone help me out.??
    main.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    xmlns:c="comp.*"
    backgroundAlpha="0"
    backgroundColor="#FFFFFF">
    <mx:«»Style>
    global{
    fontFamily:Arial;
    Canvas{
    color:#000000;
    .FooterLink{
    color:#0066CB;
    fontWeight:Bold;
    fontThickness:900;
    .Footer{
    backgroundColor:#E1F0F7;
    DataGrid{
    borderThickness:0;
    selectionColor:#FFFFFF;
    selectionDisabledColor:#FFFFFF;
    disabledColor:#FFFFFF;
    rollOverColor:#FFFFFF;
    ToolTip {
    fontFamily: Arial;
    fontSize: 12;
    color: #000000;
    </mx:«»Style>
    <mx:«»Script>
    <![CDATA[
    import events.itemEvent;
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    [Bindable]
    private var selectedItems:ArrayCollection = new
    ArrayCollection();
    private function photoSelectedHandler(event:itemEvent):void{
    selectedItems.addItem(event.selectedItem);
    ]]>
    </mx:«»Script>
    <mx:VBox width="980" height="100%">
    <mx:HBox>
    <mx:VBox>
    <c:LeftPane id="leftpane" width="201" height="100%" />
    <c:Checkout id="checkout" selectedItems="{selectedItems}"
    styleName="checkout" fontWeight="bold"/>
    </mx:VBox>
    <c:«»Swfcontainer width="537"
    height="405" />
    <c:OptionBox width="222" height="100%" id="optionBox"
    itemSelected="{photoSelectedHandler(event)}"/>
    </mx:HBox>
    <c:Footer width="100%"
    styleName="Footer"></c:Footer>
    </mx:VBox>
    </mx:Application>
    [/code:1]
    optionbox.mxml
    [code:1]<?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    color="#400000" creationComplete="printerData.send()"
    xmlns:c="comp.*">
    <mx:Metadata>
    [Event(name="itemSelected",
    type="events.itemEvent"«»)]
    </mx:Metadata>
    <mx:«»Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    [Bindable]
    public var printer:ArrayCollection
    private function printerDataHandler(event:ResultEvent):void{
    printer = new ArrayCollection();
    printer=event.result.printer.confItem;
    ]]>
    </mx:«»Script>
    <mx:HTTPService id="printerData" url="data/data.xml"
    result="printerDataHandler(event)"/>
    <mx:Accordion id="accOptions" width="100%" height="100%"
    headerHeight="32" backgroundAlpha="0" fontSize="11" color="#0066CB"
    resizeToContent="true">
    <mx:Canvas label="{printer.getItemAt(0).label}"
    width="100%" height="100%" backgroundAlpha="0">
    <mx:VBox>
    <mx:Text width="198"
    htmlText="{printer.getItemAt(0).text}" />
    </mx:VBox>
    </mx:Canvas>
    <mx:Repeater id="repAccOptions" dataProvider="{printer}"
    startingIndex="1" >
    <c:optionCanvas
    itemData="{repAccOptions.currentItem}"/>
    </mx:Repeater>
    </mx:Accordion>
    </mx:HBox>[/code:1]
    optionCanvas.mxml
    [code:1]<?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    label="{itemData.label}" width="100%" height="100%"
    verticalScrollPolicy="off">
    <mx:«»Script>
    <![CDATA[
    [Bindable]
    public var itemData:Object;
    ]]>
    </mx:«»Script>
    <mx:VBox width="100%">
    <mx:Text width="100%" htmlText="{itemData.text}" />
    <mx:«»DataGrid
    dataProvider="{itemData.consumables.consumable}"
    headerHeight="0"
    width="100%" itemRenderer="itemRenderers.OptionsRender"
    alternatingItemColors="#FFFFFF">
    <mx:columns>
    <mx:«»DataGridColumn
    dataField="consumableLabel" width="200"/>
    </mx:columns>
    </mx:«»DataGrid>
    </mx:VBox>
    </mx:Canvas>[/code:1]
    optionsRenderer.mxml
    [code:1]<?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    verticalScrollPolicy="off" horizontalScrollPolicy="off" width="165"
    height="45">
    <mx:Metadata>
    [Event(name="itemSelected",
    type="events.itemEvent"«»)]
    </mx:Metadata>
    <mx:«»Script>
    <![CDATA[
    import events.itemEvent;
    [Bindable]
    public var selectedItem:Object;
    private function addItem(itemObj:Object):void{
    selectedItem = new Object();
    selectedItem = itemObj;
    var eventObj:itemEvent = new
    itemEvent(selectedItem,"itemSelected"«»);
    dispatchEvent(eventObj);
    ]]>
    </mx:«»Script>
    <mx:Image source="assets/btnAddItem.jpg"
    click="addItem(data)"/>
    <mx:Text htmlText="{data.consumableLabel}"
    height="45"/>
    <mx:Image source="assets/btnInfoItem.jpg"
    horizontalAlign="right">
    <mx:toolTip>
    {data.consumableLabel}
    Partnumber:{data.consumablePartnr}
    Price:{data.consumablePrice}
    Omschrijving
    {data.consumableDescr}</mx:toolTip>
    </mx:Image>
    </mx:HBox>[/code:1]

    Override clone() method inside event to make sure you take into account the bubbling property, and then inside renderer dispatch the event with bubbling property set to true.
    Alternatively you can dispatch on the list e.g :
    owner.dispatchEvent(newCopyProductEvent(CopyProductEvent.COPY_PRODUCT,o));
    If you choose to do the latter make sure you don;t get into an infinite loop inside list if you decide to redispatch from there,
    C

  • [svn:cairngorm3:] 21050: Popup: The default behavior when an Event. CLOSE is dispatched through the popup component should be preventable

    Revision: 21050
    Revision: 21050
    Author:   [email protected]
    Date:     2011-04-09 16:22:58 -0700 (Sat, 09 Apr 2011)
    Log Message:
    Popup: The default behavior when an Event.CLOSE is dispatched through the popup component should be preventable
    https://bugs.adobe.com/jira/browse/CGM-59
    Popup: The write-only behaviors property can not be used with states
    https://bugs.adobe.com/jira/browse/CGM-55
    Ticket Links:
        http://bugs.adobe.com/jira/browse/CGM-59
        http://bugs.adobe.com/jira/browse/CGM-55
    Modified Paths:
        cairngorm3/trunk/libraries/Popup/src/com/adobe/cairngorm/popup/PopUpBase.as
        cairngorm3/trunk/libraries/Popup/test/com/adobe/cairngorm/popup/PopUpBaseTest.as
        cairngorm3/trunk/libraries/PopupTest/.actionScriptProperties
    Added Paths:
        cairngorm3/trunk/libraries/PopupTest/html-template/
        cairngorm3/trunk/libraries/PopupTest/html-template/index.template.html
        cairngorm3/trunk/libraries/PopupTest/html-template/playerProductInstall.swf
        cairngorm3/trunk/libraries/PopupTest/html-template/swfobject.js

    Hi Shweta,
    as i discussed with you to update the script code
    <html><script> function closeWindow( ){       top.close( );     }                  </script><body><form> The application was logged off successfully. <br><input type="button" value="close window" onclick="closeWindow( );" /></ form></body></html>
    in sicf transaction for your component.
    it will work (close the window).
    dont forget to give me points
    all the best...
    Rgds,
    Mahesh.Gattu

  • Dispatching & listening for custom events from custom component [Flex 4.1]

    I'm giving this a try for the first time and I'm not sure I have the recipe correct!
    I have a custom component - it contains a data grid where I want to double click a row and dispatch an event that a row has been chosen.
    I created a custom event
    package oss
        import flash.events.Event;
        public class PersonChosenEvent extends Event
            public function PersonChosenEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
                super(type, bubbles, cancelable);
            // Define static constant.
            public static const PERSON_CHOSEN:String = "personChosen";
            // Define a public variable to hold the state of the enable property.
            public var isEnabled:Boolean;
            // Override the inherited clone() method.
            override public function clone():Event {
                return new PersonChosenEvent(type);
    Then I try to dispatch the event within the component when the datagrid is doubleclicked:
    import oss.PersonChosenEvent
    dispatchEvent(new PersonChosenEvent(PersonChosenEvent.PERSON_CHOSEN, true, false));
    And in the parent application containing the component I do on creationComplete
    addEventListener(PersonChosenEvent.PERSON_CHOSEN,addPersonToList);
    The event does not seem to fire though. And if I try to evaluate the "new PersonChosenEvent(..." code it tells me "no such variable".
    What am I doing wrong?
    (It was so easy in VisualAge for Java, what have we done in the last 10 years?? )
    Martin

    I've done this kind of thing routinely, when I want to add information to the event.  I never code the "clone" method at all.
    Be sure that you are listening to the event on a parent of the dispatching component.
    You can also have the dispatching component listen for the event too, and use trace() to get a debug message.
    I doubt if it has anything to to with "bubbles" since the default is true.
    Sample code
    In a child (BorderContainer)
    dispatchEvent(new ActivationEvent(ActivationEvent.CREATION_COMPLETE,null,window));
    In the container parent (BorderContainer)
    activation.addEventListener(ActivationEvent.CREATION_COMPLETE,activationEvent);
    package components.events
        import components.containers.SemanticWindow;
        import components.triples.SemanticActivation;
        import flash.events.Event;
        public class ActivationEvent extends Event
            public static const LOADED:String = "ActivationEvent: loaded";
            public static const CREATION_COMPLETE:String = "ActivationEvent: creation complete";
            public static const RELOADED:String = "ActivationEvent: reloaded";
            public static const LEFT_SIDE:String = "ActivationEvent: left side";
            public static const RIGHT_SIDE:String = "ActivationEvent: right side";
            private var _activation:SemanticActivation;
            private var _window:SemanticWindow;
            public function ActivationEvent(type:String, activation:SemanticActivation, window:SemanticWindow)
                super(type);
                _activation = activation;
                _window = window
            public function get activation():SemanticActivation {
                return _activation;
            public function get window():SemanticWindow{
                return _window;

  • Dispatching events...

    Hi,
    I am working on a project for a system that will not have a mouse. Ideally I would like the screen to function almost like a video game would -- even though it is not a game. By this I mean that all keystrokes are handled at the window level and dispatched to the correct component depending on the keystroke.
    Currently I have inhibited the ability of components on the form to gain focus. When I press a key, the listener associated with the JFrame responds... I then attmpt to use dispatchEvent inside of a case statement to route events to the proper components (In this case a JTextField) The problem is, is that allthough the dispatchEvent call is made, the JTextField doesn't do anything with it. I am just typing characters so I would expect all these keystrokes to show up in the JTextField, but it does not work.
    Does anybody know why this might not work?
    -Benjamin

    Here is a code snippet that actually seems to work. The problem was that I was dispatching a keyPressed event rather than a keyTyped.
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    class NoFocus extends JFrame implements KeyListener {
       private class JTextFieldNF extends JTextField {
          public JTextFieldNF(int size) {
             super(size);
          public boolean isFocusTraversable() {
             return false;
       JTextFieldNF tfnf;
         public NoFocus() {
          tfnf = new JTextFieldNF(20);
          getContentPane().setLayout(new FlowLayout());
          getContentPane().add(tfnf);
          addKeyListener(this);
         public void keyPressed(KeyEvent evt) {
       public void keyTyped(java.awt.event.KeyEvent evt) {
          switch (evt.getKeyCode()) {
             // Route up and down key somewhere else
             case KeyEvent.VK_UP:
             case KeyEvent.VK_DOWN:
                break;
             // All keystrokes not expicitly used are piped to tfnf
             default:
                      tfnf.dispatchEvent(evt);
       public void keyReleased(java.awt.event.KeyEvent A) {
         public static void main(String args[])
              JFrame frame = new NoFocus();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.setSize(200,200);
              frame.setVisible(true);

  • How do I pass an event up the component hierarchy?

    I have a child component which has a mouse listener and a parent component with a mouse listener. However the child component consumes all the mouse events so the parent doesn't get them.
    Is there a way for a child component to receive mouse events, then decided to pass them back up the component hierarchy so the parent can still receive them too?
    I've spent the last two hours on Google and can't seem to find anything relevant.
    Cheers, Eric

    Unfortunately, you cannot
    override this method since it ispackage-private.
    That was wrong of mine. Package-private members are
    visible to subclasses too (the package access is a
    complete superset of protected access). So you CAN
    override dispatchEventImpl and do your stuff there.
    When I try that the compiler gives me the following warning
    The method SheetElementPlacementComponent.dispatchEventImpl(AWTEvent) does not override the inherited method from Container since it is private to a different package.
    It lets me define the method, but does not let me override it.
    I just wonder why they made dispatchEvent() final,
    when it just calls dispatchEventImpl(), and it is
    not final...
    Another useful method is Component.enableEvents()
    and disableEvents() (which are both protected). You
    can use them to modify the so called event mask of a
    component, which is used to signify which events a
    Component is interested in. Disabled events (= not
    on the event mask) are not delivered to the
    component and the dispatcher skips it, looking for
    parent components which have enabled the event. For
    example, if you have a JButton in a scroll pane and
    you scroll the mouse wheel on the button, the event
    is dispatched to the scroll pane, even though it
    occurs over the surface of the button. That's
    because a button is not interested in mouse wheel
    events.
    You can use that hack the following way: In the
    mouse listener for your child component, after you
    have done your work, disable mouse events for the
    component and then post the event again (invoke
    dispatchEvent(theEvent)). That way, the event should
    be delivered to the closest parent that is
    interested in mouse events. This is done
    synchronously, so after all listeners for the parent
    components have finished, the dispatchEvent() method
    returns in your listener for the child component.
    Then you re-enable mouse events on the child
    component in order to receive the next mouse event.
    I don't know if this works or if it has any side
    effects, but it's worth a try...I can't call dispatchEvent() because it creates an infinite loop resulting in a stack overflow. It tried calling((JComponent) getParent()).dispatchEvent(e); but this does not help either, the parent never gets the event.
    Hope this helps you more :).
    Greets,
    MikeSorry, I still can't find a way around it other than to redesign my UI.
    FYI I created a bug report and Sun have assigned it Bug Id: 6571453. Everyone please vote on this if you think it's a cool feature request.
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6571453
    Cheers, Eric

  • Need help getting data out of a itemrenderer component

    I have a datagrid populated via a dataprovider (arrayCollection). No issue there
    I have a dateField Custom itemRenderer (as a component) and this is populated fine, so no issue there either.
    However I can't seem to find any way of getting the data out (it can be edited, so it is no longer the original data). I can get the original data, but not the new data.
    I can't use an event as there are hundreds of rows that I need to manipulate to write back to the database. I just want to get all the values as displayed in the datagrid.
    I just want to loop through the datagrid and pull out the data as entered in the itemrenderer component object. In debug mode I can see
    event --> itemrenderer --> [inherited] --> mycustomecomponent --> text. I just can't seem to get at it.
    Any Ideas. It's got to be simple and I am just missing it I guess.

    In your ItemRenderer, assign your data.yourDataFieldHere to the new value after editing is complete. This will allow you to then loop through the dataProvider in the main application and get all the values needed.
    function onEdit(evt:Event):void {
    data.yourDataField = evt.currentTarget.text; // Or use whatever property of the edited item you need here.
    Chris

  • Custom itemRenderer component based on cell value: error 1009

    I'm working on an item renderer for a dataGrid that has different states depending on the cell and row values.
    The cell value is a toggle (true or null), and sets whether content should be shown in the cell or not
    The row properties determine what is shown when the cell value is true.
    The dataGrid dataProvider is populated based on user id input.
    I created the itemRenderer as a custom actionscript component, closely following this example:
    360Flex Sample: Implementing IDropInListItemRenderer to create a reusable itemRenderer
    However, my component results in Error #1009 (Cannot access a property or method of a null object reference) when a user id is submitted.
    package components
         import mx.containers.VBox;
         import mx.controls.*;     import mx.controls.dataGridClasses.DataGridListData;
         import mx.controls.listClasses.BaseListData;
         import mx.core.*;
         public class toggleCellRenderer extends VBox
              public function ToggleCellRenderer()
              {super();}
              private var _listData:BaseListData;   
                   private var cellState:String;
                   private var cellIcon:Image;
                   private var imagePath:String;
                   private var imageHeight:int;
                   private var qty:String = data.qtyPerTime;
                   private var typ:String = data.type;
              public function get listData():BaseListData
                   {return _listData;}
              public function set listData(value:BaseListData):void
                   {_listData = value;}
              override public function set data(value:Object):void {
                   super.data = value;
                   if (value != null)
                   //errors on next line: Error #1009: Cannot access a property or method of a null object reference.
                   {cellState = value[DataGridListData(_listData).dataField]}
              override protected function createChildren():void {
                   removeAllChildren();
                   if(cellState=='true'){
                        cellIcon = new Image();
                        addChild(cellIcon);
                   //there is another state here that adds another child...
              //next overrides commitProperties()...
    There are no errors if I don't use an itemRenderer--the cells correctly toggle between "true" and empty when clicked.
    I also tried a simple itemRenderer component that disregards the cell value and shows in image based off row data--this works fine without errors or crashing. But I need to tie it to the cell value!
    I have very limited experience programming, in Flex or any other language. Any help would be appreciated.

    Your assumption that the xml file either loads with "true" or nothing  is right.
    After modifying the code to the following, I don't get the error, but it's still not reading the cell value correctly.
    package components
         import mx.containers.VBox;
         import mx.controls.*;   
         import mx.controls.dataGridClasses.DataGridListData;
         import mx.controls.listClasses.BaseListData;
         import mx.core.*;
         public class toggleCellRenderer extends VBox
              public function ToggleCellRenderer()
               super();
              private var _listData:BaseListData;   
              private var cellState:Boolean;
              private var cellIcon:Image;
              private var imagePath:String;
              private var imageHeight:int;
              private var qty:String;
              private var typ:String;
               public function get listData():BaseListData
                 return _listData;
              override public function set data(value:Object):void {
                   cellState = false;
                   if (listData && listData is DataGridListData && DataGridListData(listData).dataField != null){
                       super.data = value;
                       if (value[DataGridListData(this.listData).dataField] == "true"){
                           cellState = true;
              override protected function createChildren():void {
                   removeAllChildren();
                   if(cellState==true){
                        cellIcon = new Image();
                        addChild(cellIcon);
                   //there is another state here that adds another child...
              //next overrides commitProperties()...
    - didn't set the value of qty or typ in the variable declarations (error 1009 by this too--I removed this before but wanted to point out in case its useful)
    - added back in the get listData() function so I could use the listData
    - changed the null check
    All cells are still returning cellState = false when some are set to true, even if I comment out [if (value[DataGridListData(this.listData).dataField] == "true")] and just have it look for non-null data. That shouldn't make a difference anyway, but it confirms that all cells are returning null value.
    Swapping out the first if statement in set data with different variables results in the following:
    [if (listData != null)]  all cells return null (cellState=false for all)
    both [if (value != null)] and  [if (DataGridListData != null)]  results in error 1009 on a line following the if, so I assume they return non-null values.
    All rows have data, just not all fields in all rows, so shouldn't listData be non-null?  Could it be that the xml file hasn't fully loaded before the itemRenderer kicks in?
    I also realized  I had removed the item renderer from many of the columns for testing, and since some columns are hidden by default only one column in the view was using the itemRenderer--hence the single alert per row I was worried about earlier.
    Thanks for your help so far.

  • TabIndex in DataGrid ItemRenderer Component

    How to implement tabindex for the DataGrid ItemRenderer
    Component?Any
    idea Please.

    "ravi_bharathii" <[email protected]> wrote
    in message
    news:gbv9ps$k6r$[email protected]..
    > How to implement tabindex for the DataGrid ItemRenderer
    Component?Any
    > idea Please.
    Is this what you wanted?
    http://blogs.adobe.com/aharui/2008/08/datagrid_itemeditor_with_two_i.html

  • [Embed(source="...   And dispatching events and trace commands not working

    Hi,
    I have a main swf that Embeds another swf.  In the embedded (child) swf I have trace commands and it dispatches events. 
    I embed the child swf like this:
    [Embed(source="../assets/child.swf", symbol="ChildMC")]
    public var ChildMC:Class;
    var child_mc = new ChildMC();
    child_mc.addEventListener(Event.COMPLETE, childComplete);
    addChild(child_mc);
    function childComplete(event:Event):void
    at the end of the timeline in the child swf I have: dispatchEvent(new Event(Event.COMPLETE));
    When I test the main swf, I can see the child swf, but the main swf can't catch any of the dispatched events and I don't get any trace commands from the child swf.
    How can I catch events from an embedded swf?
    thanks!

    I did a quick sample with two fla's.
    The first loads in a child swf and then calls a funtion on the main timeline:
    var url:String = "loadTestChild.swf";
    var urlRequest:URLRequest = new URLRequest(url);
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_complete);
    loader.load(urlRequest);
    addChild(loader);
    function loader_complete(evt:Event):void {
       evt.currentTarget.content.callMeFromParent();
    The child swf has this code on the main timeline:
    function callMeFromParent ():void {
              trace ("called from parent whoop");
    Running the parent, the trace is called.
    So with this you should be able to call any function you have in the child from the parent.

  • On-dispatch-event trigger related to mscomm (load weight from weight scale

    aoa!
    please guide me to pick weight from weight scale.
    i m using mscomm32 ocx for this purpose.
    clarify the role of on-dispatch-event trigger and specify all events
    regarding mscomm and also explain how to trap events for accomplish
    task.
    thanks in advance.
    Tool used:developer 6i & oracle 10g windows xp(sp2)professional.

    Thanks, but I've already seen this thread and done the steps described on it.
    Actually, my question is very specific... How to populate the fields LinkVal and LinkUnit of the registry...
    I read all the threads here in SDN and they don't answer my question...
    I'd be glad if someone had already done tcode HUPAST works for Filizola...
    Tks again.

  • Questions on Dispatching events

    Hey all,
    I have been trying to get a grasp on dispatching events and have a few questions I am hoping you will all be nice enough to clearify for me.
    Do I have to have a custom Event class to dispatch a custom event?
    If so do I have to create a new intance of the event each time I want to dispatch an event. Example:
    dispatchEvent(new MyEvent(MyEvent.TASK_COMPLETE));
    or can I just dispatch an event once an instance has already previously been created.... example:  dispatchEvent(MyEvent.TASK_COMPLET);?
    Thanks,

    hi
    if you dont need to pass any data along with the event then you dont need a custom event, you can just use a custom event name. eg: dispatchEvent(new Event("myEventName"));
    if you want to dispatch the same event multiple times, you can (but not sure why you would want to do that?), eg:
    var e:Event = new Event("myEventName");  [or new MyCustomEvent("myCustomEventName", myCustomData) ]
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);

  • Dispatching events from JNI

    I've got an application that is trying to watch for mouse events anywhere and everywhere. The goal is to be in-the-know when there is mouse activity going on in general, with the Java app running in the taskbar.
    I have determined that I'll likely need JNI to accomplish this, as paying attention to mouse activity over the whole operating system is somewhat operating system dependent. : )
    Nevertheless, I'd like Java code to handle the events, and I can't seem to find any way for JNI to dispatch events back to the Java side of things. My hope was to catch the events thrown by the system in C/C++ and then simply dispatch them again to act as a middle-man.
    If anybody can tell me how I might accomplish this using JNI, or even a step in the right direction, I would greatly appreciate it. Or, if I'm barking up the wrong tree, please please let me know.
    Thanks,
    - J

    Steps in order
    1. Determine how to capture the events in C/C++. There is no java in this step.
    2. Write an API in C/C++ that models the functionality that you want to use in java. There is no java in this step.
    3. Write java/jni that uses the API in 2. There is java in this step.
    As a callback you will need to use the jni attach thread method.
    You better be careful as messing up on any of the steps above can render your mouse inoperable for the entire OS, so learn the keyboard shortcuts.
    I think that someone posted code like this in the past. I could be mistaken however.

  • Dispatching event from Javascript

    Can I dispatch events from javascript to flash player? I am trying to do so by calling dispatchEvent() on flash player dom object but the event is not passing inside flash player. Any links or clue?

    To be specific ... I can catch a right click and supress it. But I want to send it to flash (lets say) as a left click. Problem is when i do that, javascript listner for dom element will get fired for left click but there wont be any events in flash.
    SO the question is can i fire events on flash from outseide or is it outside the public APIs?

  • Dispatching events between different classes

    Im trying to dispatch and event from an XML class.
    dispatchEvent(new Event (XMLClass.INDEX_CHANGED));
    and catch it in the display class
    import AS.XMLClass;
    private var _xml  = new XMLClass();
    _xml.addEventListener(XMLClass.XML_LOADED, swapImage);
    I know that im missing something because the application works
    and the function runs but its not dispatching the event the event
    or maybe it's not catching the event in the display class, even though everything else is working
    and im not gettin' any errors.

    that's exactly what i did.
    i have 3 classes
    AS.XMLClass
    AS.ControlClass
    AS.DisplayClass
    It's like a slideshow thing.
    I have a button on stage thats connected to the control class and every time you press it
    it changes the index of the image in the xmlclass and everytime that the index is changed the xmlclass needs to
    dispatch and event that the index has changed and the display class is going to catch the event and change the image
    everything is working except the xmlclass dispatch event or the displayclass catch event
    XMLCLASS
    public static const INDEX_CHANGED:String = "indexChanged";
    private function dataLoaded(event:Event):void{
                trace("xml file is loaded");
                data = new XML(loader.data);
                dispatchEvent(new Event(XMLClass.XML_LOADED));
                totalItems = data.images.photo.length();
                setCurrentIndex(currentIndex);
    CONTROL CLASS
    import AS.XMLClass;
    private var _xml = new XMLClass();
    public function leftButtonClicked(){
                _xml.setCurrentIndex(_xml.currentIndex = _xml.currentIndex - 1);
            public function rightButtonClicked(){
                _xml.setCurrentIndex(_xml.currentIndex = _xml.currentIndex + 1);
    DISPLAY CLASS
    import AS.XMLClass;
    private var _xml  = new XMLClass();
    _xml.addEventListener(XMLClass.XML_LOADED, swapImage);
    public function swapImage(event:Event){
                trace("working....");

Maybe you are looking for

  • Sending photos from my iPad

    have taken a few photos with my iPad2 but they don't reach  the email addresses i send them to. the proceedure seemed simple but it's not working. a little help please.

  • Experiences around the nCo 3.0 RfcDestinationManager

    Hello everyone, I'm very interested in your application architecture around the .NET connector 3.0. For example I just don't manage to be friends with the RfcDestinationManager Example 1: Okay so there's this MAX_POOL_SIZE and POOL_SIZE setting. Acco

  • Compilation error, no  /opt/SUNWspro/bin/cc on Solaris 10 64bit(x86)

    I was trying to compile Apache mod_jk on Solaris 10 64bit platform(x86) and I got the following error. I checked my system and I do not have /opt/SUNWspro/bin/cc. Any suggestions how to solve it? root@unknown >./configure --with-apxs=/usr/apache2/bin

  • Flash Player refuses to run, if outdated.  Can I change this setting?

    I work in a video production environment -- tonight we ran into a problem where a couple of live monitoring systems were not working because Flash refused to run; presumably, because it's out of date.   In this case, the systems are "Deep Frozen" (lo

  • One to one relation webapplication and portal?

    Going through the documentation and the newsgroups for WLCS 3.5 and Personalization Server 3.5 I can't seem to find out wether or not there is a one to one relation between a webapplication and a portal. I mean, can I have more than one portal in a w