Question on event

What's the type of the new value for many condition in a event loop. The wire has a dark mauve color ?
Thx

Ok, the reason that you have a variant datatype is because you have two controls with different datatypes assigned to the same event. The attached code shows how you can tell which one actually fired the event and convert the variant back into a standard LV datatype.
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
Attachments:
question-1.vi ‏15 KB

Similar Messages

  • MDM iView resultset problem and question about eventing

    Hi experts,
    I created a MDM iView resultset for my main table as search table (comparison is not supported). When I click on preview I get an empty table ("Found <Tablename>: 0 of 10", table contains 10 entries at the moment). I tried the same with a subtable and everything works fine (all entries have been in the preview table). Any ideas why I don't get a result?
    My 2nd question: can I choose the parameter name in eventing (EPCF) on my own? So if I have Vendor_Id as field can I use vendorid as parameter name? Do I have to define anything in the listener iView (e.g. in detail iView for an event from resultset iView)? Maybe you have a useful tutorial link (please not SAP help section)?
    Thanks for your answers.
    Regards, bd

    It is possible to retrieve the number of rows from a resultset --
    Statement stmt= con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
                                        ResultSet.CONCUR_READONLY);
    ResultSet rs= stmt.executeQuery("<your select query here>");
    int totalRows;
    if (rs.last()) // can it move to the last row?
       totalRows= rs.getRow(); // get its row number
    else
       totalRows= 0; // no rows in the resultset
    rs.first() // set the cursor back to the startNote that the resultset has to be scrollable (TYPE_SCROLL_INSENSITIVE).
    kind regards,
    Jos

  • Questions on events in a multi-class GUI

    I have a GUI application that is constructed as follows:
    1. Main Class - Actually creates the JFrame, contains main method, etc.
    2. MenuBar Class - Constructor creates a new JMenuBar structure and populates it with various JMenus and JMenuItems. A new instance of this class is instantiated in the Main Class to be used in the setMenuBar() method.
    3. ContentPane Class - Constructor creates a vertical JSplitPane. A new instance of this class is instantiated in the Main Class to be used in the setContentPane() method.
    4. BottomPane Class - Constructor creates a JPanel and populates it with various stuff. A new instance of this class is instantiated in the Content Pane Class to be used as the bottom pane in the vertical JSplitPane.
    5. TopPane Class - Constructor creates a horizontal JSplitPane and populates the left pane with a JScrollPane containing a JList. A new instance of this class is instantiated in the Content Pane Class to be used as the top pane in the vertical JSplitPane.
    6. TabbedPane Class - Constructor creates a JTabbedPane. A new instance of this class is instantiated in the Top Pane Class to be used as the right pane in the horizontal JSplitPane.
    7. DisplayPane Class - Constructor creates a JPanel. A new instance of this class is instantiated in the Tabbed Pane Class as the first tab. The user has the ability to click at points in this pane and a dialog box will pop up prompting the user for a string. Once the user enters something and clicks "OK", an instance of a custom Java2D component that I've created will be added to the DisplayPane where the user had clicked, with the string the user inputted being used as its name. The user can then drag the component around, enter a key combination to display all the names, etc.
    8. Custom Java2D Component Class - Constructor creates my custom Java2D component. Instances of this are added to the Display Pane Class, as I have described.
    Now, originally, I was going to ask "How do you work with events between these multiple classes?" but I have solved half of that problem myself with the following class:
    9. Listener Class - A new instance of this class is declared in the constructor of the Main Class, and is thus passed down through the GUI hierachy via the constructors of the various classes. I then use the addActionListener() method on various components in the other classes, and then the Listener Class can capture an event using the getActionCommand() method to figure out what fired the event.
    So that covers the "How do I capture events in multiple classes?" question. Now I'm left with "How do I affect changes on those classes based on events?"
    For example: In my MenuBar class, I have a "Save" menu item. When this is clicked, I want to declare a new JFileChooser and then use the showSaveDialog() method, which throws up a dialog for saving a file. The problem is, the showSaveDialog() method takes a Component which is the parent frame. Obviously the Listener Class is not a frame. I want to use the Main Class as the parent frame. How would I do this sort of thing?
    Another example: In my MenuBar class, I have a "New" menu item. For now, I want this to invoke a method in the DisplayPane Class that erases all of my custom Java2D components that have been made, thus giving the user a clean slate. How would I give my Listener Class access to that method?
    A final example: Every time the user adds one of my custom Java2D components, I want that component's name to be added to the JList that is in my TopPane class. Vice versa with deleting a component: its name should be removed from the JList. How would I listen for new components being added? (A change listener on the pane? One on the ArrayList<> that contains all of the components? Something else?) And, of course, how would I give the Listener Class the ability to change the contents of the JList?
    One idea I've come up with so far is to instantiate a new instance of each of my GUI classes in the Listener class, but that doesn't really make much sense. Wouldn't those be new instances that are totally separate from the instances the rest of my program is using? Another thought is to make the Listener Class an internal class inside the Main Class so that it can use the accessor methods of the GUI classes, but a.) I would like to avoid stuffing everything in one class and b.) this brings up the question of "How would I get an accessor method that is in a class that is two or three deep in the hierarchy?" (.getSomething().getSomethingInsideThat().getSomethingInsideTheInsideThing()?)
    Help with answering any or all of my questions would be much appreciated.

    Hrm. At the moment, for my first attempt, I'm doing something similar, it just strikes me as quite unwieldy.
    Start of Listener class, with method for setting what it listens to. (I can't use a constructor for this because the MenuBar and the ContentPane take an instance of
    this Listener class in through their constructors. You can't pass the Listener in through their constructors while simultaneously passing them in through this
    Listener's constructor. That would be an endless cycle of failure. So I just instantiate an instance of this Listener class, then pass it in through the MenuBar and
    ContentPane constructors when I instantiate instances of them, and then call this setListensTo() method.)
    public class Listener implements ActionListener
      private MenuBar menuBar;
      private ContentPane contentPane;
      public void setListensTo(MenuBar menuBar, ContentPane contentPane)
        this.menuBar = menuBar;
        this.contentPane = contentPane;
      }The part of my actionPerformed() method that does some rudimentary saving, which I will make more complicated later:
    else if (evt.getActionCommand() == "saveMenuItem")
      JFileChooser fileChooser = new JFileChooser();
      int returnVal = fileChooser.showSaveDialog(menuBar.getTopLevelAncestor());
      if (returnVal == JFileChooser.APPROVE_OPTION)
        File file = fileChooser.getSelectedFile();
        ArrayList<Node> nodes = contentPaneClass.getTopPaneClass().getTabbedPane().getDisplayPane().getNodes();
        try
          BufferedWriter out = new BufferedWriter(new FileWriter(file));
          for (int i = 0; i < nodes.size(); i++)
            Node node = nodes.get(i);
            out.write(node.getIndex() + "," + node.getXPos() + "," + node.getYPos() + "," + node.getName());
            out.newLine();
          out.close();
        catch (IOException e)
          //To be added                    
    }That part that seems unwieldy is the
    ArrayList<Node> nodes = contentPaneClass.getTopPaneClass().getTabbedPane().getDisplayPane().getNodes();The reason I'm using a separate Listener class is because if I put, say, the actions for the MenuBar in the MenuBar class, and then want to save stuff in the JPanel
    at the bottom of the hierachy, I would have to go up from the MenuBar into the JFrame, and then back down the hierachy to the JPanel, and vice versa. Kind of like
    walking up a hill and then down the other side. I imagine this would be even more unwieldy than what I'm doing now.
    On the plus side, I am making progress, so thanks all for the help so far!

  • Question about Events stored on an external drive

    Hello guys! I recently freed up a TON of space on my iMac by adding an external hard drive and you guys advised me on how to get iMovie '08 to store my Events there.
    Question: I'm going to Rome Italy tomorrow and I'm going to be doing a ton of video footage. My Macbook doesn't have the hard drive space to hold what I'm going to be shooting.
    So, my question is......considering that I'm using this external drive to store Events from my iMac will I be able to to use that same external drive on this trip to manage Events on my MacBook?
    In other words, I just want to make sure that I don't confuse either version of iMovie that I have operating on these two different machines. Can I use this same external hard drive to manage Events from both machines?
    Thanks in advance for the speedy assistance. I'm leaving tomorrow and need to get this issue nailed down.
    Thanks!
    Tony

    I actually have no set-up to test my speculations but...:
    when you tell iM08 to store Events on some ext. drive, it creates on 'Top Level' of that drive the 'iMovie Events' folder..
    so, when you do that with a second Mac/iMovie... I guess, it will confuse the file management.. (=you can not create two indentically named folders... ) ... and, I guess, you can not create/select a sub-folder for the Events...
    best practise would be to partition the drive.. but that isn't possible without erasing any content on your drive..
    Plan B) invest 100$ for a 2nd drive.. ? (last week offer: 79€ for 500 gigs.. no bad... )

  • IMovie Trailer Question about Event

    When I attempt to create a trailer I'm presented with a dialog box that asks me to create a title (no problem) and an event. I don't understand what event I should select. None of the media that I will use is in any of the listed events. I will be using photos from my iPhoto library.
    Since I have to select an event I am at a standstill.
    Help!

    Hi C Nelson,
    I apologize, I'm a bit unclear on the exact nature of your question. If you are having issues using the Trailer function in iMovie, you may find the following article and walkthough helpful:
    iMovie '11: Create a trailer
    iMovie ’11: Create a Trailer (video walkthrough)
    Regards,
    - Brenden

  • Question about event handling in JComponents

    I have often found it useful to create a component that acts as an event handler for events the component generates itself. For example, a panel that listens for focus events that effect it and handle these events internally. (See below).
    My question is: Can this practice cause synchronization issues or any other type of problem that I need to watch out for? Is it good/bad or neither. Are there any issues I should be aware of?
    Thanks in advance for the help.
    Example:
    public class qPanel extends JPanel implements FocusListener
    public qPanel () {
    super.addFocusListener(this);
    public void focusGained(FocusEvent e) {
    //Do stuff
    public void focusLost(FocusEvent e) {
    //Do stuff
    }

    Hi,
    Handling events this way is completely fine and saves on number of classes. Only thing you may want to watch out for is that the handler methods have to be public. This means that someone could use your component and call one of the methods. For example, I could write:
    panel.focusGained(new FocusEvent(....))
    when it's not really gaining focus. So, if you're writing this component for re-use you might want to be aware of this.
    An alternative:
    Use a single internal class to handle all events. It can then delegate to private methods of your component. Example:
    class MyEventHandler implements FocusListener, MouseListener, etc... {
    public void focusGained(FocusEvent fe) {
    doFocusGained(fe);
    public void mousePressed(MouseEvent me) {
    doMousePressed(me);
    Then your component could have:
    private void doFocusGained(FocusEvent fe) {
    private void doMousePressed(MouseEvent me) {
    etc...
    Just ideas :)
    Thanks!
    Shannon Hickey (Swing Team)
    I have often found it useful to create a component
    that acts as an event handler for events the component
    generates itself. For example, a panel that listens
    for focus events that effect it and handle these
    events internally. (See below).
    My question is: Can this practice cause
    synchronization issues or any other type of problem
    that I need to watch out for? Is it good/bad or
    neither. Are there any issues I should be aware of?
    Thanks in advance for the help.
    Example:
    public class qPanel extends JPanel implements
    FocusListener
    public qPanel () {
    super.addFocusListener(this);
    public void focusGained(FocusEvent e) {
    //Do stuff
    public void focusLost(FocusEvent e) {
    //Do stuff

  • Hopefully simple question. Event ID 2 Task Category (2) Lenovo Message Center Plus Admin

    Hey group,
    Wanted to ask you guys what I was missing. In my event log as the title implies I have a Event ID 2 Task Category (2) error in Lenovo Message Center Plus Admin coming as a result of a 404 error. Issue is I don't know what page it is looking for when it is tossing me the 404 error. Is this a result of Lenvo Updater goofing up using the ADM templates for GPO or is this something else? Would be helpful if it registred the non working link it was trying to obtain so we could isolate it better. Thoughts on this? Thanks!

    try this when you download the file save it to your download folder then right click it and run as admin. it says there is no Lenovo Digital Signature I tried to install it didn't work but I did it this way and it worked
    Thinkpad R61 7733-1GU
    Thinkpad X61T 7762-54U
    Thinkpad X60T 6363-4GU
    Did a member help you today? Thank them with a Kudo!
    If a post answers your question, please mark it as an "Accepted Solution"!
    Regards,
    GMAC

  • Questions on Event Termination

    Hi Experts,
    Since long time I have few questions on terminating event.As I read some documentation I am aware of where it is used??but my question is for ex:My workflow has to trigger when a sales order is changed.I can use BUS2032,Event Changed to trigger my workflow here once the manual action is taken (sales order change) on va02 the workflow triggers I believe this is right.Will there would be any manual action required for terminating event ex:Deleted in bus2032.
    My sincere apologies if my questions are treated silly and million thanks for the answers.Thanks in advance.
    With Regards,
    Srini..

    I cannot present you the 100% explanation, but I can give you a example where we will come across the use of terminating events,
    1. Let us assume that you want to open a BSP or WDA from the R/3 Inbox ( SBWP ) , for this  one of the possibility is to create a external service  and then create a task for that External service.
    2. Once the task  is created, you can include this task in the in the simple activity step.
    3. Assume that the workflow is instantiated, and the workitem is in the users inbox, then once he excuets the workitem the respective application will be opend in a a browser, once the process is completed you will  close the  browser, but in the backend the workitem will still remain in InProcess state, this might be because the R/3 and system and browser might not have the right interface to communicate,
       so what can be done is in this situtation in the application coding, under the method close window will raise the event TERMINATED  of the bor WEBSERVICE.
    this makes sure that as soon as you close the window the workitem gets completed.

  • [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

  • Question on event object

    In the official flex tutorial. They called a function and
    passed in the event object, but they never used that object in that
    function. Why is that? I have realized several times in Day1 and
    Day2 tutorials. Here is the tutorial video:
    Link
    Here is partial of the code:
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var account:ArrayCollection;
    private function resultHandler(event:ResultEvent):void {
    employeeData = event.result.employees.employee;
    ]]>
    </mx:Script>
    <mx:HTTPService id="employeeService"
    url="data/employees.xml result="resultHandler(event)" />

    In the official flex tutorial. They called a function and
    passed in the event object, but they never used that object in that
    function. Why is that? I have realized several times in Day1 and
    Day2 tutorials. Here is the tutorial video:
    Link
    Here is partial of the code:
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var account:ArrayCollection;
    private function resultHandler(event:ResultEvent):void {
    employeeData = event.result.employees.employee;
    ]]>
    </mx:Script>
    <mx:HTTPService id="employeeService"
    url="data/employees.xml result="resultHandler(event)" />

  • A simple question about events

    I have created many event-based jobs. One task sends message to a queue to drive those tasks to run. If the task sends two message to the same event-based job in a very short time such that that job has not finished yet. Will that job run twice?
    And when the job is ready to response the message in the queue, if there are two messages in the queue. Will these two message be both dequeued or just one be dequeued and the job will response the second message later on? What I mean is this:somebody sends two message into the queue, will the event-based job run twice or just once? Thanks
    Message was edited by:
    KingMing

    Hi,
    In 10.2 the job ignores events that come in while it is responding to another event. So if two events come in at the same time, the job will begin running one of them and the other will be ignored.
    In 11g you can change this behaviour by setting the job attribute "PARALLEL_INSTANCES" to true for the job. If this is set to TRUE, then the job will run exactly once for every single message no matter when the messages come in.
    Hope this helps,
    Ravi.

  • New user question re Events folder after iPhoto import

    Hi there everyone
    I'm new to Aperture 3 having just bought it from the App Store earlier today. On the first launch of the app I chose to import the 14,000 or so images in my iPhoto library to Aperture 3, into its own library. It took a while, but all went swimmingly. I've now archived my old iPhoto library to an external HD (not currently mounted, or even attached usually...) and deleted it from my system drive.
    Now, here's the bit I don't quite understand... In the Inspector, under the Library browser tab there's a folder called iPhoto Library - it contains my old iPhoto libraries that were arranged in folders. All good. But there's also a folder called 'Events' which contains a long alphabetised list of what were iPhoto events, but appearing here as Aperture projects. I don't need this - and yet anytime I open a project by double-clicking it in the Browser, that Events folder springs open and takes over my Inspector. If I close the folder my Browser view empties too.
    As I understood it, any folders appearing in the 'Projects & Albums' section of the Library inspector are subsets of the main Library. And yet if I try to delete this 'Events' folder I first get a warning dialog (that I don't understand):
    Some versions based on these master files are included in albums outside of the selection.
    These versions will be removed from all Albums, Books, Light Tables, Web Pages, Web Journals, Slideshows, MobileMe Albums, Flickr Albums, and Facebook Albums.
    and if I go ahead with it then my entire Library disappears.
    If someone with better understanding of Aperture's organisational hierarchy could explain what's going on here, and hopefully how I can get rid of that 'Events' folder, I'd be most grateful.
    Thanks - Robin

    Thanks for taking the time to reply, Frank. In the meantime I did read the manual (again...) as well as googling extensively (again...) and picking up some organisational tips from youtube videos etc. At the very least I'm moving towards a more workable organisational system now.
    But to me this particular 'feature' of the application design seems odd. Compare it to another application that uses a library paradigm: iTunes. You import your albums and there's a dedicated browser for navigating them and finding the one you need. There's also a search system. (Just like Aperture...) If you choose to have any other items in the 'inspector' (I know that's not the right terminology) they're going to be playlists - specific subsets of the main library that serve a specific purpose. But you don't have to have any if you don't want or need them.
    If iTunes worked like Aperture 3 then every album imported would go into that dedicated browser/search system *and* appear at the 'top level' of the inspector as some sort of playlist-equivalent. But I couldn't remove it from the inspector, or hide it, because that would delete the actual album... I'd have two choices - leave them there and let the vertical height of the inspector become unworkable, or start filing them away in some rigid folder structure that I'd have to dream up just for the sake of visual organisation.
    iTunes doesn't work like that - neither does iPhoto, or mail, or any other application I can think of that's essentially library-based and has an inspector/browser feature. That seems odd.
    Put it another way - if Aperture did *not* act as it did, creating a new Event in the Projects & Albums section of the inspector, for every single import, what would be lost? I think nothing. You'd still have a dedicated browser and search system. You could still have albums and smart albums for subsets of photos you happened to be working on. A dedicated, separate organisational hierarchy could still be made for those people who needed to work in a different way.
    Like I say - it's workable, but seems odd. Maybe a month down the line I'll see the point of it and learn to love it. But I also wouldn't mind betting it won't survive into the next version of the application.

  • Question about event handling in a button

    I recently coded a console version of my java program (just outputs stuff into the system console and a logger). I am now adding a simple GUI with a set of buttons to start and stop the program. In order to do this, do I just copy paste the main function contents of the console version of my code into the button's event handlers or is there a way I can just run the main class? I was googling for Class loading in java but I'm not sure if this is what I should be looking at... Can someone please help me out?

    MyMainClass.main(new String[] { "the", "arguments" });
    // or, if you defined your main to use varags (i.e. as "public static void main(String... args)") then you can just use
    MyMainClass.main("the", "arguments");But you should really extract your functionality out of the main method into meaningful classes and methods and just use those from both your console code and your GUI code.

  • Question to: event data_changed of cl_gui_alv_grid

    Hi,
    i am using event data_changed of cl_gui_alv_grid in my z_ALV Report to check and save new added ALV entries.
    event: data_changed uses er_data_changed type CL_ALV_CHANGED_DATA_PROTOCOL
    case1: after inserting a new line and saving.
    The attribute: MT_INSERTED_ROWS and MT_GOOD_CELLS is filled with all needed information.
    case 2: but after inserting a new line then using "F4help" on one ALV field and saving.
    The attribute: MT_INSERTED_ROWS is empty and MT_GOOD_CELLS is filled with one ALV field(F4help) ?
    Any ideas what is going wrong here ?
    I checked: BCALV_EDIT_04 within both cases and it´s working fine.:
    The attribute: MT_INSERTED_ROWS and MT_GOOD_CELLS is filled with all data.
    Regards,
    Gordon

    OK,
    i made some tests and found out that only the last "F4 help" selected field, and it´s value, is inserted in the MT_GOOD_CELLS / MT_MOD_CELLS.
    example of my ALV insertion:
    field1: "hello"
    field2: "world"
    field3: (F4-help and selected "X")
    field4: "test"
    Saving: And now the MT_GOOD/MOD_CELLSis filled with FIELD3 and Value = 'X' ! but the rest is missing !
    Any ideas what is wrong or what i am missunderstanding her ?

  • PlEASE HELP EASY QUESTION: unload event is not firing at all.

    Hi, onUnload event is not firing in Safari browser. I tried with different ways to capture that event but i failed to capture that event. So please help me on this, give suggestions to capture that event. Or any other event is firing when window is closing. Actually, i need to execute when window is closing. But in Safari the window is closing without firing of any events.

    Safari doesn't execute the unLoad action when closing windows, period!
    It only executes it when loading another page.
    I might be wrong but I think Safari doesn't allow you to close a window with Javascript at all. All close events are blocked.
    Maybe a SWF file can do it somehow. But I'm not sure...

Maybe you are looking for

  • Query related to RM maintained for two MRP areas.

    Hi PP Gurus, The scenario is we modeled two Storage location MRP Areas say 1001 and 2001. There are two FG getting manufactured at them, say FG-1 at 1001 and FG-2 at 2001. Say there are three RMs viz. RM-1, RM-2, and RM-3. RM-1 and RM-2 included in F

  • Survey progress bar

    HI, Sharepoint 2013 survey with paging (page break questions) . I need a progress bar, I can see posts about using the task %complete field to generate a client side progress bar but ther's no such field in a Survey List. Whats my options ? Thanks

  • Wheres the Adobe Premiere Elements 10 icon?

    I just bought Adobe Photoshop Elements 10 with Adobe Premiere Elements 10 and I have a new HP Pavillion g6, Windows 7, i5 core, 2.4 processor. The package did not have any clear instructions for installing these programs but the discs said for MAC or

  • OPMN.exe has stopped working.

    Hi I have installed SOA suite on my laptop which is having a Vista Operating system.Installation went fine and when i started SOA Suite I'm getting an error as follows. OPMN.exe has stopped working Is this b'coz of my operating system is vista? your

  • Static data watermark

    hi to all of you Does anyone know something about static data watermarks. Any information could be helpful Thanks in advance Maddy