About events of class cl_gui_alv_grid

When the following two event gets trigger in execution.
I mean by clicking what they get trigger or how we can triger them and how to use them.
menu_button
data_changed
In general how one can understand that which event will be triigered when from the class event.

Hello Amit
In order to understand the event DATA_CHANGED in more detail you may have a look at Get edited data ou of grid back into internal tabel
and the links provided therein (in particular my discussion with David Halitsky).
Regards
  Uwe

Similar Messages

  • Events in classes.

    Hi all
    Can any one explain me the functionality about events and event handlers in ABAP OO??
    Thanks and Regards,
    Arun Joseph

    Hi there
    Whilst the SENDER doesn't know about the RECEIVER  the reverse is not true. Some people might (wrongly) infer from the comment about the sender that the receiver doesn't know either. I'm only adding the comment below  hopefully to clear this up for some people who perhaps a new to OO programming and OO ABAP in particular.
    By using the parameter SENDER the receiver can know what object triggered the event. This is of course useful where you have say multiple grid displays on the screen and an action needs to be performed depending on what object triggered it.
    class lcl_event_handler definition.
    * CLASS     cl_event_receiver
    * DEFINITION
      public section.
        methods:
    *--To add new functional buttons to the ALV toolbar
    handle_toolbar for event toolbar of cl_gui_alv_grid
    importing e_object e_interactive
              sender,
    *--To implement user commands
    handle_user_command
    for event user_command of cl_gui_alv_grid
    importing e_ucomm
              sender,
    class lcl_event_handler  implementation.
    *--Handle Toolbar
      method handle_toolbar.
    *    PERFORM handle_toolbar USING e_object e_interactive .
      endmethod .
    *--Handle Hotspot Click
      method handle_hotspot_click .
    *    PERFORM handle_hotspot_click USING e_row_id e_column_id es_row_no .
    create object  go_handler.
        set handler  go_handler->handle_user_command
        for go_grid1.
    set handler  go_handler->handle_user_command
        for go_grid2.
    form handle_toolbar
    case g_sender
    when go_grid1
    etc
    sorry if this info is a case of "stating the obvious" but reading the forums there's quite a bit of confustion surronding event generation and handling in OO ABAP.
    Cheers
    jimbo

  • JTabbedPane single event handling class.

    I have a list of proxyNames which are stored in a Vector.
    These proxy names are then displayed as Tabs accordingly.
    For every tab there is a specific action to be performed.
    I want to write a single event handling class for handling all events.
    What I have is this:
    while(eNum.hasMoreElements()){
    Object proxyName = eNum.nextElement();
    tabbedPane.addTab(proxyName.toString(), null, null, "Proxy");
    tabbedPane.addChangeListener(itemHandler);
    panel4.add(tabbedPane2);
    class ItemHandler implements ChangeListener{
    public void stateChanged(ChangeEvent e){
    for(int i=0; i < v.size(); i++){
    // Perform action on choosing the concerned tab...
    How do I have a single event listener?

    Yikes! Is that a minimal program? When I am trying to do something new, or facing a problem that causes me to get stuck for more than an hour, I create a short program to solve just that problem. In time, you create a directory of test programs that's useful, and with practice, solving a problem in isolation is a faster (and generally better) way to go about things that doing it all in a larger application.
    Any way, here is your code, with a change listener added in method makeSubpanel. If you don't want the listener called the very first time, add it at the end of this method. I also fixed some bugs in createProxyList.
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class TrialTabbed extends JPanel {
        // Will hold all file names read from the /config directory.
        private Vector v,v1;
        JTabbedPane tabbedPane,tabbedPane2;
        Object proxyName;
        public TrialTabbed(){
            tabbedPane = new JTabbedPane();
            // Instantiate the Vector.
            v1 = new Vector();
            Component panel1 = makeTextPanel("Blah");
            tabbedPane.addTab("Debug Mode", null, panel1, "Debug");
            Component panel2 = makeSubPanel();
            tabbedPane.addTab("Normal Mode", null, panel2, "Normal");
            // Add the tabbed pane to this panel.
            setLayout(new GridLayout(1, 1));
            add(tabbedPane);
        protected Component makeTextPanel(String text) {
            JPanel panel = new JPanel(false);
            JLabel filler = new JLabel(text);
            filler.setHorizontalAlignment(JLabel.CENTER);
            panel.setLayout(new GridLayout(1, 1));
            panel.add(filler);
            return panel;
        private Component makeSubPanel(){
            JPanel panel4 = new JPanel(false);
            panel4.setLayout(new GridLayout(1, 1));
            tabbedPane2 = new JTabbedPane();
            //new code - a change listener for pane2
            tabbedPane2.addChangeListener(new ChangeListener(){
                public void stateChanged(ChangeEvent e){
                    int tab = tabbedPane2.getSelectedIndex();
                    if (tab == -1)
                        System.out.println("no tab selected");
                    else {
                        String filename = tabbedPane2.getTitleAt(tab);
                        File file = new File("..", filename); //brittle!
                        if (file.isDirectory())  {
                            String[] contents = file.list();
                            int size = contents == null ? 0 : contents.length;
                            System.out.println(filename + " contains " + size + " files");
                        } else
                            System.out.println(filename + " has length " + file.length());
            //end of new code
            ItemHandler itemHandler = new ItemHandler();
            v = createProxyList();
            // Enumerate thru the Vector and put them as tab names.
            Enumeration eNum = v.elements();
            while(eNum.hasMoreElements()){
                proxyName = eNum.nextElement();
                tabbedPane2.addTab(proxyName.toString(), null, null, "Proxy");
                panel4.add(tabbedPane2);
            return panel4;
        // Display the file names in this directory as tab Names.
        //new code: changed dirName to "..", fixed some obvious bugd
        private Vector createProxyList(){
            String dirName = "..";
            File file = new File(dirName);
            if(file.isDirectory()){
                String[] s = file.list();
                for(int i=0; i< s.length; i++){
                    v1.addElement(s);
    } // End for.
    } // End of if.
    return v1;
    } // End createProxyList().
    class ItemHandler implements ChangeListener{
    public void stateChanged(ChangeEvent e){
    System.out.println(v.size());
    System.out.println("IN CHANGE LISETENER" + proxyName.toString());
    } // End actionPerformed.
    } // End Inner class ItemHandler.
    public static void main(String[] args) {
    JFrame frame = new JFrame("TabbedPaneDemo");
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {System.exit(0);}
    frame.getContentPane().add(new TrialTabbed(),BorderLayout.CENTER);
    frame.setSize(500, 425);
    frame.setVisible(true);

  • Some Doubts about Event Handlers

    Hi,
    I had some doubts on Event handlers in OIM 11.1.1.5 ........
    1) I want to use the same event handler for both Post Insert and Post update task.... Can I use the same event handler for that... If yes then how can I do that....
    2) Can I create the single Plugin.xml class and add the all jar files in single say lib folder and zip them all together.. if yes then What changes I need to do?? Need to add only the plugin tags for different class files in plugin.xml file? OR need to do some thing extra also...?
    3) If i need to change any thing in any class of event handler.. Is there need to unregister the plugin and again register...??
    If yes.... Is there need to delete the event handler using the weblogicDeleteMetadata command???
    4) As we Import the event handler from path like event handler/db/... If we add all the evetn handler.xml files in that folder..... As During Import weblogicImportMetadata recursively call all the files in that folder.... Now if i need to change anything in any one of event handler class... then if we import from the same folder event handler/db/... What will it do............Create the duplicate copy of all the eventhandlers????? OR i need to add only those Eventhandler.xml files for those class files i made the changes.....
    5) As I need to create email on user creation during recon and also email id get updated as first name or last name updates..... What I had to use in Event handler.xml (entity-type="User" operation="CREATE") or Some thing else....
    Help me clarify my doubts...

    Anil Bansal wrote:
    Hi,
    I had some doubts on Event handlers in OIM 11.1.1.5 ........
    1) I want to use the same event handler for both Post Insert and Post update task.... Can I use the same event handler for that... If yes then how can I do that....Yes, you can have the same. Just have two event handlers in the same MDS file and the operation should be CREATE for one while MODIFY for another. The class and version and name remains the same.
    2) Can I create the single Plugin.xml class and add the all jar files in single say lib folder and zip them all together.. if yes then What changes I need to do?? Need to add only the plugin tags for different class files in plugin.xml file? OR need to do some thing extra also...?Yes, in the single plugin xml you can define multiple eventhandlers and the jar will contain multiple event handlers class.
    3) If i need to change any thing in any class of event handler.. Is there need to unregister the plugin and again register...??
    If yes.... Is there need to delete the event handler using the weblogicDeleteMetadata command???No, if you are just changing the class, then you need to update the class only in the plugin. For this, first delete plugin and then update plugin and then purgecache.
    4) As we Import the event handler from path like event handler/db/... If we add all the evetn handler.xml files in that folder..... As During Import weblogicImportMetadata recursively call all the files in that folder.... Now if i need to change anything in any one of event handler class... then if we import from the same folder event handler/db/... What will it do............Create the duplicate copy of all the eventhandlers????? OR i need to add only those Eventhandler.xml files for those class files i made the changes.....If won't create duplicate copies but would overwrite the ones which are there in MDS at the same location. So effectively, if the xml is not changing you should not be worried about overwritting.
    5) As I need to create email on user creation during recon and also email id get updated as first name or last name updates..... What I had to use in Event handler.xml (entity-type="User" operation="CREATE") or Some thing else....For recon and event handler, you will need to have post process event handler on User CREATE and UPDATE. On Create construct the email address and populate it in the email field. For update check if the firstname/lastname are changing and if yes, then update the email id on the profile.
    >
    Help me clarify my doubts...

  • Questions from a rookie about event structures

    Hello,
       I am currently scheduled for Labview classes next month,
    so I want to apologize in advance for "dumb questions". I have created
    a program that is starting
    to be a CPU resource hog. The majority of my program is inside a while
    loop so that the program will "react" to changes in controls, etc. I am
    assuming that
    if I incorporate "event structures" in my program that my program will
    not be a resource hog.  Is the use of event structures the correct
    way to go? If using
    event structures is the correct way to go, what is the best way to
    learn how to incorporate "event structures"?  I am assuming that
    the examples in Labview will show me how. Are there any good reading
    materials about event structures?
    Regards,
    Kaspar

    To fix the CPU resource issue, you need to place a small wait statement in your loop. It will solve two problems:
    Slow down the loop (you don't need to check for UI changes more that 10x/second)
    It will allow other, parallel tasks a chance to run after each iteration. Without a wait, it will hog the CPU for 55ms before releasing control.
    If your loop currently spins one million times a second and you would place a 1ms wait, the CPU would go from 100% to 0.1%!
    The event structure is a fantastic tool to solve most UI issues and it makes the diagram automatically simpler, more self-documenting and easier to read. Have a look at some of the examples that ship with LabVIEW.
    The event structure is easy to learn, so dive right in. Read the online help for some important considerations. As a rule of thumb you should stick to a single event structure per diagram.
    LabVIEW Champion . Do more with less code and in less time .

  • Check_changed_data method on editable ALV Grid ( class cl_gui_alv_grid)

    Hi guys,
    I use the following method (register_edit_event) in the PBO soon after first display of an editable ALV grid to register enter as an event to do validations on fields like qty. If user enters some character like 'abc' for qty and hits enter on keyboard, ALV grid pop's up a standard message ( I haven't coded for this.Since I use DDIC structure in field catalog, the Std. ALV program takes care of it. ). THis takes care of the validation before I click on save.
    call method alv_grid->register_edit_event
                            exporting
                               i_event_id = cl_gui_alv_grid=>mc_evt_enter.
    This works fine. But I want this validation to run when I also click the SAVE button of the screen. Is it possible to run this standard validation in my PAI event eg. SAVE ? I thought I will be, by calling the method check_changed_data in my PAI event. But this is doing nothing. Does this method conflict with register_edit_event or something ? So , basically what I am looking for is to trigger the event or call the method which does the same work as the "check" button on ALV grid.
    Any advice or tips or sample code is greatly appreciated.
    Thanks,
    Shareen

    Hi Shareen,
    Handle the data_changed event in the grid.
    Whenever you make changes in the data in ALV Grid this event would be triggered. Here you can perform additional validations that you may need to perform.
        METHODS handle_data_changed
          FOR EVENT data_changed OF cl_gui_alv_grid
          IMPORTING er_data_changed.
    Implementation:
      METHOD handle_data_changed.
        PERFORM validations USING er_data_changed.
      ENDMETHOD.
    FORM validations USING er_data_changed TYPE REF TO cl_alv_changed_data_protocol.
      DATA: ls_good TYPE lvc_s_modi.
      DATA  wa LIKE LINE OF lt_good_cells.
      CALL METHOD g_grid->register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv_grid=>mc_evt_modified.
      LOOP AT er_data_changed->mt_good_cells INTO ls_good.
        CASE ls_good-fieldname.
        WHEN 'FIELDNAME'. "Your fieldname
            CALL METHOD er_data_changed->get_cell_value "Get the changed value
              EXPORTING
                i_row_id    = ls_good-row_id
                i_fieldname = ls_good-fieldname
              IMPORTING
                e_value     = temp. "Your temp variable
            "Make your validations here.
        ENDCASE.
    Ps: Reward points if helpful.
    Regards,
    Wenceslaus.

  • Needs help.....Please about using different classes

    I don't know how to use differenet classes.
    Please tell me how to write class to suit Start. This stuff me up. Please .... help me
    <<My program>>
    //Start
    public class Start
    {  private Artist[] Artists;
    private Record[] records;
    private Person[] Manager;
    private TextMenu makeMenu = new TextMenu();
    public static void main(String[] args)
         Start studio = new Start();
    studio.menu();
    public Start()
    {  //Person.Manager(ManagerName,HouseNumber,StreetNumber,PhoneNumber)
         Manager = new Person[1];
         Manager[0] = new Person("Yangfan",88,"Young ST",11118888);
         //Artist(GroupID,ArtistName,HouseNumber,StreetNumber,PhoneNumber)
         Artists = new Artist[5];
    Artists[0] = new Artist(1,"Backstreet Boys",58,"Music ST",99998888);
    Artists[1] = new Artist(2,"Santana",68,"Music ST",99998899);
    Artists[2] = new Artist(3,"Macy Gray",78,"Music ST",55558888);
    Artists[3] = new Artist(4,"Ricky Martin",88,"Music AVE",77778888);
    Artists[4] = new Artist(5,"Did Rock",55,"Music Road",66667777);
    //Record(RecordingID,RecordName,Artist,StartTime,FinishTime,RecordingDate,GuestArtist1,GuestArtist2)
    records = new Record[6];
    records[0] = new Record(1,"I want it that way",Artists[0],11,12,"05/08/2001",Artists[1],Artists[3]);
    records[1] = new Record(2,"Smooth",Artists[1],11,12,"05/08/2001",Artists[1],"");
    records[2] = new Record(3,"Do something",Artists[2],11,"05/08/2001",Artists[3],"");
    records[3] = new Record(4,"Livin La Vida Loca",Artists[3],11,12,"05/08/2001",Artists[1],Artists[3]);
    records[4] = new Record(5,"Bawitdaba",Artists[4],11,13,"05/08/2001",Artists[1],"");
    records[5] = new Record(6,"The one",Artists[0],11,14,"05/08/2001",Artists[1],"");
    public void menu()
    {  String[] choices = {">>>List Manager Details",">>>List All Artist Names",">>>List An Artist Telephone-Number",">>>Show Details For One Recording",">>>Add A New Recording",">>>List The Recording Costs For All Artists",">>>List Artist's Reocording",">>>Exit Program"};
    while (true)
    {  switch (makeMenu.getChoice(choices))
    {  case 1: showAllArtists();
    break;
    case 2: showAllRecords();
    break;
    case 3: System.exit(0);
    break;
    case 4: System.exit(0);
    break;
    case 5: System.exit(0);
    break;
    case 6: System.exit(0);
    break;
    case 7: System.exit(0);
    break;
    case 8: System.exit(0);
    break;
    default:
    public void showAllArtists()
    {  int numArtists = Artists.length;
    for(int i = 0; i < numArtists; i++)
    {  Artists[i].displayArtistDetails();
    public void showAllRecords()
    {  for (int i = 0; i < records.length; i++)
    {  System.out.println();
    records.printRecordDetails();
    <<Assignment>>
    Due - midnight, Wednesday August 22nd
    This assignment will test your knowledge of Java programming using classes, encapsulation and javadoc.
    The base requirements
    Write a complete Java class to manage a Digital Recording Studio. The studio wants to keep a list of all Artists that use the studio and also wishes to keep track of all Recordings that have been made. An important function of the program is to calculate the time spent making a recording and charge the Artist for the time used.
    You must create at least the following classes, Start, Studio, Person, Artist, Recording, Address. You may create other classes if needed as well
    Start will contain main(), create one instance of a Studio and execute a Menu of commands to test your code. Studio should contain a studio name, an array of Artist and an array of Recording plus the studio manager (a Person). Each Artist should contain the name of the group and an Address. Each Person will have a name and a home address. Each recording will have a Title (usually song title), an Artist (only one), and a list of guestArtist (they are Artist�s but will not receive royalties) the number of the CD the recording is stored on (numbers are numerical and recordings are saved on CD-R), plus the recording start and finish times for the recording session (suggest you use Java Date class � refer to the API). An Address will contain, house number (integers only), a street name and a telephone number. There is no need to store city and country.
    To enter a set of data for testing your program � main() should call a method in the Start class that will fill in a set of values by creating objects and filling in values by calling methods in each class. This is the ONLY method allowed to be longer than 1 page long � normally we would read the data from a file but there are no O-O principles that can be learnt with simply filling in data values. It is suggested to create say at least 4 Artist�s and 6 Recordings (at least one with 1 guest Artist and one with 2 guestArtist�s)
    A menu for testing your program should be provided (it is suggested to put the Menu into a separate class as you need at least 3 menus). While other commands are possible, only the following ones will receive marks.
    Menu commands needed are
    List the Managers name, address and telephone number
    List all Artist Names
    List an Artist telephone number (a sub menu showing valid Artist�s is required)
    Show all details for one Recording ( sub menu of valid Recordings will be needed and remember there can be more than one guestArtist)
    Add a new Recording, user will need to be prompted for all details.
    List the recording costs for all Artists � show each Artist on a separate line with their name and total amount, charge for using the studio is $1000 per hour or part thereof, example for a 1 hour and 10 minute recording the Artist will be billed for 2 hours.
    List all the Recording�s one Artist has worked on (sub menu of Artists needed), the list should show whether they were the Artist or a guestArtist
    Exit program
    Use fixed sizes for arrays, suggest 20 is suitable for all arrays. Java can handle dynamic data structures (where the number of elements can grow or shrink), but that is beyond a first assignment.
    Do NOT make ANY methods static - this defeats the Object Oriented approach and will result in ZERO marks for the entire assignment.
    Data MUST be encapsulated, this means that all the data relating to an object are to be stored INSIDE an object. None of the data detail is to be globally available within your program - hence do not store Artist names in either Studio or Recordings � just store a reference instead. Do NOT create ID numbers for Artists, you should use References instead � for many students this will be the hardest part as you have to use Objects, not program in a C style to solve the problem. Note that if there are any non-private data in classes then zero will given for marks for encapsulation.
    Good programming style is expected (see web page or lecture notes). In particular, you must use javadoc to generate a set of html pages for your classes. Make sure you use the special javadoc style comments in your source code. Marks will be granted for both using javadoc and also for including sensible javadoc comments on each class and each public method.
    What to Hand In
    Read the turnin page, basically the .java files, a readme.txt to tell the marker which file the program starts from plus the javadoc (html) files. Do NOT send .class files (if you do send these we will delete them and recompile your program), do NOT compress with gtar, tar, zip or use any other tool on your files. Turnin automatically compresses all your files into a single archive for us to mark.
    The simplest way to turnin all your files is to place all files in one directory then just use the *.* wildcard to turn in all files within that one directory.
    You must turnin all files that are not part of Java 1.3. In particular, you are allowed (actually encouraged) to use EasyIn or SavitchIn but should include the one you use in the files you submit. It is STRONGLY suggested that you copy all the files into another directory, test it works there by compiling and executing then turnin files from that directory. A common problem is students adding comments at the last minute then not testing if it still compiles. The assignment will be marked as submitted � no asking later for leniency because you added comments at the last minute and failed to check if it still worked.
    If the tutors are unable to compile your submission, they will mark the source code but you will lose all the execution marks. Sorry, but it is your responsibility to test then hand in all files.
    Comments
    For CS807 students, this program should be fairly easy if it was to be programmed in C (you would use several struct). The real art here is to change over to programming objects. Data is contained in an object and is not global. This idea is essential to using Java effectively and is termed encapsulation. Instead of using function(data), you use objectName.method( ). Effectively you switch the data and functions around, the data has a method (function) attached to it, not the other way around as in C (where you have a function and send data to it).
    While there will be some marks for execution, the majority of the marks will be given for how well you write your code (including comments and documentation) and for how well you used O-O principles. Programs written in a C style with most of the code in one class or using static will receive ZERO marks regardless of how well they work.
    You are responsible for checking your turnin by reading the messages turnin responds with. Failure to read these messages will not be an acceptable excuse for submitting an incorrect assignment. About 2% of assignments sent to turnin are unreadable (usually empty) and obtain 0.
    Late submissions
    Late submissions will only be accepted with valid reasons for being late. All requests for assignment extensions must be made via email to the lecturer. Replies for acceptance or refusal will made by email. Instant replies are unrealistic (there is usually a flood of queries into my mail box around assignment due dates) and the best advice is to ask at least 4 days in advance so that you will have a reasonable chance of getting a timely reply and allow yourself enough time to submit something on time if the extension is not granted.
    ALL late submissions will be marked LAST and will NOT be sent to tutors for marking until all other assignments have been marked. As an example, if you submit late and your assignment is not yet marked by the time assignment 2 is due then it will be pushed to the end of the marking pile as the assignments that were submitted on time for assignment 2 will take priority.
    If you make a second submission after the submission date, only the first submission will be marked. We will not mark assignments twice! You can update your submission BEFORE the submission date if you need to - this will just overwrite the first submission. The latest time for a late submission is 5pm on the Wednesday after the due date. This is because, either a solution will be handed out at that lecture or details of the assignment will be discussed at the lecture. I cannot accept any assignment submissions after that time for any reason at all including medical or other valid reasons. For those who are given permission to be later than the maximum submission time � a different assignment will be handed out. Remember, if you decide to submit late you are VERY UNLIKELY to receive feedback on your assignments during semester.
    Assignments will be removed from turnin and archived elsewhere then forwarded to tutors for marking on the morning after the assignment is due. A different tutor will mark each of your assignments � do not expect the tutor you see at the tutorials to be your marker.
    Marks will be returned via email to your computer science yallara account � ideally within 2 weeks. I will send marks out when I receive them so do not send email asking where your marks are just because a friend has theirs. If you want your email forwarded to an external account, then place a valid .forward file into your yallara account. The Help Desk on level 10 can assist you in setting this up if you do not know how to do it.

    I have seen other people who have blatantly asked for
    other people to do their homework for them, but you
    are the first person I've seen to actually cut and
    paste the entire assignment as it was handed to you.
    Amazing.
    Well, unlike some of the people you're talking about, it seems like zyangfan did at least take a stab at it himself, and does have a question that is somewhat more sepcific that "please do this homework for me."
    Zyangfan,
    marendoj is right, though. Posting the entire assignment is kind of tacky. If you want to post some of it to show us what you're trying to do, please trim it down to the essential points. We don't need to see all the instructor's policies and such.
    Anyway, let me see if I understand what you're asking. You said that you know how to write the code, but only by putting it all in one class, is that right? What part about using separate classes do you not understand? Do you not know how to make code in one class aware that the other class exists? Do you not know how code in class A can call a method in class B?
    Please be a bit more specifice about what you don't understand. And at least try using multiple classes, then when you can't figure out why something doesn't work, explain what you did, and what you think should have happened, and what did happen instead.
    To get you started on the basics (and this should have been covered in your course), you write the code for two classes just like for one class. That is, for class A, you create a file A.java and compile it to A.class. For class B, you create a file B.java and compile it to B.class. Given how rudimentary you question is, we'll skip packages for now. Just put all your class files in the same directory, and don't declare packages in the .java files.
    To call a method in class B from code that's in class A, you'll need an object of class B. You instantiate a B, and then call its methods.
    public class B {
      int count;
      public B() { // constructor
      public void increment() {
        count++;
    public class A {
      public static void main(String args[]) {
        B b = new B();
        b.increment();
    }Is this what you were asking?

  • Events in classes LabVIEW 8.6

    i have class with some member (counter of something)
    and i want to generate a user event when this member has specific values.
    currently i manage to generate the event only if i register the event of the class
    in the Top Vi that use this class
    can i register the event inside the class itself, let say inside the initilize vi that i ave for the this class ?
    thanks
    Solved!
    Go to Solution.

    The question is a little confusing. You can register for the event anywhere you like, but somewhere you pretty much need to have an Event Structure in a running VI waiting for that event to occur.
    What should be aware of these events? Class members
    P.S. On second reading, it seems you might just be asking if you can register the event in a class VI, instead of having to register it in the top-level VI. If that's the case, then yes you can. Just have the Register for Events function inside the Initialize VI of your class and have it output the Event Registration Refnum corresponding to your event.
    Message Edited by Jarrod S. on 11-02-2008 08:48 PM
    Jarrod S.
    National Instruments

  • How to go about optimising this class?

    I'm rather new to actionscript, but I'm figuring it out as I go.
    I am making a game. One of the primary features of this game is darkness. I chose to use tiles to represent areas outside the players sight range, this works great on a small scale. The problem is that once there's lots of darkness tiles it gets a bit laggy.
    This is the class for light sources, currently its a proof of concept.. I plan on having in betweens later so its not just a true or false.
    package
        import flash.display.MovieClip;
        import flash.events.Event;   
        public class LightEmitter extends MovieClip
            private var i:int = 0;
            private var closestH = 0;
            private var lightResistance = 0;
            private var brightness = 1;
            private var targetTile;
            private var baseSightLevel = 400;
            public function LightEmitter()
                this.parent.setChildIndex(this, 0)
                stage.addEventListener(Event.ENTER_FRAME, onJoinFrame);
            public function onJoinFrame(e:Event)
                //Hide darkness
                for (i = 0; i < MainDocument.darkTiles.length; i ++)
                    targetTile = MainDocument.darkTiles[i][0]
                    lightResistance = MainDocument.darkTiles[i][1];
                       if (Math.sqrt(Math.pow(targetTile.x-this.x, 2) + Math.pow(targetTile.y-this.y, 2)) < (baseSightLevel*brightness)/lightResistance)
                        targetTile.alpha = 0;
                    else
                        targetTile.alpha = 0.6;
                this.x = parent.getChildByName("player").x
                this.y = parent.getChildByName("player").y
    This is the class for a tile of darkness.
    package
        import flash.display.MovieClip;
        public class Fog extends MovieClip
            var aDarkTile: Array = new Array();
            public function Fog()
                aDarkTile[0] = this;
                aDarkTile[1] = 1;
                MainDocument.darkTiles[MainDocument.darkTiles.length] = aDarkTile;
    I need to load lots of tiles at a time in addition to any other elements of the game. (but I can unload, or at least hide, tiles that are off screen)
    Any suggestions/tips/alternatives would be greatly appreciated.

    enable the cacheAsBitmap property of your tiles and remove tiles that are no longer on stage.

  • Use of a method in class CL_GUI_ALV_GRID

    Dear all,
    I have a requirement in which i have to use the method - SHOW_GRAPHICS of the class - CL_GUI_ALV_GRID, but the problem is there is a red traffic light in front of the method. Now my dilemma is how to turn that light green so that i can use this method.
    Kindly help.
    Thanks,
    Saurabh Chauhan.

    The red light says that it is a private method .. So it means that this method can not be used out side the class !
    There is a way out ... Create your own class that ZCL_GUI_ALV_GRID that inherits the CL_GUI_ALV_GRID.
    Here you create a public method my_method and in this method call the private method.
    Warning : If the architect had created that method as a Private one ... he must have done it for a reason .. may be this method has access to some attributes that must not be made available to the outside world ... which might cause serious damage !!
    Rule 1: Trust the architect .. If he has made it private.. it is for a reason... and Ideally there can not be any case why some one else would use this method out side the class..
    Hint: May be it is possible to achieve the same without using this method (in a different way) ..
    Regards,
    Varun.

  • Sample coe to use class CL_GUI_ALV_GRID

    Hi All,
    I am having 2 internal tables.
    I need to display the data in these 2 internal tables using ALV.
    I am using the function module REUSE_ALV_LIST_DISPLAY 2 times for 2 internal tables to display data.
    But two outputs are not coming on same screen.
    Can any one give me a sample program to use class CL_GUI_ALV_GRID to display 2 List.
    Screen for two custom controls I will create.
    I just need to display data.
    Pls Guide

    zsat_alvoops_final.
    TABLES: vbap, vbak.
    TYPES : BEGIN OF str1,
            mvbeln TYPE vbeln,
            mposnr TYPE posnr,
            mmatnr TYPE matnr,
            mkwmeng TYPE kwmeng,
            mmeins TYPE meins,
            mpstyv TYPE pstyv,
            END OF str1.
    DATA: grid TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          it_fcat TYPE lvc_t_fcat,
          zsat_alvfcat2 TYPE STANDARD TABLE OF str1.
    DATA : oit TYPE TABLE OF str1,
           v_vkorg TYPE vbak-vkorg,
           v_vtweg TYPE vbak-vtweg,
           v_vkbur TYPE vbak-vkbur,
           v_vkgrp TYPE vbak-vkgrp,
           v_erdat TYPE vbak-erdat,
           v_bsark TYPE vbak-bsark,
           v_spart TYPE vbap-spart,
           wa TYPE str1.
    SELECT-OPTIONS : s_vkorg FOR v_vkorg,
                     s_vtweg FOR v_vtweg,
                     s_vkbur FOR v_vkbur,
                     s_vkgrp FOR v_vkgrp,
                     s_erdat FOR v_erdat,
                     s_bsark FOR v_bsark,
                     s_spart FOR v_spart.
    SELECT vbak~vbeln vbap~posnr vbap~matnr vbap~kwmeng vbap~meins vbap~pstyv
      INTO TABLE oit
      FROM vbak INNER JOIN vbap ON vbak~vbeln = vbap~vbeln
      WHERE ( vbak~vkorg IN s_vkorg ) AND ( vbak~vtweg IN s_vtweg ) AND ( vbak~vkbur IN s_vkbur )
      AND ( vbak~vkgrp IN s_vkgrp ) AND ( vbak~erdat IN s_erdat ) AND ( vbak~bsark IN s_bsark ) AND ( vbap~spart IN s_spart ).
    CALL SCREEN 9000.
    MODULE status_9000 OUTPUT.
      SET PF-STATUS 'ZSTATUS'.
      IF g_custom_container IS INITIAL.
        CREATE OBJECT g_custom_container
          EXPORTING
            container_name = 'CCONTAINER'.
        CREATE OBJECT grid
          EXPORTING
            i_parent = g_custom_container.
      ENDIF.
      CALL METHOD grid->set_table_for_first_display
        EXPORTING
          i_structure_name = 'ZSAT_ALVFCAT2'   * this is the custom structure which has been made in SE11 remember to declare it in this program in DATA.
        CHANGING
          it_outtab        = oit.     
    ENDMODULE.

  • Question about required workshop classes for OCP

    Im working on finishing up my OCP in a few months. Quick question about the workshop class. Is there a test at the end of the week?
    Also how do most people pay for these classes? They are pretty steep and my company doesnt pay for stuff like this for me. Im paying totally out of my own pocket. Also why is the online class the same amount as the instructor lead class? Its not like im in a room at some building that Oracle has to lease for use or something.

    RedDeuce wrote:
    Im working on finishing up my OCP in a few months.What Certificate exactly are you working towards?
    Also how do most people pay for these classes? They are pretty steep and my company doesnt pay for stuff like this for me. Im paying totally out of my own pocket.Then talk to your employer again or maybe look for other jobs that support your plan better.
    Also why is the online class the same amount as the instructor lead class? Its not like im in a room at some building that Oracle has to lease for use or something.They know that you might save on expenses for travel and hotel etc.

  • How to display LOGO in ALV grid when using class CL_GUI_ALV_GRID

    Hello everyone,
    please let me know how to display Company logo as the header part in the report program with the class cl_gui_alv_grid.
    Thanks and regards,
    Padma.

    Hi,
    Got this info from a site.
    http://sap.ittoolbox.com/documents/document.asp?i=3213
    In the transaction OAOR, you should be able to insert your company Logo.
    GOTO - OAOR (Business Document Navigator)
    Give Class Name - PICTURES Class Type - OT..... then Execute
    It will show you the list, then select ENJOYSAP_LOGO.
    On that list, you will find one control with a "create" tab.
    Click std. doc types.
    Select SCREEN and double-click.
    It will push FILE selection screen.
    Select your company logo (.gif) and press OK.
    It will ask for a description- for instance: "company logo".
    It will let you know your doc has been stored successfully.
    You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
    Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
    Try this one.
    Also have a look at this link
    http://www.sap-img.com/fu002.htm
    Message was edited by: Judith Jessie Selvi

  • Creating a singleton Event Listener class

    A typical singleton OO design pattern involved a protected (or private)
    no-arg
    constructor and a public instance() method that manages a private static
    variable
    referencing the single instance, internally invoking the no-arg constructor.
    A class designated in web.xml as a <listener> must have a public no-arg
    constructor.
    (from http://e-docs.bea.com/wls/docs61/webapp/app_events.html#178593)
    Anyone thoughts on how to accomplish both goals?
    What I want to do: I'd like to set up a singleton to listen for session
    events.
    Other code will query this one-and-only-one session event listener for
    various
    information. Some of this info I can currently get from the runtime via
    MBeans but
    some I can't, hence my investigation into session event listeners.
    TIA, matt.

    Hi Matt,
    This sounds like a case where you will need to have two classes -- your
    singleton class, and then your session event listener class, which would use
    the singleton class.
    Dennis Munsie
    Developer Relations Engineer
    BEA Support
    "Matt Hembree" <[email protected]> wrote in message
    news:[email protected]..
    A typical singleton OO design pattern involved a protected (or private)
    no-arg
    constructor and a public instance() method that manages a private static
    variable
    referencing the single instance, internally invoking the no-argconstructor.
    >
    A class designated in web.xml as a <listener> must have a public no-arg
    constructor.
    (from http://e-docs.bea.com/wls/docs61/webapp/app_events.html#178593)
    Anyone thoughts on how to accomplish both goals?

  • About Event

    HI!
    I got a question about Event structure,Attached is a simple example, there 's one VI in each of these two event.Is it possible to make the two VI(VI 1,VI 2) run at the same time? because when i run Example.VI,i can only make one of the VI run,if i want to run the other one,i have to close the current one,any suggestion? thanks!
    Attachments:
    Event.llb ‏59 KB

    If I understand correctly this is the scenario that you're looking at. The user presses the vi1 button and vi1 begins running. This vi continues operating until the Stop button is pressed in vi1. You want the user to be able to press the vi2 button and have vi2 begin running also.
    One possible solution is to use notifiers in your event structure instead of putting the vis there. You can then put the vis in parallel loops triggered by the notifier. I have attached a quick example to show how this would work. This approach allows each of the vis to be started and stopped as many times as you like in any order.
    I would also recommend that you use a reference to the Stop button on the main vi to allow you to stop the subvis.Message Edited by John Rich on 06-10-2005 11:59 AM
    Attachments:
    Event[1].llb ‏93 KB

Maybe you are looking for