Eventing Between Components

Hi,
If my application is a vbox with two children - 1) Canvas
with a Input Text 2) Canvas with DataGrid.
How does one go about setting the 'Input Text' to the
selected item on the DataGrid?
As we are trying to write generic components, the DataGrid
should not know anything about its parent.parent, so I thought
about using Event. When an item is selected on the DataGrid, it
dispaches a CustomEvent which 1) is listening. This howver does not
work :-(( Any help is greatly appreciated.

Okay I saw a earlier posting from FlightGuy which pointed out
that I need to set Bubble to true for my event. Thanks

Similar Messages

  • Howto eventing between components

    Hi All...
    I am designing a program, and decided to implement each feature in a class which extends JPanel
    i decided to use Observer design pattern to inform special feature(JPanel) when event occur.
    I saw that there is an implementation of observer(java.util.Observable) and decided to use it but its required that my feature(JPanel) will extends from Observer(But I already extends JPanel)
    My questions are:
    1) Should I extends JPanel and implement Observer as interface?
    2) Should I extends Observer and use JPanel as private variable in the class?
    3) Is there other preferred technique for communicating dissimilar objects when designing GUI?
    Many Thanks for the help
    YyYo

    >
    but I don't understand why +"...Also, this may not be advisable+..."
    You should only subclass another class ie (extends JPanel) if you need to change its default behavior by overiding some of its methods. For example it is a very common occurence to do custom paiting on a JPanel and therefore you must extend JPanel and override paintComponent() method.
    However if you do not need to change the default behavior just use encapsulation ie
    class MyClass{
       JPanel myPanel;
    }Lastly if you do wish to use obsever pattern, and I think it is perfectly acceptable to use this instead of changelistener your model should extend java.util.Observable and your gui should implement Obeser.
    Calypso

  • Is there any event that triggers when you switch between components?

    is there any event that triggers when you switch between components?
    like for example... when i switch between components, i need a function to fire everytime i switch...
    ive tried show, hide, and initialize... and none of them work...
    any ideas or help is greately appretiated!!

    Depends on what you are trying to do,
    you have mouseover and mouseout and mouseclick events which you can use on the component and write code to deal with what you want to happen when you change focus. You have keypress event which would allow you to monitor tabbing between components, remember that in most events the currentTarget and target values will give you the information you need to handle component interaction.
    so
    [Bindable] private var CurrentObject: Object; <-------  use this as a pointer to what ever object you are currently focused on or just to indicate things have changed
    addeventListener(MouseEvent.CLICK,myCompponentSwap);
    protected function myComponentSwap(e:event): void
        if (CurrentObject !=e.currentTarget && CurrentObject != null)
             do what you want becuase a component switch just happened
        CurrentObject = e.currentTarget;
    Hope this gets you started.
    David

  • How to handle events between two custom components?

    Hi ,
         i want to handle events between two custom components, example if an event is generated in one custom component ,and i want to handle it any where in the application.....can any one suggest me any tutorial or meterial in this concept...
    thanks

    Events don't really go sideways in ActionScript by default. They bubble upward. If you want to send an event sideways, you will probably have to coordinate with something higher up in the event hierarchy. You can send the event to a common ancestor, and then pass it down the hierarchy as a method argument.
    Another option is to use a framework that supports Injection. There are a number around these days. The one I'm most familiar with is Mate, which allows you to handle events and inject data in MXML. Mate is meant to be used as an MVC framework, and you may want to look into it if your application is complex, but you can also use it to coordinate global event handling if you don't need that level of structure.

  • Tab between Components

    Hi
    In my application I want the user to be able to tab between components. The order should be as follows - tree, radio button, table, button. I have no problem going from tree to radio button to table, but once in the table if you keep pressing tab if just cycles through the rows.
    I use the setNextFocusableComponent(component) method. Here is a snippet of my code :
    tree.setNextFocusableComponent(radioButton);
    radioButton.setNextFocusableComponent(table);
    table.setNextFocusableComponent(button1);
    Any suggestion on how to solve this problem are welcomed
    Thanks
    Bernie-wolf

    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    public class Ex {
        public static void main(String[] args) {
            final JFrame f = new JFrame("Ex");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            final JTable t = new JTable(10,10);
            t.setSurrendersFocusOnKeystroke(true);
            KeyStroke tab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0);
            KeyStroke ctrl_tab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.CTRL_DOWN_MASK);
            KeyStroke[] forward = {tab, ctrl_tab};
            Set forward_set = new HashSet(Arrays.asList(forward));
            t.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, forward_set);
            final DefaultCellEditor editor = (DefaultCellEditor) t.getCellEditor(0,0);
            JTextField editorComp = (JTextField) editor.getComponent();
            editorComp.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, Collections.EMPTY_SET);
            Action myTabAction = new AbstractAction("myTabAction") {
                public void actionPerformed(ActionEvent evt) {
                    editor.stopCellEditing();
                    t.transferFocus();
            editorComp.getInputMap().put(tab, myTabAction.getValue(Action.NAME));
            editorComp.getActionMap().put(myTabAction.getValue(Action.NAME), myTabAction);
            f.getContentPane().add(new JScrollPane(t));
            f.getContentPane().add(new JButton("somewhere else for the focus to land"), BorderLayout.SOUTH);
            f.setSize(400,300);
            f.show();
    }1. I always setSurrendersFocusOnKeystroke(true). Otherwise, the user starts typing, editing begins, but the text field doesn't get focus immediately: no cursor appears, and VK_LEFT and VK_RIGHT cause focus to go to the adjacent cells, instead of moving the cursor within the text field.
    2. As the previous poster notes, JTable recognizes ctrl+tab as a request to move focus to the next component. Unfortunately, this doesn't work when editting a cell. I also have a beef with JTable: VK_LEFT and VK_RIGHT already let you traverse cells, why not let tab move focus to the next component?
    3. Anyway, in my code above, I change the focus travesal keys so that tab works the way the OP wants it, assuming the table has focus.
    4. What if the cell editor's text field has focus? Here my code is hacky, and I hope another poster can improve it. I add an action that (a) stops cell editing (this is what happens when you press enter), then (b) moves focus along.

  • Does table STPOX contain parent-child relationship between components

    Hello
    I need to get a list of components of SO BOM.
    FM CS_BOM_EXPL_KND_V1 exports an output table STPOX.
    Does this table contain parent-child relationship between components? If yes , can somebody tell me which fields contain parent child id.
    thanks

    Hi,
    STPOX is not a table, it is a structure & hence there is no storing of data in a structure. The table which stores this info is STPO.
    To get the link you can refer to STPO-STLNR & pass this value to MAST-STLNR, this way you can link the child with its parent.
    Regards,
    Vivek

  • How to Exchange Data and Events between LabVIEW Executable​s

    I am having some trouble determining how to design multiple programs that can exchange data or events between each other when compiled into separate executables. I will layout the design scenario:
    I have two VIs, one called Status and the other Graph.  The Status VI displays the serial number and status of each DUT being tested (>50 devices).  The Status VI has one timed loop along with a while loop that contains an event structure.  If the user clicks on the DUT Status Cluster the event structure needs to pass the serial number to the Graph VI.  The Graph VI when called fetches the records for the DUT based on the Serial Number and time frame.  This VI is a producer/consumer so the user can change the time frame of the records to display onto the front panel graph.
    I have a couple reasons the VIs need to be separated into independent applications. One being the underlying database fetches tends to slow the threads down between the two VIs; the other is that they may be distributed into separate systems (don't consider this in the design criteria).
    I have been researching the available methods to pass the serial number to the Graph VI.  My initial idea was to us a command line argument, but this does not allow the Status VI to pass another Serial Number to the Graph once it has started (I do not want to allow the user to execute multiple Graph applications because the database query can load down the server).
    Is there a program method that I can implement between the two VIs that will allow me to compile them as two executables, and allow the Status program the repeatedly send an updated serial number event to the Graphs program.
    I have reviewed many methods; Pipes (oglib_pipe), Action Engine, and Shared Variable.  I am not sure which method will give me the ability to use a Event driven structure to inform the Graphs program when to update the serial number.  Any suggestions and tutorials or examples would be greatly appreciated.

    I have used the Action Engine (aka: functional global) approach for many years and it works well. Something to think about is that if you make the event's datatype a variant the only code that will need to know the actual structure of the event will be the function that needs to respond to it. Hence, a single event can service multiple functions.
    Simply create a cluster containing an enum typedef that is a list of the functions that the event will service, and a variant that will be the function event data. From anywhere in the code you can fire the event (via the functional global) by selecting the function from the enum and converting function specific data to a variant. On the receiving end the event handler uses the enum to determine the function that is to get the data and sends the variant to it. The event handler doesn't know or care what the actual event data is so you could in theory add new functions without modifying the event handler.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Eventing between iView and nested iView

    I try to make an Event between an iView and an nested iView. I followed the instruction on page 164 in the reference guide and tried some other things, but it doesn´t work. I make an output Port on the one side, there i could select the fields to be displayed. But when I compose the Input Port , there are no field to see.
    So what make I wrong?

    Hello Marcus,
    the main thing about the desired eventing seems to be that when you have placed your data service in the nested iview you have to create a signal-in port<b> by pulling a data connection out of the input port of the data service</b> to create the input-port of your nested iView. Only this way, the port is filled with the input data of the data service.
    Back in your main iView you can connect the data flow to the newly created port of your nested iView the same way as you connect to a data service. You then should see the input fields of the data service that you placed in the nested iView and be able to assign values to the input fields.
    Hope that helps
    cheers
    Gerhard

  • Eventing between Web Dynpro iView and regular DynPage iView

    I have seen, done eventing between two dynpage iviews and two webdynpro iviewsHowever, and gone through "How to Use the Portal Eventing for Web Dynpro iViews". However, I have been trying to have a webdynpro iview talk to a dynpage iview but they just won't communicate. Is this even possible?
    Ok basically I have a portal page in a popup window with no masthead and top level navigation. The page has two iviews -  the top one being an iView that points to a webdynpro application on Server A, and the bottom one being a dynpage iview on the Portal Server B.
    In the webdynpro iview, the code for when a button is clicked is
    public onSomeAction(Event event) {
        WDPortalEventing.fire("urn:myUrn","eventName","value");
    In the dynpage iview, the code i have for it is
    myServ = (IEpcfToolbox) PortalRuntime.getRuntimeResources().getService(IEpcfToolbox.KEY);
    myReceiver = myServ.getClientEventReceiver(request, "urn:myUrn", "eventName");
    form.addRawText(myReceiver.getWrappedScript());
    try {
        if (!myReceiver.isReceived()) {
            form.addComponent(createMainScreen());
        } else {
         form.addComponent(new TextView("event received!"));
    } catch (Exception e) {       
        form.addComponent(createErrorScreen());
    I tried all the things I could think of but the receiving iView just won't get the event fired.
    Can someone confirm that this should work? and correct me where I've done wrong.
    Please help. this is very urgent. your help will be greatly appreciated. thanks in advance
    PS. My environments are EP 6.0 SP2 and WAS 6.40 SP14

    > hi,
    >
    > portal eventing  works properly if all participants
    > are in the same domain. Otherwise portal eventing
    > g does not work. If the SAP J2EE
    > Engine on which the Web Dynpro application is
    > deployed is in another domain, you have to  map the
    > IP address of the SAP J2EE Engine to the domain name
    > of the
    > SAP J2EE Engine on which the SAP Enterprise Portal is
    > running, by editing the configuration file hosts.
    >
    > regards,
    >
    > Ganesh.N
    I am no direct access to the boxes so I can't try your suggestion. It really makes sense that eventing won't work if the iViews are on different domains. I know they are in the same domain but different subdomains.
    Anyway, good news I got eventing to work with the mentioned set. I found that that the SAP Java EPCFToolbox API had a bug that kept throwing javascript errors when I tried to have the web dynpro iview fire an event and the SAP one subcribed to it.
    I got around it but using the EPCF Javascript API instead.
    Code:
    response.write("<script>");
    response.write("EPCM.subscribeEvent('urn:dla.telework', 'createPdf', doSomething);");
    response.write("function doSomething() {");
    response.write("window.location = self.location + '&eventReceived=true';");
    response.write("}");
    response.write("</script>");
    So basically just output raw text through the response object and it just works.
    On a similar topic, since eventing can only pass string parameters back and forth, I'm still looking for a way to pass other more complex Java objects between web dynpro and sap iviews. From what I haven't they don't share the same session object (which I thought they did). So basically I can't just stick stuff in the session and pull it down on the other end. I'm clueless right now. If anybody has some tips, plesae share. Thanks

  • Spacing between components change due to screen resolution

    Hello All,
    I am using GridBagLayout for desiging a screen for my application. I had defined the spacing between each component and had run the application in my system. It is working fine. But if the same code is run from another system with a different screen resolution, the spacing between components get altered. Can you plz give a solution to make the spaicing between components fixed despite the screen resolution.
    Thanks in advance.

    how do you mean this? did you define the insets of the constraints for some components? normally they don't belong to the screen resolution, because the frame has a size that is calculated with the sizes of all it's children. or do you have the frame maximized?

  • Portal eventing between WD java and BSP popup

    Hi guys,
    I have a WebDynpro application that opens a BSP popup like that :
    WDPortalNavigation.navigateAbsolute(
              wdContext.currentURLElement().getEvaluationURL(),
              WDPortalNavigationMode.SHOW_EXTERNAL,
              "directories=no location=no menubar=no resizable=yes status=no toolbar=no",
              "evaluationdeformation",
              WDPortalNavigationHistoryMode.NO_DUPLICATIONS,
              urlParam.toString()
    When the popup is closed, I want to update the content of my webdynrpo application. I tried using portal eventing but it didn''t worked because the popup doesn't seem to know its opener....
    Is anybody have an idea ?
    Thanks in advance.
    Julien.

    Hi Julien,
    have you made sure that your BSP application is using EPCF? There is a flag you need to set to X in your BSP app for this to take effect. Also, you can not add javascript to a WD app, so calling the window.opener will not make any difference. However, you can subscribe to an event raised by another application in your WD app. It is possible to raise events between windows, one being a bsp and the other a WD or portal application. Check the following threads.
    [Portal Eventing: EPCMPROXY calls between two browser windows;
    [Client side eventing between MSS teamviewer and BSP application;
    Cheers,
    Dion

  • Eventing between three iviews

    Hi all,
    I implemented three Iviews in a model and tried to define eventing between them in the following manner:
    - Output of iView1 is input of iView2
    - Output of iView2 is input of iView3
    Eventing is functioning well between iView1 and iView2, but it isn't doing between iView2 and iView3.
    Does eventing only work between two iViews once a page? Do I need a different EPCM event than "com.sap.visualcomposer:epcm" for the eventing between iView2 and iView3.
    Regards,
    Elyes

    Hi
    Did you give the event between iview1 and 2 and iview 2 and 3 different names.
    Jarrod

  • How to pass data between components?

    Hi everyone,
    How can I pass data between components? If possible, please
    give me sample code. Thanks.
    Note: I am using Flex 3.
    May

    There are lots of examples in the doc. You can start here:
    http://livedocs.adobe.com/flex/3/html/mxmlcomponents_advanced_1.html
    Stephen

  • Event Structure Components in Eval Version?

    Does the Labview Eval Version include the Event Structure Components? If so, where are they located? If not, that is very lame. It is very difficult the experiment with functionality without them.

    You get everything you possibly want with the evaluation version.  As others have said, it's basically the professional version.
    In addition, you can evaluate any toolkits and modules. (not sure if there are minor exceptions?)
    Once you purchase a license, they license determines what you are allowed to use. The DVD is the same for all versions.
    AFAIK, you can evaluate almost anything without jumping through any hoops. Even if you have an existing activated LabVIEW installation, you can later evaluate a toolkit or module with it.
    LabVIEW Champion . Do more with less code and in less time .

  • Portal eventing between pages

    Hi,
    I read around that portal eventing can be done only on the same page and not between pages, is this correct? if so, how do we make events between pages after all?
    Thanks in advance,
    Aviad

    Hi Aviad,
    Portal eventing takes place between different iviews of the same page only.
    To pass between values between different pages, you can store the required value in a Portal Request object or Session object.
    Also you can refer to this link,
    iView to iView communication with EPCF
    This link  contains the code to establish connection between pages .Finally obtaining paramaters through request.getParamater().
    Hope this helps,
    Regards
    Uma.
    Note: It will be better from next time if you could post portal related queries in the EP forum to get quicker responses and ep related guidances.

Maybe you are looking for

  • Thunderbolt 2 devices on a Thunderbolt 1 Macbook, possible?

    Can I connect Thunderbolt 2 Devices (e.g. an external RAID array) to a Thunderbolt 1 port on my Macbook Pro?  I want to get a new Thunderbolt 2 RAID array like this one that is relatively future proof for the new MacPro "tower."  However, I would als

  • Problem with Table with Tree

    I have followed Integration of a Tree Structure in a Web Dynpro Table from SDN, all cofigurations are done and it is retrieving values correctly. But, the subtree entries are not get added to the corresponding nodes. All sub values are added to the e

  • Using similiar methods as BufferReader for reading files from web

    Hello! I need to read an xml-file in my application. Until now I have used BufferReader-class for that purpose, but the xml-file was located in my hard disk. No I need to get the same file but from the web. Can anyone, please, give me some simple exa

  • ESC key does not work when Photoshop CS4 is opened

    Hi everyone! It seems that everytime my Photoshop CS4 is opened, my ESC key ceases to function. When I close the PS, it starts to function again. Running Windows 7 64-bit. I've tried cleaning my registry and reloading PS. Not that critical, but it go

  • After install applications not working

    After installing Leopard I have had many problems. Specifically, the computer won't sleep, iWork & iLife software not working well. Pages files won't open. DVD Studio Pro won't compress. Compressor won't compress in any format. Help