Using Events

I am very new to Java Programming. I have an assignment and am trying to catch a button click event. I would like to have a message pop-up with the proper name to SS # when they click the button and type in a SS#. Here is what i have so far. WHere do I go from here???
Thanks
//Import statements and header
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import java.text.SimpleDateFormat;
import java.util.Date;
public class EmpTmCd extends JFrame implements ActionListener
//declarations
private String toDay;
int hours = 8;
int pay = 10;
String LName = "To be determined";
String FName = "To be determined";
//setup r 1 and intialize variables
JPanel r1 = new JPanel();
int tWidth = 5;
int tWidth1 =15;
int tWidth2 = 13;
JLabel dateLabel = new JLabel("Date: ", JLabel.RIGHT);
JTextField mDateTextField = new JTextField(7);
//setup r 2
JPanel r2 = new JPanel();
JLabel SocialSecurityNumberLabel = new JLabel("Social Security Number: ", JLabel.RIGHT);
JTextField SocialSecurityNumber = new JTextField(tWidth1);
//setup r 3
JPanel r3 = new JPanel();
JLabel firstNameLabel = new JLabel("First Name: ", JLabel.RIGHT);
JLabel firstName = new JLabel(FName, JLabel.RIGHT);
//setup r 4
JPanel r4 = new JPanel();
JLabel InLabel = new JLabel("IN: ", JLabel.RIGHT);
JTextField In = new JTextField(tWidth);
//setup r 5
JPanel r5 = new JPanel();
JLabel OutLabel = new JLabel("Out: ", JLabel.RIGHT);
JTextField Out = new JTextField(tWidth);
//setup r 6
JPanel r6 = new JPanel();
JLabel lastNameLabel = new JLabel("Last Name: ", JLabel.RIGHT);
JLabel lastName = new JLabel(LName, JLabel.RIGHT);
//setup r 7
JPanel r7 = new JPanel();
JLabel In2Label = new JLabel("IN: ", JLabel.RIGHT);
JTextField In2 = new JTextField(tWidth);
//setup r 8
JPanel r8 = new JPanel();
JLabel Out2Label = new JLabel("Out: ", JLabel.RIGHT);
JTextField Out2 = new JTextField(tWidth);
//setup r 9
JPanel r9 = new JPanel();
JLabel sickLeaveLabel = new JLabel("Sick Leave: ", JLabel.RIGHT);
JTextField sickLeave = new JTextField(tWidth1);
//setup r 10
JPanel r10 = new JPanel();
JLabel In3Label = new JLabel("IN: ", JLabel.RIGHT);
JTextField In3 = new JTextField(tWidth);
//setup r 11
JPanel r11 = new JPanel();
JLabel Out3Label = new JLabel("Out: ", JLabel.RIGHT);
JTextField Out3 = new JTextField(tWidth);
//setup r 12
JPanel r12 = new JPanel();
JLabel personalLeaveLabel = new JLabel("Personal Leave:", JLabel.RIGHT);
JTextField personalLeave = new JTextField(tWidth2);
//setup r 13
JPanel r13 = new JPanel();
JLabel In4Label = new JLabel("IN: ", JLabel.RIGHT);
JTextField In4 = new JTextField(tWidth);
//setup r 14
JPanel r14 = new JPanel();
JLabel Out4Label = new JLabel("Out: ", JLabel.RIGHT);
JTextField Out4 = new JTextField(tWidth);
//setup r 15
JPanel r15 = new JPanel();
JLabel lastName1Label = new JLabel("Notes", JLabel.RIGHT);
JTextField lastName1 = new JTextField(tWidth2);
//setup r 16
JPanel r16 = new JPanel();
JLabel In5Label = new JLabel("IN: ", JLabel.RIGHT);
JTextField In5 = new JTextField(tWidth);
//setup r 17
JPanel r17 = new JPanel();
JLabel Out5Label = new JLabel("Out: ", JLabel.RIGHT);
JTextField Out5 = new JTextField(tWidth);
//setup r 18
JPanel r18 = new JPanel();
JLabel lastName2Label = new JLabel("Notes", JLabel.RIGHT);
JTextField lastName2 = new JTextField(tWidth2);
//setup r 19
JPanel r19 = new JPanel();
JLabel In6Label = new JLabel("IN: ", JLabel.RIGHT);
JTextField In6 = new JTextField(tWidth);
//setup r 20
JPanel r20 = new JPanel();
JLabel Out6Label = new JLabel("Out: ", JLabel.RIGHT);
JTextField Out6 = new JTextField(tWidth);
//setup r 21
JPanel r21 = new JPanel();
JButton submit = new JButton("Submit");
JButton reset = new JButton("Reset");
//Method for layout manager and container
public EmpTmCd(){
super("EmpTmCd");
setSize(550, 350);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
FlowLayout layout = new FlowLayout();
Container pane = getContentPane();
pane.setLayout(layout);
//Methods to place components on the input screen
FlowLayout layout1 = new FlowLayout();
r1.add(dateLabel);
r1.add(mDateTextField);
pane.add(r1);
setContentPane(pane);
setVisible(true);
//call the getDate method which returns the current date
toDay = getDate();
FlowLayout layout2 = new FlowLayout();
r2.add(SocialSecurityNumberLabel);
r2.add(SocialSecurityNumber);
pane.add(r2);
setContentPane(pane);
setVisible(true);
FlowLayout layout3 = new FlowLayout();
r3.add(firstNameLabel);
r3.add(firstName);
pane.add(r3);
setContentPane(pane);
setVisible(true);
FlowLayout layout4 = new FlowLayout();
r4.add(InLabel);
r4.add(In);
pane.add(r4);
setContentPane(pane);
setVisible(true);
FlowLayout layout5 = new FlowLayout();
r5.add(OutLabel);
r5.add(Out);
pane.add(r5);
setContentPane(pane);
setVisible(true);
FlowLayout layout6 = new FlowLayout();
r6.add(lastNameLabel);
r6.add(lastName);
pane.add(r6);
setContentPane(pane);
setVisible(true);
FlowLayout layout7 = new FlowLayout();
r7.add(In2Label);
r7.add(In2);
pane.add(r7);
setContentPane(pane);
setVisible(true);
FlowLayout layout8 = new FlowLayout();
r8.add(Out2Label);
r8.add(Out2);
pane.add(r8);
setVisible(true);
FlowLayout layout9 = new FlowLayout();
r9.add(sickLeaveLabel);
r9.add(sickLeave);
pane.add(r9);
setContentPane(pane);
setVisible(true);
FlowLayout layout10 = new FlowLayout();
r10.add(In3Label);
r10.add(In3);
pane.add(r10);
setContentPane(pane);
setVisible(true);
FlowLayout layout11 = new FlowLayout();
r11.add(Out3Label);
r11.add(Out3);
pane.add(r11);
setVisible(true);
FlowLayout layout12 = new FlowLayout();
r12.add(personalLeaveLabel);
r12.add(personalLeave);
pane.add(r12);
setContentPane(pane);
setVisible(true);
FlowLayout layout13 = new FlowLayout();
r13.add(In4Label);
r13.add(In4);
pane.add(r13);
setContentPane(pane);
setVisible(true);
FlowLayout layout14 = new FlowLayout();
r14.add(Out4Label);
r14.add(Out4);
pane.add(r14);
setVisible(true);
FlowLayout layout15 = new FlowLayout();
r15.add(lastName1Label);
r15.add(lastName1);
pane.add(r15);
setContentPane(pane);
setVisible(false);
FlowLayout layout16 = new FlowLayout();
r16.add(In5Label);
r16.add(In5);
pane.add(r16);
setContentPane(pane);
setVisible(true);
FlowLayout layout17 = new FlowLayout();
r17.add(Out5Label);
r17.add(Out5);
pane.add(r17);
setVisible(true);
FlowLayout layout18 = new FlowLayout();
r18.add(lastName2Label);
r18.add(lastName2);
pane.add(r18);
setContentPane(pane);
setVisible(false);
FlowLayout layout19 = new FlowLayout();
r19.add(In6Label);
r19.add(In6);
pane.add(r19);
setContentPane(pane);
setVisible(true);
FlowLayout layout20 = new FlowLayout();
r20.add(Out6Label);
r20.add(Out6);
pane.add(r20);
setVisible(true);
FlowLayout layout21 = new FlowLayout();
r21.add(submit);
r21.add(reset);
pane.add(r21);
setVisible(true);
mDateTextField.setText(toDay);
//Main method
private String getDate()
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");// hh:mm:ss z");
String dateStr = formatter.format(new Date());
//System.out.println("Today's date and time is " + dateStr + ".");
return dateStr;
     private String ssCheck(String SSNUM)
          String rtrn = "True";
               if(SSNUM == "111-11-1111")
               String LName = "Johnson";
               String FName = "Jeff";
               else if(SSNUM == "222-22-2222")
               String LName = "Johnson";
               String FName = "Robert";
               else if(SSNUM == "222-22-2222")
               String LName = "Johnson";
               String FName = "Robert";
               else if(SSNUM == "333-33-3333")
               String LName = "Johnson";
               String FName = "Nancy";
               else if(SSNUM == "444-44-4444")
               String LName = "Johnson";
               String FName = "Ricky";
               else if(SSNUM == "555-55-5555")
               String LName = "Johnson";
               String FName = "Audrey";
               else
               LName = "VOID";
               FName = "VOID";
          return LName + "," + FName;
public static void main(String[] arguments) {
EmpTmCd frame = new EmpTmCd();
public void actionPerformed (ActionEvent ae) {
System.out.println("Button clicked");

"message pop-up with the proper name to SS # when they click the button and type in a SS#."
Are you aware that this makes absolutely no sense to anyone but yourself?
Here is what i have so far. WHere do I go from here???
With what - to do what? Apart from saying you want a pop-up (HINT: check out javax.swing.JOptionPane), what else do you want to do, what are you trying to do here?
As far as I can work out (from your non-formatted code) you have some sort of a form with 2 buttons: 'SUBMIT' and 'RESET': presumably the former requires some sort of processing to a txt file or database. As for actions;-
ONE: you need these;-
button1.addActionListener(this);
theOtherButton.addActionListener(this);
TWO: you need to process whatever - here's a good initial starting point
public void actionPerformed (ActionEvent ae) {
if(ae.getActionCommand().equals("SUBMIT"))System.out.println("Submit button clicked");
if(ae.getActionCommand().equals("RESET"))System.out.println("Reset button clicked");

Similar Messages

  • How do I use event.target.name in AS2?

    Thanks to kglad I was able to see how event.target.name in AS3 could make a button load a movieclip with the same namesake.
    I'm doing the same thing now in AS2 but don't know what to write instead of event.target.name.
    And so at the moment each button pushes info into an array and then a function uses that to decide which movieclip to attach to a holder after it has faded out once, and then fades in again...
    // ***** IMAGE GALLERY START ***** //
    // Add image to holder
    imgholder.attachMovie("img0", "image0_0", 1)
    // Array
    var nextLoad = ["img0"];
    // Btn listeners
    img5.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img5"); btnClick() } // Written on 1 line
    img4.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img4"); btnClick() }
    img3.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img3"); btnClick() }
    img2.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img2"); btnClick() }
    img1.onRelease = function() {
    nextLoad.pop();
    nextLoad.push("img1");
    btnClick()
    img0.onRelease = function() {
    nextLoad.pop();
    nextLoad.push("img0");
    btnClick()
    // The btn function
    function btnClick() {
    trace ("click");
    var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 100, 0, 1, true);
    myImgTween.onMotionFinished = function() {
    fadeOutImg();
    // The btn function part II
    function fadeOutImg() {
    trace ("fadeOutImg");
    imgholder.attachMovie(nextLoad, "image1_1", 1);
    var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 0, 100, 1, true);
    I know I should be able to push the button name into the array, but am having to use a string... I'm sure my code is cumbersome!! But it works. I've tried pushing the button name but it end up including the full stage reference.
    Is there a cleaner way of doing this using event.target.name?
    Thanks for looking!

    There is no event.target in AS2. However since AS2 has no way of remembering the scope object where the target object resides, you can use this to your advantage to retrieve the name of the target by using the "this" command in the function whenever you use the above format "mc.onPress = myfunc". FYI, the popular workaround Delegate, made it possible that when you called "this" in the function, you could retrieve the scope object where the target instance resides. So without its use, "this" will return the name of the target object. Anyway this is the code you can use:
    imgholder.attachMovie("img0","image0_0",1);
    var nextLoad = ["img0"];
    img5.onRelease = onImgRelease;
    img4.onRelease = onImgRelease;
    img3.onRelease = onImgRelease;
    img2.onRelease = onImgRelease;
    img1.onRelease = onImgRelease;
    img0.onRelease = onImgRelease;
    function onImgRelease():Void {
       nextLoad.pop();
       nextLoad.push(this._name);
       btnClick();
    // The btn function
    function btnClick() {
       trace("click");
       var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 100, 0, 1, true);
       myImgTween.onMotionFinished = function() {
          fadeOutImg();
    // The btn function part II
    function fadeOutImg() {
       trace("fadeOutImg");
       imgholder.attachMovie(nextLoad,"image1_1",1);
       var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 0, 100, 1, true);

  • How can I view my photos in "Events" like in iPhoto? How can I create events?  I have 55,000 photos and 1700 events so the only way I can possibly manage my photos is using events that are one slide in size.

    I have 55,000 images organized into about 1700 events. The only reasonable way to view my library is using events in iPhoto where each event has one image That still leaves 1700 images to sort through but that is a lot easier than 55,000 images.  In the side bar is a folder with "iPhoto Events" but those views still show all of the slides.  How can I create events and view my photos as events as in iPhoto?  Events are critical for large libraries and has been my primary way to sort images.
    Thanks!

    I had a problem a couple of months ago when iPhotos suddenly rearranged the order of my Events (Why won't iPhoto let me arrange my photos?) .  I was told "Use albums not events - events are not a good way to organize - albums and folder are designed for organisation and are very flexible".
    Haha!  I should have paid attention and read between the lines!  My iPhotos were highly organised groupings - not according to date but the way I wanted them - and it was so easy to do!  I see now that if I had them all in albums, as per the Apple Apologist suggestion, I wouldn't have this unholy mess I have been left with just to make iPhone & iCloud users happy.  I am now going through Photos and making Albums (of what used to be in my Events)  ... maybe I'll get this finished before they do another non user friendly update!

  • Add fields to maintenance view and update then using events

    Hi experts:
      I've created a table with 4 fields, one of them is userid. Also, there is a maintenance view to add new entries.
      I want to display user name when typing userid using events (1 or 21). I know how to do it if username is one of the fields of the table, but there is a requirement to not store username in the table, just userid.
    My question is: is possible to add a field into the maintenance view and update it using events but not store the value in DB?.
    Thanks in advance for your help.
    Regards,
    Carlos.

    In the save event just clear the entries of the field(user name) in the internal table.

  • Can i use events for anything i want?

    hi
    i've got a doubt about events. i am using events to send information between objects, so that the objects don't need to know who they are sending the information to.
    so i created my own events, listener and listenermulticaster
    but i have the feeling that events are intended to be used by the GUI objects, swing and awt.
    my question is if it is a good programming practice to use events to communicate other kind of objects. or maybe using events is not desirable at all??
    if events must not be used for this kind of works, what are the other ways to do it??
    thanx in advance,
    Lagarto

    well, thank you for your time
    now im considering using interfaces. if i understand it, the idea would be this:
    object A has information to send, so it has an atribute of tipe MyInterface, which has the methods to send the data.
    object B wants to get the data, so it create a new MyInterface and do something like:
    A.setMyInterface(new MyInterface() {....});
    i think this would work if there is only object B which wants the data (actually, this is the case i was thinking of from the beginning)
    but what can i do if there are more objects wich must get the data?
    Must the object A keep a Vector or something of more than one interfaces??
    thanks again...
    Lagarto

  • HOW TO CREATE  and  USE EVENTS IN WORKFLOWS .

    HOW TO CREATE  and  USE EVENTS IN WORKFLOWS with the help of classes.
    What i am doing is..
    open se24
    event tab->event name->parameters
    method tab->method name->event handler->copy parameters
    interface tab->if_workflow->enter
    tell me what else to do step by step
    Another important thing is that HOW to use these class events to trigger the workflows.
    REPLY ASAP
    THXS IN ADVANCE

    Hi,
    Pl. see this blog...
    Raising ABAP OO events for workflow
    Regards,
    JOy.

  • Why and how to use events in abap objects

    Dear all,
      Please explain me why and how to use events in abap objects with real time example
    regards
    pankaj giri

    Hi Pankaj,
    I will try to explain why to use events... How to use is a different topic.. which others have already answered...
    This is same from your prev. post...
    Events :
    Technically speaking :
    " Events are notifications an object receives from, or transmits to, other objects or applications. Events allow objects to perform actions whenever a specific occurrence takes place. Microsoft Windows is an event-driven operating system, events can come from other objects, applications, or user input such as mouse clicks or key presses. "
    Lets say you have an ALV - An editable one ...
    Lats say - Once you press some button  you want some kind of validation to be done.
    How to do this ?
    Raise an Event - Which is handled by a method and write the validation code.
    Now you might argue, that I can do it in this way : Capture the function code - and call the validate method.
    Yes, in this case it can be done.. But lets say .. you change a field in the ALV and you want the validation to be done as soon as he is done with typing.
    Where is the function code here ? No function code... But there is an event here - The data changed event.
    So you can raise a data changed event that can be handled and will do the validation.
    It is not user friendly that you ask the user to press a button (to get the function code) for validation each time he enters a data.
    The events can be raised by a system, or by a program also. So in this case the data changed event is raised by a system that you can handle.
    Also, Lets say on a particular action you want some code to trigger. (You can take the same example of validation code). In this case the code to trigger is in a separate class. The object of which is not available here at this moment. (This case happens very frequently).
    Advantage with events : Event handlers can be in a separate class also.
    e.g : In the middle of some business logic .. you encounter a error. You want to send this information to the UI (to user - in form of a pop up) and then continue with some processing.
    In many cases - A direct method call to trigger the pop up is not done. Because (in ideal cases) the engine must not interact with UI directly - Because the UI could be some other application - like a windows UI but the error comes from some SAP program.
    So - A event is raised from the engine that is handled in the UI and a pop up is triggered.
    Here -- I would have different classes (lets say for different Operating Systems). And all these classes must register to the event ERROR raised in application.
    And these different classes for different Operation systems will have different code to raise a pop-up.
    Now you can imagine : If you coded a pop-up for Windows (in your application logic) .. it will not work for Mac or Linux. But of you raise a event.. that is handled separately by a different UI classes for Win, Linux or Mac  they will catch this event and process accordingly.
    May be I complicated this explanation .... but I couldn't think of a simpler and concrete example.
    Cheers.
    Varun.

  • USER LOGIN GENERATION USING EVENT HANDLER IN OIM 11G

    Hi
    I am looking to generate user logins in OIM 11g (11.1.1.5) using event handlers. Can anyone guide me with the process and which API need to be used?
    Regards

    You have to write your custom class which implements oracle.iam.identity.usermgmt.api.UserNamePolicy. Then you have to register the plugin which will contain the plugin.xml and class file of your custom code.
    More in this metalink ID 1228035.1

  • How to Update multiple items in other list using event handler?

    Hi All,
    If i update a item in a list, then i should update multiple items in another list need to be update. How to achive using event receivers?

    Hi Sam,
    According to your description, my understanding is that you want to update multiple items in another list when updated a list item.
    In the event receiver, you can update the multiple item using Client Object Model.
    Here is a code snippet for your reference:
    public override void ItemUpdated(SPItemEventProperties properties)
    string siteUrl = "http://sp2013sps/sites/test/";
    ClientContext clientContext = new ClientContext(siteUrl);
    List oList = clientContext.Web.Lists.GetByTitle("another list name");
    ListItem oListItem = oList.GetItemById(1);
    oListItem["Title"] = "Hello World Updated!";
    oListItem.Update();
    clientContext.ExecuteQuery();
    Best regards,<o:p></o:p>
    Zhengyu Guo
    Zhengyu Guo
    TechNet Community Support

  • Using events in Process chain

    Hi All,
    I have below scenario:
    Now we are using event collecter and subsequent event in event collector .
    I am going to convert my loads into Process chain from Infopackage groups. My problem is I can use event1 directly in Start of process chain but how to trigger event2 using this chain. I need to trigger event2 once my PC is completed successfully. The even2 will trigger a background job to execute one ABAP program. This ABAP program triggers event1 again if it meets certain requirement.
    Hope you understood my problem.
    Thanks in advance
    Vani

    Hi,
    If I have understood properly,
    Event1(Start) --> Sequence of PC steps --> ABAP Program Process Type (To trigger Event2)  --> Event2 triggers again Event1( If meets requirement)
    What is your End of the Process Chain if it triggers again Event1?
    Why do you want to trigger events in a cyclic way?
    Regards,
    Suman

  • How to update Payload in existing BO using Event SubProcess( Non Interrupt)

    Hi ,
    I am using oracle BPM 11.6 Version.
    Let me explain the Problem :
    1. CoreProcess contains Three Human Task.Following Roles
    1) Approver One .
    2) Approver Two.
    3) Approver Three.
    2. Request Created through external Application ( As-Synchronous Process )
    3. PAN Card number as Correlation Key and Maintain Status element also.
    Status like -- Created, cancelled ,opened, Re-opened.
    4. External system have to update status on CoreProcess , using Event Subprocess ( as non interrupting Event to update Current Payload ).
    Problem I am facing :
    When I try to update Status , Not updated in my coreProcess payload.when ever coreProcess instance wait in any human task workspace.
    Using Event subProcess ( Non interrupt Event to achive this ) but my coreProcess pay load information not changed.I tried with Update Task to achive but no option to achive this.
    Can any one please help me . Thanks in advance.
    Regards
    krishna Moorthi p

    A non-interrupting even subprocess will no work on a copy of the data, it works on the same copy of the data as the rest of the process. Your problem is coming from the fact that human tasks are handled by the TaskService which is external to the BPMN engine. When the human task is created a copy of the payload is sent to the TaskService. This data is kept there until the task is completed at which time the updated payload is sent back to BPM.
    In your case you are updating the process data objects but that does not update the task payload as well. Unfortunately the Update Task activity does not seem to support updating the payload. I think the 2 options you would have are:
    1. Use the TaskService directly as a web service to update the payload
    2. Try updating the payload and then withdrawing the task. You can then possibly model a loop back to your human task in the process.

  • Using Event 21 in Table maintenance generator

    Hi,
    How can i get the updated record when using event 21 in maintenance generator.

    >
    ABINASH VERMA wrote:
    > Hi,
    >
    > How can i get the updated record when using event 21 in maintenance generator.
    Can You give Us any Idea what is Event 21 in Maintenance Generator.
    Regards,
    Suneel G

  • Use Events or delegates in my application??

    I am trying to implements events in c#. my scenario is that there will be multiple events and there will be multiple events listeners to an event(many to many relationship).
    the problem here is since there are many events and if i implement all in one class, maintaining code will a tough task, and if i create one class per event there will be too many classes.
    I found a solution which has an event broker in this link: http://msforge.net/blogs/paki/archive/2007/11/20/EventBroker-implementation-in-C_2300_-full-source-code.aspx
    but here the author is using delegates only instead of events. he is maintaining a dictionary wherein he is saving some event ID as key and list of delegates as value. this solves my problem of code maintenance.
    my question is that is it fine to do this way since behind the scenes an event is a construct that wraps a delegate only or use events which c# is already providing rather than maintaining a dictionary?
    which one is a better way in terms of performance or any other way?
    Also is there any better way to implement my scenario with events
    Please provide your inputs.

    You should take a look at the event aggregator pattern:
    http://martinfowler.com/eaaDev/EventAggregator.html
    I have written a blog post about how to communicate between classes using the event aggregator class that is included in Prism here:
    http://blog.magnusmontin.net/2014/02/28/using-the-event-aggregator-pattern-to-communicate-between-view-models/
    Prism is a framework for building composite XAML based applications from the Microsoft Patterns and Practices Team:
    http://msdn.microsoft.com/en-us/library/gg406140.aspx. But even if you are not developing a XAML based application, the concepts and many of the components are still useful.
    Another popular framework out there is MvvmLight which uses a Messenger class to handle this kind of communication:
    https://marcominerva.wordpress.com/2014/06/25/how-to-send-string-and-content-messages-with-mvvm-light-messenger/
    http://stackoverflow.com/questions/16993918/mvvm-light-messenger-sending-and-registering-objects
    http://msdn.microsoft.com/en-us/magazine/dn745866.aspx
    Hope that helps.
    Please remember to mark helpful posts as answer and/or helpful and please start a new thread if you have a new question.

  • Am I the only one that uses Events like Albums?

    Ever since the iPhoto '06 days (now on iPhoto '11), I've been using Events like Albums.  Like the event "Niece" where I put all the pictures of my niece, rather than create an Album for it.  I just like the visual layout of Events better, never really got into the Albums feature much.
    Does anyone else do this, or is it just me?  Are there any drawbacks to doing this?  Is there ever a circumstance where an Album would be better?

    Photos in Events can only be sorted by date while those in albums can be sorted by title, date, keyword, manually and rating. 
    To assemble all photos of your niece together you could create a Smart Album with the criteria Keyword contains niece.  Then as you import new batches of photos into its event go thru and add the appropriate keyword to those photos containing your niece.  All automatic. They will show up in the smart album for your niece.
    Your method is more like file organization in the Finder rather than digital asset management like iPhoto does.
    OT

  • Can I use Event structures in a subVI?

    Hi,
    I have a subVI (ProvaEv1.vi) that use an event structure inside. But when I use it in a VI (ProvaVI.vi) the event structure in the subVI doesn't catch the events.
    I tried to insert the event structure in a while loop but it doesn't work too.
    Could you help me?
    Thanks Ius
    Attachments:
    ProvaVI.vi ‏11 KB
    ProvaEv1.vi ‏15 KB

    "iusn" <[email protected]> wrote in message news:[email protected]...
    Thanks to all for your answers!
    Wiebe! I tried to do as you suggested but I am not able to link the Event Reference Number inside te SubVI with the Event Register Number of the Register for Event in Main VI. There is e class conflict. Another question: how the SubVI can know the structure of the Register event outside?My aim was to create a modular structure but it seems very difficult, wath do you think about these problems?
    The broken wire is related to your question. The event structure inside the sub vi knows about the events you register in the main, because the reference wire/control has a "strong" type. It contains information about the registered events. That is also why the wire is broken. You have to register all events, then create an indicator/control of the output. Use that control in the subvi. You have to do this every time the events change (you might use a type def if you use the control a lot).
    Usually, the events that you would want to put inside subvi's are those related to user interface objects. I've had this a lot. You make a nice interface, but it's not reuseable, because the events are mixed with all the other events. Only solotion is to manually add the needed event cases in your program, and copy the code.
    Even if you can put the events in a sub vi, I'd expect hanging vi's when more subvi's are registered for the same event. It's hard to tell without trying. So it's not a real solution either.
    Like Chrisger suggested, the event callback might help a little, but they are tricky, and actually ment for this (they are intended for activex callbacks).
    Perhaps you should look at XControls (if you use 8.2). It would be more work to replace your code to XControls, but once you're done, you have reusable code.. Haven't worked with them jet, but they are invented for this problem...
    Regards,
    Wiebe.
    I have already create my application using event structure just in Main VI but it seems very complicate to read and keep update, I would have wanted to give modularity to my application.
    Thanks Ius
    SubVIEventMain.vi:
    http://forums.ni.com/attachments/ni/170/203225/1/SubVIEventMain.vi
    SubVIEvent.vi:
    http://forums.ni.com/attachments/ni/170/203225/2/SubVIEvent.vi

  • How open a service order using event handling

    HOw to open a service order using event handling

    Hi,
    Can you explain your requirement elaborately.
    I understand from it as, you want to open Service order creation page, based on some event(may be submit button).
    For that technically you can use navigation->goto_page('Provide the URL').
    or you can use inbound-plug and out-bound plug concept for naviagation.
    Regards,
    Devender V

Maybe you are looking for

  • BPM Process Data Object of type Business Objects

    I am using JDeveloper11.1.1.5 and using BPM Project. I have created a business object of type Quote and I want create a Process data object of type Quote. But I don't find 'Browse more types' button on Create data object wizard. I am stuck at this pl

  • Adding users programmatically -- almost there

    ... getting close... Create this procedure in the PORTAL schema. It works if you call it when connected as PORTAL, but not when connected as anyone else. It is throwing a user-defined exception frmo inside WWCTX_SSO, so I am guessing that it is looki

  • Can't find font

    I want to use ITC Avant Garde Gothic Book in Indesign. It's showing in Font Book and it's used in an Illustrator file but isn't recognised in Indesign. I'm trying to open an ID file which has the font in it but get a Missing Fonts message with a Find

  • P15 s409 dvd cd drive not listed as a device

    i installed a replacement dvd cd combo drive and  it was used to reinstall my system, however it is not listed as a devive on my laptop and i can not use it to play  anything . i tried to find this model on the update drivers list but  i could not fi

  • Repair Python framework

    Hello, I've been scouring these boards for a way to repair my Leopard installation. In my zeal while trying to install SciPy / Numpy, etc. and update to the latest version of Python, I deleted some key components to the Python framework. I was so fru