Custom tile and event handling

Hello Experts,
We are trying to implement custom tiles in our SAPUI5 application , where clicking on each tile would have different application flow. For example, we have couple of tiles as "My Inbox" and  "My WorkOrders". Clicking on  "My Inbox" would open View1 where as "My WorkOrders" would open  View2. Is it possible via "TileContainer" > "StandardTile". From the demokit we , did not get much idea, so any code snippet with brief explanation would be a great help.
Thanks in advance for your help!!
Regards,
DR

Hi Diptanu,
               Please refer this link.
Regards
Moulika

Similar Messages

  • Custom Pre Process Event Handler in OIM 11g for middle initials

    Hi,
    I am trying to congiure a Custom Pre Process Event Handler for generating middle name in OIM 11g and I am following the steps as given in metalink ID: *1262803.1*
    Even after successfully performing all the steps I am not able to get the middle initials in Admin Console when I create a new user.
    1) Directory structure for the application that I have created through JDeveloper.
    CustomApplication/
    |-- CustomApplication.jws
    `-- CustomProject
    |-- CustomProject.jpr
    |-- classes
    | `-- com
    | `-- example
    | `-- custompph
    | `-- CustomPreProcessEventHandler.class
    `-- src
    `-- com
    `-- example
    `-- custompph
    `-- CustomPreProcessEventHandler.java
    2) Directory structure for Plugins directory
    My Plugin.xml :
    <?xml version="1.0" encoding="UTF-8" ?>
    <oimplugins>
    <plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
    <plugin pluginclass="com.example.custompph.CustomPreProcessEventHandler"
    version="1.0" name="CustomPreProcessEventHandler" />
    </plugins>
    </oimplugins>
    plugin/
    |-- lib
    | `-- com
    | `-- example
    | `-- custompph
    | `-- CustomPreProcessEventHandler.class
    |-- middlename.zip
    `-- plugin.xml
    Copied the middlename.zip in the plugin folder in OIM_HOME and registered it successfully.
    3) Created a EventHandlers file and imported it successfully using importmetadata.
    My EventHandlers.xml:
    <?xml version='1.0' encoding='utf-8'?>
    <eventhandlers>
    <!-- Custom preprocess event handlers -->
    <action-handler
    class="com.example.custompph.CustomPreProcessEventHandler"
    entity-type="User"
    operation="CREATE"
    name="CustomPreProcessEventHandler"
    stage="preprocess"
    order="10"
    sync="TRUE"/>
    </eventhandlers>
    I checked the logs as well but could not find something which can help me to proceed.
    Also please advise is their any mapping that I need to do in *"Design Console"*
    Please advise !!!!!
    Thanks

    My lib file contains the package as mentioned in the metalink.
    Heirarchy in Plugin folder :
    1) plugin.xml
    2) Lib ( lib contains 3 folders : com/example/custompph; And inside custompph is my CustomPreProcessEventHandler.class file)
    You mean to say i should not copy the entire package in lib but only the jar file of the CustomPreProceessEventHandler.class* file.
    If i put only a .jar file in lib i get the following error.
    "Error occured during the use of plugin registering utility. The plugin zip does not contain the definition of plugin class com.example.custompph.CustomPreProcessEventHandler"
    Thanks
    Edited by: 870050 on Jul 4, 2011 4:30 AM

  • UIX with XSQL as XML data provider and event handler

    Hello ,
    I would like to bind XML data to messageinput elements of a form element
    as values to be presented before entering (data provider)
    as well as input values to be persisted after completing the form (event handler).
    My impression (as a newbee) is that only for BC4J integration there is a bidirectional binding with view objects.
    Can i use 'include' to bind a static xml file as data source for output?
    How can i use XSQL to be bound as data for input as well as for output of a form?
    A last question concerning a page with 3 tabs:
    do i need 3 different pages and requests to get the data of the 3 tabs
    or is it possible to get the whole data of the page in one request
    and distribute it over the 3 tabs.
    Any help appreciated
    Thanks
    Klaus Dreistadt

    You could do this, but we don't provide any tools to make this easy.
    You'd have to write an implement of the DataObject interface
    that gives your UI access to the XML document, and write custom
    event handlers to perform the "set" side of things. The Data Binding
    and UIX Controller chapters of the UIX developer's guide will give you
    a high-level view of how to accomplish this, but nothing specifically
    about reading or writing to XML documents.

  • User Recon and Event Handler  Issue in OIM11g

    Hello Experts,
    I am developing a Trusted Source Recon (User) for a proprietary application. I have devloped two java classes and put them into a jar file and placed the same jar in both ScheduleTask and EventHandlers directory of OIM.
    1.UserRecon class -- for User Recon
    2. EventHandler class -- update user's password after reconciling the user using API.
    In the User Recon class , I have defined a static HashMap variable to store the user and user's password as a class variable. The flow will be like this,
    1. Query trsuted source
    2. Reconcile user (except password because password can not be)
    3. Update the map with userid (key) and password.
    4. After reconciling , In the event handler use the same map to read user's password and set the password in OIM using API. (setXelleratePassword).
    5.After successful password set remove the entry from Map.
    The idea is to avoid making additional call to trusted source to retrieve the user's password.
    This worked in OIM9102. But when I tested the same in 11g it did not work.... Though the User Recon class updates the record into the HashMap , In the eventhandler , the HashMap is always coming as "empty".
    I did the below changes for 11g,
    1. Modified the EventHandler class to suite for 11g.
    2. Deployed the event handler as a plugin
    3. Placed the same jar file in Schedule task directory of OIM 11g
    I am unable find out where it is going wrong?? and tired of troubleshooting. Can you assist me ?
    Thanks and Regards
    INIYA

    INIYA wrote:
    Hello Experts,
    I am developing a Trusted Source Recon (User) for a proprietary application. I have devloped two java classes and put them into a jar file and placed the same jar in both ScheduleTask and EventHandlers directory of OIM.
    1.UserRecon class -- for User Recon
    2. EventHandler class -- update user's password after reconciling the user using API.
    In the User Recon class , I have defined a static HashMap variable to store the user and user's password as a class variable. The flow will be like this,
    1. Query trsuted source
    2. Reconcile user (except password because password can not be)
    3. Update the map with userid (key) and password.
    4. After reconciling , In the event handler use the same map to read user's password and set the password in OIM using API. (setXelleratePassword).
    5.After successful password set remove the entry from Map.
    The idea is to avoid making additional call to trusted source to retrieve the user's password.
    This worked in OIM9102. But when I tested the same in 11g it did not work.... Though the User Recon class updates the record into the HashMap , In the eventhandler , the HashMap is always coming as "empty".
    I did the below changes for 11g,
    1. Modified the EventHandler class to suite for 11g.
    2. Deployed the event handler as a plugin
    3. Placed the same jar file in Schedule task directory of OIM 11gHope there are two jars, if this is the case place the secondary jar in lib folder, than make it as plugin.
    >
    I am unable find out where it is going wrong?? and tired of troubleshooting. Can you assist me ?
    put the printstacktrace, so that problem can be identify
    sample code
    HashMap hash= null;
    try{
    hash = get map from other class
    //class be load at this point, if class is not loaded than you will get exception.
    }catch(Throwable t){
    // hope you will get some error or exception here
    t.printstacktrace();
    >
    Thanks and Regards
    INIYAPaste you sample code, if it couldn't help.

  • Beginners Questions about Multiple JPanels in JFrame and event handling

    I am a newbie with SWING, and even a newerbie in Event Handling. So here goes.
    I am writing a maze program. I am placing a maze JPanel (MazePanel) at the center of a JFrame, and a JPanel of buttons (ButtonPanel) on the SOUTH pane. I want the buttons to be able to re-randomize the maze, solve the maze, and also ouput statistics (for percolation theory purposes). I have the backbone all done already, I am just creating the GUI now. I am just figuring out EventHandlers and such through the tutorials, but I have a question. I am adding an ActionListener to the buttons which are on the ButtonPanel which are on JFrame (SOUTH) Panel. But who do I make the ActionListener--Basically the one doing the work when the button is pressed. Do I make the JFrame the ActionListener or the MazePanel the ActionListener. I need something which has access to the maze data (the backbone), and which can call the Maze.randomize() function. I'm trying to make a good design and not just slop too.
    Also I was wondering if I do this
    JButton.addActionListener(MazePanel), and lets say public MazePanel implments ActionListenerdoesn't adding this whole big object to another object (namely the button actionlistener) seem really inefficient? And how does something that is nested in a JPanel on JFrame x get information from something nested in another JPanel on a JFrame x.
    Basically how is the Buttons going to talk to the maze when the maze is so far away?

    I'm not an expert, but here's what I'd do....
    You already have your business logic (the Maze classes), you said. I'm assuming you have some kind of public interface to this business logic. I would create a new class like "MazeGui" that extends JFrame, and then create the GUI using this class. Add buttons and panels as needed to get it to look the way you want. Then for each button that does a specific thing, add an anonymous ActionListener class to it and put whatever code you need inside the ActionListener that accesses the business logic classes and does what it needs to.
    This is the idea, though my code is totally unchecked and won't compile:
    import deadseasquirrels.mazestuff.*;
    public class MazeGui extends JFrame {
      JPanel buttonPanel = new JPanel();
      JPanel mazePanel = new JPanel();
      JButton randomizeB = new JButton();
      JButton solveB = new JButton();
      JButton statsB = new JButton();
      // create instanc(es) of your Maze business logic class(es)
      myMaze = new MazeClass();
      // add the components to the MazeGui content pane
      Component cp = getContentPane();
      cp.add(); // this doesn't do anything, but in your code you'd add
                // all of your components to the MazeGui's contentpane
      randomizeB.addActionListener(new ActionListener {
        void actionPerformed() {
          Maze newMaze = myMaze.getRandomMazeLayout();
          mazePanel.setContents(newMaze); // this is not a real method!
                                          // it's just to give you the idea
                                          // of how to manipulate the JPanel
                                          // representing your Maze diagram,
                                          // you will probably be changing a
                                          // subcomponent of the JPanel
      solveB.addActionListener(new ActionListener {
        void actionPerformed() {
          Solution mySolution = myMaze.getSolution();
          mazePanel.setContents(mySolution); // again, this is not a real
                                             // method but it shows you how
                                             // the ActionListener can
                                             // access your GUI
      // repeat with any other buttons you need
      public static void main(String[] args) {
        MazeGui mg = new MazeGui();
        mg.setVisible(true);
        // etc...
    }

  • NullPointerException and event handling

    In this forum I want to know why my program doesn't work. In my program, I want to show the text in JTextfield (Swing) if the user click Jbutton, but the rusult show this comment: java.lang.NullPointerException
    Why can this happen in my programm?
    The Scrypt of my program:
    //event handling
    itemBuka.addActionListener((ActionListener) this);//itemBuka is JButton
    public void actionPerformed(ActionEvent e){
    String perintah = e.getActionCommand();
    if (perintah.equals("Buka...")){
    f1.setText("bisa"); // f1 is a JTextfield and want to shoe the word "bisa"
    }

    public void actionPerformed(ActionEvent e){
    String perintah = e.getActionCommand();
    if (perintah.equals("Buka...")){
    f1.setText("bisa"); // f1 is a JTextfield and
    d and want to shoe the word "bisa"
    }A NullPointerException is indicative of a method call invoked on a null reference.
    This piece of code is insufficient to tell you why it is occuring, annd you didn't even mention the line where the exception is thrown.
    A good guess is that f1 is somehow appearing as null... might be a problem with the scope or something that your code does!
    So, post the complete code.

  • Custom Validations and Error Handling

    Hi
    I have a requirement that I have to use the custom validation and the errors and/or exceptions should display in the page. All the errors needs to be displayed in the page at the same time.
    Suppose If i have two fields like...1)First Name and 2) BirthDate ...both are required fields. If user does not enter any values for both the fields, the errors should display in the page like 'First Name is required! Save Failed' /n
    'Float the mouse cursr over the red arrows to see the filed serror mesg'. So all the errors in JSF page should be recorded and displayed when user mouse over taht particular component.
    I am new to JSF. Can you please anybody tell me what is best way to implement this in JSF?

    We should not use the JSF built-in validation framework and desiging the custom validation. For that we are writing the validate() method in BackingBean.
    My Requirement is as follows...
    Capture all the errors in JSF page and display the same JSF page with all the errors.
    For example: If I have 5 fields in form, and 3 fields out of it fails in validation ...we need to show the page with all the fields and some kind of Red border and arrow on the fileds that are failed in validation.
    Also in the bottom of the page we need to display the first field error mesg .....
    -- Suppose say First Name, Last Name, DOB, Gender, Field5 are the fields and only Last Name, DOB and field5 are failed in validation...
    Then we have to display in the botton of the page **{color:#ff0000}'Last Name is required! Save Failed{color}**' along with this,
    We need to display the mesg *{color:#ff0000}''Float the mouse cursor over the red arrows to see the filed error mesg'{color}*. -> This means we are dislaying the page with red arrows on the fileds that are failed in validation.
    So when user mouse over in the arrow...we should display the error message for that particular field.

  • LIST output and event handling in OO ALV and

    Hi,
    I am creating an ALV Report.
    How can i Display the Grid as a List. I am abke to change the view from the first grid that is created. but i need to show it as a list output from beginning.
    Also i have created a hotspot in and it works when the ALV is displayed in Grid Format but it does not work when i switch the view to list output.
    Any suggestions.
    Regards,
    Tarun Bahal

    *& Report  ZFI_TRIAL_BALANCE
    REPORT  zfi_trial_balance LINE-SIZE 275 LINE-COUNT 3(2) NO STANDARD PAGE HEADING.
    TABLES: bseg.
    TYPES: BEGIN OF ty_bkpf ,
      bukrs TYPE bkpf-bukrs,
      belnr TYPE bkpf-belnr,
      gjahr TYPE bkpf-gjahr,
      budat TYPE bkpf-budat,
      END OF ty_bkpf.
    TYPES: BEGIN OF ty_bseg ,
      bukrs TYPE bseg-bukrs,
      belnr TYPE bseg-belnr,
      gjahr TYPE bseg-gjahr,
      hkont TYPE bseg-hkont,
      END OF ty_bseg.
    TYPES: BEGIN OF ty_bank,
      hkont TYPE bseg-hkont,
      txt50 TYPE skat-txt50,
      open_dmbtr_dr TYPE p,
      open_dmbtr_cr TYPE p,
      trans_dmbtr_dr TYPE p,
      trans_dmbtr_cr TYPE p,
      close_dmbtr_dr TYPE p,
      close_dmbtr_cr TYPE p,
      END OF ty_bank.
    TYPES: BEGIN OF ty_breakup,
      bukrs TYPE bseg-bukrs,
      blart TYPE bkpf-blart,
      belnr TYPE bseg-belnr,
      budat TYPE bkpf-budat,
      umskz TYPE bseg-umskz,
      rebzg TYPE bseg-rebzg,
      lifnr TYPE  bseg-lifnr,
      kunnr TYPE bseg-kunnr,
      name1 TYPE lfa1-name1,
      dmbtr TYPE p,
      END OF ty_breakup.
    INITIALIZATION.
    *       CLASS handler DEFINITION
    CLASS handler DEFINITION.
      PUBLIC SECTION .
        METHODS:handle_hotspot_click                              "handler definition for hotspot_click
        FOR EVENT hotspot_click OF cl_gui_alv_grid
        IMPORTING e_row_id
                  e_column_id
                  es_row_no,
                 handle_top_of_page
        FOR EVENT print_top_of_page OF cl_gui_alv_grid
        IMPORTING table_index,
                handle_subtotal_text
        FOR EVENT subtotal_text OF cl_gui_alv_grid
        IMPORTING es_subtottxt_info
                  ep_subtot_line
                  e_event_data.
    ENDCLASS.                    "handler DEFINITION
    *       CLASS handler IMPLEMENTATION
    CLASS handler IMPLEMENTATION.
      METHOD handle_hotspot_click.                              "handler implementation for hotspot_click
        PERFORM handle_hotspot_click USING e_row_id
                                           e_column_id
                                           es_row_no .
      ENDMETHOD.                    "handle_hotspot_click
      METHOD handle_top_of_page.
        PERFORM handle_print_top_of_page.
      ENDMETHOD.                    "handle_hotspot_click
      METHOD handle_subtotal_text.
        PERFORM handle_subtotal_text USING es_subtottxt_info
                                           ep_subtot_line
                                           e_event_data.
      ENDMETHOD.                    "Subtotal_text
    ENDCLASS.                    "handler IMPLEMENTATION
    DATA: i_set_values TYPE TABLE OF rgsb4,
          wa_set_values LIKE LINE OF i_set_values,
          l_dmbtr TYPE dmbtr,
          l_dmbtr2 TYPE dmbtr,
          l_dmbtr3 TYPE dmbtr,
          l_dmbtr4 TYPE dmbtr,
          l_dmbtr_total TYPE dmbtr,
          l_shkzg TYPE shkzg,
          i_bkpf TYPE STANDARD TABLE OF ty_bkpf,
          i_bseg TYPE STANDARD TABLE OF ty_bseg,
          i_bank TYPE STANDARD TABLE OF ty_bank,
          i_breakup TYPE STANDARD TABLE OF ty_breakup,
          wa_bkpf LIKE LINE OF i_bkpf,
          wa_bseg LIKE LINE OF i_bseg,
          wa_bank LIKE LINE OF i_bank,
          wa_breakup LIKE LINE OF i_breakup,
          ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm,
          l_ktopl TYPE ktopl.
    DATA: gr_alvgrid TYPE REF TO cl_gui_alv_grid,
          gr_alvgrid_0200 TYPE REF TO cl_gui_alv_grid,
          gr_ccontainer TYPE REF TO cl_gui_custom_container,
          gr_ccontainer_0200 TYPE REF TO cl_gui_custom_container,
          gt_fieldcat TYPE lvc_t_fcat,
          gs_layout TYPE lvc_s_layo,
          gt_sort TYPE lvc_t_sort,
          gt_roid TYPE lvc_t_roid,
          gt_exclude TYPE ui_functions,
          g_scrstatus TYPE i,
          gs_variant TYPE disvariant,
          o_handler TYPE REF TO handler.
    CONSTANTS: c_doctype(22) TYPE c VALUE 'ZINFITR01_TRIALBALANCE'.
    DATA gs_stbl TYPE lvc_s_stbl.
    SELECTION-SCREEN: BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: l_date FOR sy-datum.
    PARAMETERS : l_bukrs TYPE bukrs,
                 l_segent TYPE fb_segment.
    SELECTION-SCREEN: END OF BLOCK block1.
    START-OF-SELECTION.
      gs_stbl-row = 'X'.
      gs_stbl-col = 'X'.
      CALL FUNCTION 'G_SET_GET_ALL_VALUES'
        EXPORTING
          setnr         = c_doctype
          table         = 'SKA1'
          class         = '0000'
        TABLES
          set_values    = i_set_values
        EXCEPTIONS
          set_not_found = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CLEAR i_bank.
      LOOP AT i_set_values INTO wa_set_values.
        CLEAR: l_dmbtr, l_dmbtr2, l_dmbtr3, l_dmbtr4, i_bkpf, i_bseg.
        wa_bank-hkont = wa_set_values-from.
        SELECT bukrs belnr budat gjahr FROM bkpf
          INTO CORRESPONDING FIELDS OF TABLE i_bkpf
          WHERE bukrs = l_bukrs
            AND budat < l_date-low.
        LOOP AT i_bkpf INTO wa_bkpf.
          SELECT dmbtr shkzg FROM bseg INTO (l_dmbtr, l_shkzg)
            WHERE bukrs = wa_bkpf-bukrs
              AND belnr = wa_bkpf-belnr
              AND gjahr = wa_bkpf-gjahr
              AND hkont = wa_set_values-from.
            IF l_shkzg = 'S'.
              l_dmbtr2 = l_dmbtr2 + l_dmbtr.
            ELSE.
              l_dmbtr2 = l_dmbtr2 - l_dmbtr.
            ENDIF.
            CLEAR: l_dmbtr, l_shkzg.
          ENDSELECT.
        ENDLOOP.
        IF l_dmbtr2 > 0.
          wa_bank-open_dmbtr_dr = l_dmbtr2.
        ELSE.
          wa_bank-open_dmbtr_cr = l_dmbtr2.
        ENDIF.
        CLEAR: l_dmbtr, i_bkpf, i_bseg.
        SELECT bukrs belnr budat gjahr FROM bkpf
          INTO CORRESPONDING FIELDS OF TABLE i_bkpf
          WHERE bukrs = l_bukrs
            AND budat IN l_date.
        LOOP AT i_bkpf INTO wa_bkpf.
          SELECT dmbtr shkzg FROM bseg INTO (l_dmbtr, l_shkzg)
            WHERE bukrs = wa_bkpf-bukrs
              AND belnr = wa_bkpf-belnr
              AND gjahr = wa_bkpf-gjahr
              AND hkont = wa_set_values-from.
            IF l_shkzg = 'S'.
              l_dmbtr3 = l_dmbtr3 + l_dmbtr.
            ELSE.
              l_dmbtr4 = l_dmbtr4 - l_dmbtr.
            ENDIF.
            CLEAR: l_dmbtr, l_shkzg.
          ENDSELECT.
        ENDLOOP.
    *    IF l_dmbtr3 > 0.
        wa_bank-trans_dmbtr_dr = l_dmbtr3.
    *    ELSE.
        wa_bank-trans_dmbtr_cr = l_dmbtr4.
    *    ENDIF.
        l_dmbtr = l_dmbtr2 + l_dmbtr3 + l_dmbtr4.
        IF l_dmbtr > 0.
          wa_bank-close_dmbtr_dr = l_dmbtr.
        ELSE.
          wa_bank-close_dmbtr_cr = l_dmbtr.
        ENDIF.
        CLEAR: l_dmbtr.
        SELECT SINGLE ktopl FROM t001 INTO l_ktopl WHERE bukrs = l_bukrs.
        SELECT SINGLE txt50 FROM skat INTO wa_bank-txt50
          WHERE spras = sy-langu "( SELECT spras FROM t002 WHERE laiso = sy-langu )
          AND ktopl = l_ktopl
          AND saknr = wa_set_values-from.
        APPEND wa_bank TO i_bank.
        CLEAR wa_bank.
      ENDLOOP.
      LOOP AT i_bank INTO wa_bank.
    *    IF wa_bank-open_dmbtr_cr < 0.
        wa_bank-open_dmbtr_cr = wa_bank-open_dmbtr_cr * -1.
    *    ENDIF.
    *    IF wa_bank-trans_dmbtr_cr < 0.
        wa_bank-trans_dmbtr_cr = wa_bank-trans_dmbtr_cr * -1.
    *    ENDIF.
    *    IF wa_bank-close_dmbtr_cr < 0.
        wa_bank-close_dmbtr_cr = wa_bank-close_dmbtr_cr * -1.
    *    ENDIF.
        MODIFY i_bank FROM wa_bank.
      ENDLOOP.
      SORT i_bank ASCENDING BY hkont.
    END-OF-SELECTION.
    *  SET SCREEN 100.
      CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS01'.
      SET TITLEBAR 'TITLE1'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  save_ok  INPUT
    *       text
    MODULE save_ok INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
    ENDMODULE.                 " save_ok  INPUT
    *&      Module  create_alv  OUTPUT
    *       text
    MODULE create_alv OUTPUT.
      IF gr_alvgrid IS INITIAL.
        CREATE OBJECT gr_ccontainer
          EXPORTING
    *    PARENT                      =
            container_name              = 'CUSTOM_CONTAINER'
            repid                       = sy-repid
            dynnr                       = '0100'
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS                      = 6.
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CREATE OBJECT gr_alvgrid
          EXPORTING
            i_parent          = gr_ccontainer
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5.
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        PERFORM prepare_field_catalog CHANGING gt_fieldcat .
        PERFORM prepare_layout CHANGING gs_layout .
        PERFORM prepare_sort CHANGING gt_sort.
        gs_variant-report = sy-repid.
        gs_variant-variant = 'ABC'.
        gs_variant-handle = '1'.
    *    IF sy-dynnr = '0100'.
        CALL METHOD gr_alvgrid->set_table_for_first_display
          EXPORTING
    *      I_BUFFER_ACTIVE               =
    *      I_BYPASSING_BUFFER            =
    *      I_CONSISTENCY_CHECK           =
    *      I_STRUCTURE_NAME              =
    *      is_variant                    = gs_variant
    *      i_save                        = 'A'
    *      i_default                     = 'X'
            is_layout                     = gs_layout
    *      IS_PRINT                      =
    *      IT_SPECIAL_GROUPS             =
    *      IT_TOOLBAR_EXCLUDING          =
    *      IT_HYPERLINK                  =
    *      IT_ALV_GRAPHICS               =
    *      IT_EXCEPT_QINFO               =
    *      IR_SALV_ADAPTER               =
          CHANGING
            it_outtab                     = i_bank
            it_fieldcatalog               = gt_fieldcat
    *    it_sort                       = gt_sort
    *      IT_FILTER                     =
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4
        IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ELSE.
        CALL METHOD gr_alvgrid->refresh_table_display
          EXPORTING
            is_stable      = gs_stbl
    *        i_soft_refresh = 'X'
          EXCEPTIONS
            finished       = 1
            OTHERS         = 2.
        IF sy-subrc <> 0.
    *     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
      CREATE OBJECT o_handler.
      SET HANDLER o_handler->handle_hotspot_click FOR gr_alvgrid.
      SET HANDLER o_handler->handle_top_of_page FOR gr_alvgrid.
      SET HANDLER o_handler->handle_subtotal_text FOR gr_alvgrid.
    *  ENDIF.
    ENDMODULE.                 " create_alv  OUTPUT
    *&      Form  prepare_field_catalog
    *       text
    *      <--P_GT_FIELDCAT  text
    FORM prepare_field_catalog  CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA: ls_fcat TYPE lvc_s_fcat.
      CLEAR pt_fieldcat.
      CLEAR gt_fieldcat.
    *  IF sy-dynnr = '0100'.
      ls_fcat-fieldname = 'HKONT' .
      ls_fcat-ref_field = 'HKONT'.
      ls_fcat-inttype = 'C' .
      ls_fcat-outputlen = '15' .
      ls_fcat-ref_table = 'BSEG' .
      ls_fcat-coltext = 'G/L Account' .
      ls_fcat-seltext = 'G/L Account' .
      ls_fcat-hotspot = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'TXT50' .
      ls_fcat-ref_field = 'TXT50'.
      ls_fcat-inttype = 'C' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'SKAT' .
      ls_fcat-coltext = 'Description' .
      ls_fcat-seltext = 'Description' .
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'OPEN_DMBTR_DR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Opening Balance: Debit' .
      ls_fcat-seltext = 'Opening Balance: Debit'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'OPEN_DMBTR_CR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Opening Balance: Credit' .
      ls_fcat-seltext = 'Opening Balance: Credit'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'TRANS_DMBTR_DR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Trans Balance: Debit' .
      ls_fcat-seltext = 'Trans Balance: Debit'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'TRANS_DMBTR_CR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Trans Balance: Credit' .
      ls_fcat-seltext = 'Trans Balance: Credit'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'CLOSE_DMBTR_DR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Closing Balance: Debit' .
      ls_fcat-seltext = 'Closing Balance: Debit'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'CLOSE_DMBTR_CR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Closing Balance: Credit' .
      ls_fcat-seltext = 'Closing Balance: Credit'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
    *  ELSE.
    *  ENDIF.
    ENDFORM.                    " prepare_field_catalog
    *&      Form  prepare_layout
    *       text
    *      <--P_GS_LAYOUT  text
    FORM prepare_layout  CHANGING ps_layout TYPE lvc_s_layo.
      DATA l_title(50) TYPE c.
      CONCATENATE 'Trial Balance: ' l_date-low+6(2) '-' l_date-low+4(2) '-'l_date-low(4) ' to ' l_date-high+6(2) '-' l_date-high+4(2) '-'l_date-high(4) INTO l_title RESPECTING BLANKS.
    *  ps_layout-zebra = 'X' .
      ps_layout-grid_title = l_title.
      ps_layout-cwidth_opt = 'X' .
      ps_layout-sel_mode = 'A'.
    *  ps_layout-no_toolbar = 'X'.
      ps_layout-no_headers = 'X'.
      ps_layout-frontend = 'L'.
    ENDFORM.                    " prepare_layout
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE save_ok.
        WHEN 'BACK'.
          SET SCREEN 0.
          LEAVE SCREEN.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  prepare_sort
    *       text
    *      <--P_GT_SORT  text
    FORM prepare_sort  CHANGING pt_sort TYPE lvc_t_sort.
      CLEAR: pt_sort, gt_sort.
      DATA ls_sort TYPE lvc_s_sort .
      IF sy-dynnr = '0100'.
        ls_sort-spos = '1' .
        ls_sort-fieldname = 'HKONT' .
        ls_sort-up = 'X' . "A to Z
        ls_sort-down = space .
        APPEND ls_sort TO pt_sort .
      ELSE.
        ls_sort-spos = '1' .
        ls_sort-fieldname = 'BELNR' .
        ls_sort-up = 'X' . "A to Z
        ls_sort-down = space .
        APPEND ls_sort TO pt_sort .
    *    ls_sort-spos = '2' .
    *    ls_sort-fieldname = 'BELNR' .
    **    ls_sort-up = 'X' . "A to Z
    **    ls_sort-down = space .
    *    ls_sort-subtot = 'X'.
    *    APPEND ls_sort TO pt_sort .
      ENDIF.
    ENDFORM.                    " prepare_sort
    *&      Form  handle_hotspot_click
    *       text
    *      -->P_E_ROW_ID  text
    *      -->P_E_COLUMN_ID  text
    *      -->P_ES_ROW_NO  text
    FORM handle_hotspot_click  USING i_row_id TYPE lvc_s_row
                                     i_column_id TYPE lvc_s_col
                                     is_row_no TYPE lvc_s_roid.
      CLEAR: wa_bank, i_breakup.
      READ TABLE i_bank INTO wa_bank INDEX is_row_no-row_id.
    *TYPES: BEGIN OF ty_breakup,
    *  bukrs TYPE bseg-bukrs,
    *  blart TYPE bkpf-blart,
    *  belnr TYPE bseg-belnr,
    *  budat TYPE bkpf-budat,
    *  umskz TYPE bseg-umskz,
    *  rebzg TYPE bseg-rebzg,
    *  lifnr TYPE  bseg-lifnr,
    *  name1 TYPE lfa1-name1,
    *  dmbtr TYPE p,
    *  END OF ty_breakup.
      SELECT bukrs belnr budat gjahr FROM bkpf
            INTO CORRESPONDING FIELDS OF TABLE i_bkpf
            WHERE bukrs = l_bukrs
              AND budat IN l_date.
      LOOP AT i_bkpf INTO wa_bkpf.
        SELECT bukrs belnr umskz rebzg lifnr kunnr dmbtr shkzg FROM bseg
          INTO (wa_breakup-bukrs, wa_breakup-belnr, wa_breakup-umskz, wa_breakup-rebzg, wa_breakup-lifnr, wa_breakup-kunnr, wa_breakup-dmbtr, l_shkzg)
          WHERE bukrs = l_bukrs
                  AND belnr = wa_bkpf-belnr
                  AND gjahr = wa_bkpf-gjahr
                  AND hkont = wa_bank-hkont.
          SELECT SINGLE blart budat FROM bkpf INTO (wa_breakup-blart, wa_breakup-budat)
            WHERE bukrs = l_bukrs
                  AND belnr = wa_bkpf-belnr
                  AND gjahr = wa_bkpf-gjahr.
          IF wa_breakup-lifnr IS NOT INITIAL.
            SELECT SINGLE name1 FROM lfa1 INTO wa_breakup-name1
              WHERE lifnr = wa_breakup-lifnr.
          ELSE.
            SELECT SINGLE name1 FROM kna1 INTO wa_breakup-name1
            WHERE lifnr = wa_breakup-kunnr.
            wa_breakup-lifnr = wa_breakup-kunnr.
          ENDIF.
        ENDSELECT.
        IF l_shkzg = 'H'.
          wa_breakup-dmbtr = wa_breakup-dmbtr * -1.
        ENDIF.
        IF wa_breakup IS NOT INITIAL.
          APPEND wa_breakup TO i_breakup.
        ENDIF.
        CLEAR wa_breakup.
      ENDLOOP.
      SET SCREEN 200.
      LEAVE SCREEN.
    ENDFORM.                    " handle_hotspot_click
    *&      Module  STATUS_0200  OUTPUT
    *       text
    MODULE status_0200 OUTPUT.
      SET PF-STATUS 'STATUS01'.
      SET TITLEBAR 'TITLE2'.
    ENDMODULE.                 " STATUS_0200  OUTPUT
    *&      Module  USER_COMMAND_0200  INPUT
    *       text
    MODULE user_command_0200 INPUT.
      CASE save_ok.
        WHEN 'BACK'.
    *      CLEAR: gr_alvgrid, gr_ccontainer.
          SET SCREEN 100.
          LEAVE SCREEN .
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0200  INPUT
    *&      Module  create_alv_0200  OUTPUT
    *       text
    MODULE create_alv_0200 OUTPUT.
      IF gr_alvgrid_0200 IS INITIAL.
        CREATE OBJECT gr_ccontainer_0200
              EXPORTING
    *    PARENT                      =
                container_name              = 'CUSTOM_CONTAINER'
                repid                       = sy-repid
                dynnr                       = '0200'
              EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5
                OTHERS                      = 6.
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CREATE OBJECT gr_alvgrid_0200
          EXPORTING
            i_parent          = gr_ccontainer_0200
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5.
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        PERFORM prepare_field_catalog_0200 CHANGING gt_fieldcat .
    *  PERFORM prepare_layout CHANGING gs_layout .
        PERFORM prepare_sort CHANGING gt_sort.
        CALL METHOD gr_alvgrid_0200->set_table_for_first_display
          EXPORTING
    *      I_BUFFER_ACTIVE               =
    *      I_BYPASSING_BUFFER            =
    *      I_CONSISTENCY_CHECK           =
    *      I_STRUCTURE_NAME              =
    *      IS_VARIANT                    =
    *      I_SAVE                        =
    *      I_DEFAULT                     = 'X'
            is_layout                     = gs_layout
    *      IS_PRINT                      =
    *      IT_SPECIAL_GROUPS             =
    *      IT_TOOLBAR_EXCLUDING          =
    *      IT_HYPERLINK                  =
    *      IT_ALV_GRAPHICS               =
    *      IT_EXCEPT_QINFO               =
    *      IR_SALV_ADAPTER               =
          CHANGING
            it_outtab                     = i_breakup
            it_fieldcatalog               = gt_fieldcat
          it_sort                       = gt_sort
    *      IT_FILTER                     =
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4
        IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ELSE.
        CALL METHOD gr_alvgrid_0200->refresh_table_display
          EXPORTING
            is_stable      = gs_stbl
    *        i_soft_refresh = 'X'
          EXCEPTIONS
            finished       = 1
            OTHERS         = 2.
        IF sy-subrc <> 0.
    *     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    *  SET SCREEN 100.
    ENDMODULE.                 " create_alv_0200  OUTPUT
    *&      Form  prepare_field_catalog_0200
    *       text
    *      <--P_GT_FIELDCAT  text
    FORM prepare_field_catalog_0200  CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA: ls_fcat TYPE lvc_s_fcat.
      CLEAR: pt_fieldcat, gs_layout.
      ls_fcat-fieldname = 'BUKRS' .
      ls_fcat-ref_field = 'BUKRS'.
      ls_fcat-inttype = 'c' .
      ls_fcat-outputlen = '5' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Co' .
      ls_fcat-seltext = 'Company Code'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'BLART' .
      ls_fcat-ref_field = 'BLART'.
      ls_fcat-inttype = 'c' .
      ls_fcat-outputlen = '5' .
      ls_fcat-ref_table = 'BKPF'.
      ls_fcat-coltext = 'Doc Typ' .
      ls_fcat-seltext = 'Document Type'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'BELNR' .
      ls_fcat-ref_field = 'BELNR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '12' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Doc Num' .
      ls_fcat-seltext = 'Document Number'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'BUDAT' .
      ls_fcat-ref_field = 'BUDAT'.
      ls_fcat-inttype = 'DATS' .
      ls_fcat-outputlen = '13' .
      ls_fcat-ref_table = 'BKPF'.
      ls_fcat-coltext = 'G/L Date' .
      ls_fcat-seltext = 'G/L Posting Date'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'UMSKZ' .
      ls_fcat-ref_field = 'UMSKZ'.
      ls_fcat-inttype = 'C' .
      ls_fcat-outputlen = '5' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'G/L Indicator' .
      ls_fcat-seltext = 'Special G/L Indicator'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'REBZG' .
      ls_fcat-ref_field = 'REBZG'.
      ls_fcat-inttype = 'C' .
      ls_fcat-outputlen = '13' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Reference' .
      ls_fcat-seltext = 'Invoice Number'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'LIFNR' .
      ls_fcat-ref_field = 'LIFNR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '13' .
      ls_fcat-ref_table = 'LFA1'.
      ls_fcat-coltext = 'Vendor/Customer' .
      ls_fcat-seltext = 'Vendor/Customer Number'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'NAME1' .
      ls_fcat-ref_field = 'NAME1'.
      ls_fcat-inttype = 'C' .
      ls_fcat-outputlen = '50' .
      ls_fcat-ref_table = 'LFA1'.
      ls_fcat-coltext = 'Description' .
      ls_fcat-seltext = 'Description'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'DMBTR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '25' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Amount' .
      ls_fcat-seltext = 'Amount'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
    ENDFORM.                    " prepare_field_catalog_0200
    *&      Form  handle_print_top_of_page
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM handle_print_top_of_page .
      WRITE: sy-uline.
      WRITE: /(255)'Tecnimont ICB' CENTERED.
      WRITE: /(255)'Trial Balance' CENTERED.
      WRITE: 'Trial Balance for ', l_bukrs, ':  From Period - ', l_date-low, 'To Period - ', l_date-high. "LEFT-JUSTIFIED .
      WRITE: /.
      WRITE: / sy-uline.
      FORMAT COLOR 1.
      WRITE: sy-vline, AT 2(59)'Account Code and Name'CENTERED, AT 60 sy-vline, AT 61(45) 'Opening Balance' CENTERED, AT 107 sy-vline, AT 108(41) 'Transactions' CENTERED , AT 150 sy-vline, AT 155(41) 'Closing Balance' CENTERED,  AT 197 sy-vline.
      FORMAT COLOR 4.
      WRITE: sy-vline,'GL Account'LEFT-JUSTIFIED, AT 16(50)'Description'CENTERED, AT 60 sy-vline, AT 61(23) 'Debits'CENTERED, AT 85(23) 'Credits.'CENTERED, AT 107 sy-vline, AT 108(23) 'Debits'CENTERED, AT 128(23)'Credits'CENTERED, AT 150 sy-vline, AT 151(23)
      'Debits'CENTERED, AT 174(23) 'Credits'CENTERED, AT 197 sy-vline.
      FORMAT COLOR OFF.
    *  WRITE: sy-uline.
    ENDFORM.                    " handle_print_top_of_page
    *&      Form  handle_subtotal_text
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM handle_subtotal_text USING es_subtottxt_info TYPE lvc_s_stxt
                                   ep_subtot_line TYPE REF TO data
                                   e_event_data TYPE REF TO
                                   cl_alv_event_data.
      DATA l_bank LIKE wa_bank.
      FIELD-SYMBOLS: <fs1> STRUCTURE wa_bank DEFAULT l_bank,
                   <fs2>.
      IF es_subtottxt_info-criteria = 'TXT50'.
        ASSIGN ep_subtot_line->* TO <fs1>.
        ASSIGN e_event_data->m_data->* TO <fs2>.
        CONCATENATE es_subtottxt_info-keyword 'Grand Summary: '
                     INTO <fs2>.
      ENDIF.
    ENDFORM.                    " handle_subtotal_text
    This  is the Code............... this code creates a Grid and not list and hotspot event wors on grid and not on list.
    Regards,
    Tarun Bahal

  • Custom ComboBoxEditor and event notification at the end of the edition

    Hi,
    I am trying to write a custom ComboBoxEditor that delegates editing to a JFormattedTextField for inputing only integers in a JComboBox. However unlike the JTable and JTree editors, I find that the documentation is not clear on how to notify the parent combo box that the editing has finished and the user value has been validated. Since ComboBoxEditor has the addActionListener() and removeActionListener() methods in its signature, I naturally assumed that I could fire an ActionEvent to notify the combo when for example the JFormattedTextField just fired a PropertyChangeEvent on the "value" property.
    While it looks like this is working OK at first, this causes the following issue: when the component is displayed in a JOptionPane, the dialog box is closed as soon as the ActionEvent is fired which is definitely not the behavior we want the user to experience (note: the event is fired when the delegated editor loses focus for exemple by clicking in the JTextArea in the provided example). I find this quite odd as the default ComboBoxEditor does not behave this way: when the editor looses focus, the combo box simply fires an ItemEvent; however the code from the basic UI or the metal UI never fire an ActionEvent and thus supposedly never notify the parent combo (!). Of course if I disable the ActionEvent firing, the JOptionPane does not close but the JComboBox never fire an ItemEvent...
    Do you have any idea or suggestions to fix this problem?
    Note : for testing purposes, I also made a custom ComboBoxEditor delegating to a JSpinner*. This one experiences exactly the same issue than the one delegating to a JFormattedTextField.
    *Speaking of which: how come JSpinner does not have an API for its own editor??
    package test;
    import java.awt.*;
    import java.awt.event.*;
    import java.beans.*;
    import java.text.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    * @author  fabriceb
    public class TestComboBoxEditor extends JPanel {
      enum Flavor {
        J_FORMATTED_TEXT_FIELD, J_SPINNER, DEFAULT;
      private static final long serialVersionUID = 1l;
       * Default font sizes.
      private static final int[] DEFAULT_SIZE = {8, 9, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72};
       * Editing flag.
      private boolean isEditing;
      private JComboBox sizeCombo = new JComboBox(new DefaultComboBoxModel());
      private JTextArea textArea = new JTextArea("abcdefghijklmnopqrstuvwxyz\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n1234567890.:,;()[]{}<>/\\+-*=!?_'\"@#$%^%&\nThe quick brown fox jumps over the lazy dog. 1234567890");
      private Flavor flavor = Flavor.J_FORMATTED_TEXT_FIELD;
      private boolean fireActionPerformed = true;
      public TestComboBoxEditor(Flavor flavor) {
        super();
        setPreferredSize(new Dimension(500, 150));
        this.flavor = flavor;
        setLayout(new BorderLayout());
        add(sizeCombo, BorderLayout.NORTH);
        add(new JScrollPane(textArea), BorderLayout.CENTER);
        textArea.setEditable(false);
        textArea.setLineWrap(true);
        textArea.setRows(5);
        sizeCombo.setEditable(true);
        sizeCombo.setMaximumRowCount(5);
        switch (flavor) {
          case J_FORMATTED_TEXT_FIELD:
            sizeCombo.setEditor(new SizeComboBoxEditor());
            break;
          case J_SPINNER: {
            sizeCombo.setEditor(new Size2ComboBoxEditor());
        DefaultComboBoxModel sizeModel = (DefaultComboBoxModel) sizeCombo.getModel();
        for (int size : DEFAULT_SIZE) {
          sizeModel.addElement(size);
        sizeCombo.setSelectedItem(textArea.getFont().getSize());
        sizeCombo.addItemListener(new ItemListener() {
          @Override
          public void itemStateChanged(ItemEvent event) {
            if (isEditing) {
              return;
            switch (event.getStateChange()) {
              case ItemEvent.SELECTED:
                  Object value = sizeCombo.getSelectedItem();
                  System.out.println("Received " + value + "\t" + value.getClass());
                  if ((value instanceof Integer) || (value instanceof Long)) {
                    int size = ((Number) value).intValue();
                    DefaultComboBoxModel sizeModel = (DefaultComboBoxModel) sizeCombo.getModel();
                    int sizeCount = sizeModel.getSize();
                    for (int i = 0; i <
                      sizeCount; i++) {
                      int val = ((Number) sizeModel.getElementAt(i)).intValue();
                      // Value already in combo.
                      if (size == val) {
                        break;
    // Insert before current value.
                      else if (val > size) {
                        sizeModel.insertElementAt(size, i);
                        break;
                      // Add at end.
                      else if (i == sizeCount - 1) {
                        sizeModel.addElement(size);
                        break;
                    applyNewFont();
                break;
       * Produces a new font from the user input.
      protected void applyNewFont() {
        int size = ((Number) sizeCombo.getSelectedItem()).intValue();
        Font font = textArea.getFont().deriveFont((float) size);
        textArea.setFont(font);
       * Self-test main.
       * @param args Arguments from the command line.
      public static void main(String... args) {
        SwingUtilities.invokeLater(new Runnable() {
           * {@inheritDoc}
          @Override
          public void run() {
            try {
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              final JFrame frame = new JFrame("Test");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.Y_AXIS));
              for (final Flavor flavor : Flavor.values()) {
                JPanel panel = new JPanel();
                panel.setLayout(new FlowLayout(FlowLayout.LEFT));
                panel.add(new TestComboBoxEditor(flavor));
                switch (flavor) {
                  case J_FORMATTED_TEXT_FIELD:
                  case J_SPINNER:
                    JButton forwardEventButton = new JButton("Forward event");
                    forwardEventButton.addActionListener(new ActionListener() {
                      @Override
                      public void actionPerformed(ActionEvent event) {
                        JOptionPane.showMessageDialog(frame, new TestComboBoxEditor(flavor), flavor + " - Event forwarded", JOptionPane.INFORMATION_MESSAGE);
                    panel.add(forwardEventButton);
                    JButton doNotForwardEventButton = new JButton("Do Not Forward event");
                    doNotForwardEventButton.addActionListener(new ActionListener() {
                      @Override
                      public void actionPerformed(ActionEvent event) {
                        TestComboBoxEditor test = new TestComboBoxEditor(flavor);
                        test.fireActionPerformed = false;
                        JOptionPane.showMessageDialog(frame, test, flavor + " - Event not forwarded", JOptionPane.INFORMATION_MESSAGE);
                    panel.add(doNotForwardEventButton);
                    break;
                  case DEFAULT:
                    JButton openButton = new JButton("Dialog");
                    openButton.addActionListener(new ActionListener() {
                      @Override
                      public void actionPerformed(ActionEvent event) {
                        JOptionPane.showMessageDialog(frame, new TestComboBoxEditor(flavor), flavor + " - Default editor", JOptionPane.INFORMATION_MESSAGE);
                    panel.add(openButton);
                frame.add(panel);
              frame.pack();
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
            catch (Exception e) {
              e.printStackTrace();
       * A combo box editor that only accepts integers.
       * @author  fabriceb
      private class SizeComboBoxEditor implements ComboBoxEditor, PropertyChangeListener, FocusListener {
        private JFormattedTextField delegated = new JFormattedTextField(new NumberFormatter(NumberFormat.getIntegerInstance()));
        private EventListenerList listenerList = new EventListenerList();
        private boolean isEditing;
         * Creates a new instance.
        public SizeComboBoxEditor() {
          delegated.addPropertyChangeListener("value", this);
          delegated.addFocusListener(this);
          delegated.setBorder(null);
         * {@inheritDoc}
        @Override
        public Component getEditorComponent() {
          return delegated;
         * {@inheritDoc}
        @Override
        public void selectAll() {
          delegated.selectAll();
          delegated.requestFocus();
         * {@inheritDoc}
        @Override
        public void setItem(Object anObject) {
          isEditing = true;
          if (delegated.getValue() == null || !delegated.getValue().equals(anObject)) {
            delegated.setValue(anObject);
          isEditing = false;
         * {@inheritDoc}
        @Override
        public Object getItem() {
          return delegated.getValue();
         * {@inheritDoc}
        @Override
        public void addActionListener(ActionListener l) {
          listenerList.add(ActionListener.class, l);
         * {@inheritDoc}
        @Override
        public void removeActionListener(ActionListener l) {
          listenerList.remove(ActionListener.class, l);
        protected void fireActionEvent(Integer value) {
          Object listeners[] = listenerList.getListenerList();
          ActionEvent actionEvent = null;
          for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == ActionListener.class) {
              // Lazily create the event.
              if (actionEvent == null) {
                actionEvent = new ActionEvent(delegated, ActionEvent.ACTION_PERFORMED, String.valueOf(value));
              ((ActionListener) listeners[i + 1]).actionPerformed(actionEvent);
         * {@inheritDoc}
        @Override
        public void propertyChange(PropertyChangeEvent event) {
          if (!isEditing) {
            Object value = delegated.getValue();
            if (value == null) {
              return;
            int val = ((Number) value).intValue();
            System.out.println("Should forward " + value);
            if (fireActionPerformed) {
              fireActionEvent(val);
        @Override
        public void focusGained(FocusEvent e) {
          System.out.println("JFormattedTextField: Focus gained.");
        @Override
        public void focusLost(FocusEvent e) {
          System.out.println("JFormattedTextField: Focus lost.");
       * A combo box editor that only accepts integers.
       * @author  fabriceb
      private class Size2ComboBoxEditor implements ComboBoxEditor, ChangeListener, FocusListener {
        private SpinnerNumberModel model = new SpinnerNumberModel(1, 1, 100, 1);
        private JSpinner delegated = new JSpinner(model);
        private EventListenerList listenerList = new EventListenerList();
        private boolean isEditing;
         * Creates a new instance.
        public Size2ComboBoxEditor() {
          delegated.addChangeListener(this);
          delegated.addFocusListener(this);
          delegated.setBorder(null);
         * {@inheritDoc}
        @Override
        public Component getEditorComponent() {
          return delegated;
         * {@inheritDoc}
        @Override
        public void selectAll() {
          //delegated.getEditor().selectAll();
          delegated.requestFocus();
         * {@inheritDoc}
        @Override
        public void setItem(Object anObject) {
          isEditing = true;
          if ((anObject != null) && (delegated.getValue() == null || !delegated.getValue().equals(anObject))) {
            delegated.setValue(anObject);
          isEditing = false;
         * {@inheritDoc}
        @Override
        public Object getItem() {
          return delegated.getValue();
         * {@inheritDoc}
        @Override
        public void addActionListener(ActionListener l) {
          listenerList.add(ActionListener.class, l);
         * {@inheritDoc}
        @Override
        public void removeActionListener(ActionListener l) {
          listenerList.remove(ActionListener.class, l);
        protected void fireActionEvent(Integer value) {
          Object listeners[] = listenerList.getListenerList();
          ActionEvent actionEvent = null;
          for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == ActionListener.class) {
              // Lazily create the event.
              if (actionEvent == null) {
                actionEvent = new ActionEvent(delegated, ActionEvent.ACTION_PERFORMED, String.valueOf(value));
              ((ActionListener) listeners[i + 1]).actionPerformed(actionEvent);
         * {@inheritDoc}
        @Override
        public void stateChanged(ChangeEvent event) {
          if (!isEditing) {
            Object value = delegated.getValue();
            if (value == null) {
              return;
            int val = ((Number) value).intValue();
            System.out.println("Should forward " + value);
            if (fireActionPerformed) {
              fireActionEvent(val);
        @Override
        public void focusGained(FocusEvent e) {
          System.out.println("JSpinner: Focus gained.");
        @Override
        public void focusLost(FocusEvent e) {
          System.out.println("JSpinner: Focus lost.");
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    Thanks for the advice but that's not what I am looking for. My itend is to later have a fully custimized editor that implied pattern configuration (for currency, scientific units, etc..) as well as context popup support as well as complitly different kinds of editors (ie: not-textfield based) but that still fit within the combo area (ie: the address bar for Vista's Explorer).
    I am still considering keeping a (weak) reference to the parent combo to manually edit its content when the PropertyChangeEvent is received.
    Edited by: bouye on Sep 1, 2008 2:23 PM

  • LIST output and event handling in OO ALV

    Hi Guys,
    I am creating an ALV Report using cl_gui_alv_grid.
    after the list is displayed i can change the display t output list from the ALV toolbar.
    1. how can i shot list output by default.
    2. why does hotspot event not work when the display is switched to list output.
    3. how can i display the subtotal on all pages of the list.
    Regards,
    Tarun Bahal

    Hi,
    for your questions
    1. To shortlist thefields in output
        In the fieldcatalog merge,select the fields which are to be populated in the outputlist.There standard list you can display.
    On that you can select the fields in ALV toolbar.
    2.To which field you need to HOTSPOT click, for that field in fieldcatalogue merge
       select the hotspot = 'X'.
    for example
    If gs_fieldcat-fieldname = 'MATNR'.
    gs_fieldcat-table_name = 'MARA'.
    gs_fieldcat-ref_field = 'MATNR'.
    Gs_fieldcat-hotspot = 'X'.
    append gs_fieldcat to gt_fieldcat.
    endif.
    this will hotspot on the field material number.
    After declaring this you need to maintain the hotspot click event.
    ~~~~~~~~~
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_hotspot_click
            FOR EVENT HOTSPOT_CLICK OF cl_gui_alv_grid
                IMPORTING e_row e_column.
      PRIVATE SECTION.
    ENDCLASS.
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD hotspot_click.
        DATA: ls_sflight LIKE LINE OF gt_sflight.
    read selected row from internal table gt_sflight
        READ TABLE gt_sflight INDEX e_row-index INTO ls_sflight.
    select corresponding lines of table sbook
        PERFORM select_table_sbook USING ls_sflight
                                   CHANGING gt_sbook.
    call dialog screen and display new alv control
        CALL SCREEN 101 STARTING AT 10 5.
      ENDMETHOD.                           "handle_double_click
    ENDCLASS.
    This is very important after defining the events,you need to set the event before calling grid display.
      CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_double_click FOR grid1.
    for your reference you check the standard program BCALV_GRID_03**
    There they have declared Double click, in your case you maintain with
    HOTSPOT CLICK **.
    3. If you want subtotal on  the field, sort that filed for sort structure.
        and for which field do you need total, for that field do-sum = 'X'
        in the fieldcatalogue merge.
      gs_sort-fieldname ='MATNR'
      gs_sort-up = 'X'.
      gs_sort-subtot = 'X'.
      append gs_sort to gt_sort.
    for calculating the total to the field
    gs_fieldcat-table_name = 'MARA'.
    gs_fieldcat-ref_field = 'NTGEW'.(Gross weight)
    Gs_fieldcat-dosum = 'X'.
    append gs_fieldcat to gt_fieldcat.
    endif.
    For every new material
    it calculates the subtotal on Gross weight.(because for NTGEW is gross weight).
    and also it will show the grand total too.
    Hope this will solve your problem
    Dont forget to Reward pointsHi,
    for your questions
    1. To shortlist thefields in output
        In the fieldcatalog merge,select the fields which are to be populated in the outputlist.There standard list you can display.
    On that you can select the fields in ALV toolbar.
    2.To which field you need to HOTSPOT click, for that field in fieldcatalogue merge
       select the hotspot = 'X'.
    for example
    If gs_fieldcat-fieldname = 'MATNR'.
    gs_fieldcat-table_name = 'MARA'.
    gs_fieldcat-ref_field = 'MATNR'.
    Gs_fieldcat-hotspot = 'X'.
    append gs_fieldcat to gt_fieldcat.
    endif.
    this will hotspot on thefield material number.
    3. If you want subtotal on  the field, sort that filed for sort structure.
        and for which field do you need total, for that field do-sum = 'X'
        in the fieldcatalogue merge.
      gs_sort-fieldname ='MATNR'
      gs_sort-up = 'X'.
      gs_sort-subtot = 'X'.
      append gs_sort to gt_sort.
    for calculating the total to the field
    gs_fieldcat-table_name = 'MARA'.
    gs_fieldcat-ref_field = 'NTGEW'.(Gross weight)
    Gs_fieldcat-dosum = 'X'.
    append gs_fieldcat to gt_fieldcat.
    endif.
    For every new material
    it calculates the subtotal on Gross weight.(because for NTGEW is gross weight).
    and also it will show the grand total too.
    Hope this will solve your problem
    Dont forget to Reward points
    Edited by: varisetty madhavi on Mar 7, 2008 6:48 AM

  • Custom alarm and event view

    Hello
    I tried to create custom alarm&event view. I used "read alarm.vi" and "format alarm data.vi" to fill multicolumn listbox where i changed columns names.  Why alarms disapear when they are not active anymore? How can i change that? I would like to have all alarms in table, new and old ones. How can I change colors when alarm is active, inactive or ack?
    thanks

    Hi
    I did it, but... There is always but. I've changed columns names, switch position of 1st and 2nd, and 3rd and 4th column, and alarms in different state have different color. But its not working properly. Few seconds table is changed and few seconds in not. Maybe my PC is too slow, or is it something else. Please look at picture in attachment. Is there easier way to do it?
    Thanks
    Attachments:
    alarmi.JPG ‏113 KB

  • Query about event and event handling

    hi,
    how exactly events are bieng generated. And how they are transmitted and how they
    are caught and handled at low level. I want to trigger my own event whcih can be listen
    by my own listener or some existing listener (obviously implemented from some java listener).
    so help me out.
    TIA
    bhups

    Well, first you create an interface such as FooListener where you define methods, such as foo().
    Now you can make classes that have the method addFooListener(FooListener foo). Then in that class, you can for example decide that doing a certain thing (or based on the time of day or whatever) the class calls all the foo()'s of it's FooListeners and there you go.
    Example code:
    public interface FooListener {
        public void foo(FooEvent evt);
    public class FooEvent {
       private String reason;
       public FooEvent(String reason) {
           this.reason = reason;
       public String getReason() {
          return reason;
    public class Bar {
        List listeners = new LinkedList();
        public void addFooListener(FooListener foo) {
            listeners.add(foo);
        protected void fireFooEvent(String reason) {
           Iterator itr = listeners.iterator();
           FooEvent evt = new FooEvent(reason);
           while(itr.hasNext())
              ((FooListener)itr.next()).foo(evt);
        public void doBar() {
            // code omitted
            fireFooEvent("Bar done");
    }Howzat?

  • Problem with releater and event handling

    Hi Flex genius,
    I have been struggling for the whole day with a problem connected to repeater.
    I have a text field:
    <mx:Text id="shortText" width="300"  text="{newTeaser.currentItem.shortDescription}" styleName="Scandinavian" fontSize="12"  />
    and a label:
    <mx:Label   id="readMoreLabel" x="13" text="{newTeaser.currentItem.readMore}" color="#3C4593" />
    both inside a  Repeater which fetches from an XML:
    <mx:Repeater id="newTeaser" dataProvider="{eventsData}">
    The Repeater works fine, but I need to add a click on the label id="readMoreLabel" that replace the shortText.text with  {newTeaser.currentItem.longDescription} instead of {newTeaser.currentItem.shortDescription}.
    i am quite new in Flex, so I guess I miss some fundamentals.
    Thanks for your help.
    Max

    This code works, and notice the trace(), you CAN have IDs for the controls in the repeater, and you can access them as an array, though I do not make use of this capability in my solution.
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="dataService.send();">
      <mx:Script>
        <![CDATA[
          import mx.rpc.events.ResultEvent;
          import mx.collections.XMLListCollection;
          import mx.controls.Text;
          [Bindable] private var eventsData:XMLListCollection;
          private function dataHandler(evt:ResultEvent):void{
            eventsData = new XMLListCollection(evt.result..item as XMLList);       
          private function clickHandler(evt:MouseEvent):void{
            var txt:Text = VBox(evt.currentTarget.parent).getChildAt(0) as Text;
            for each(var xml:XML in eventsData){
              if(xml.shortDescription == txt.text){
                txt.text = xml.longDescription;
            for each(var obj1:Text in shortText){
              trace("shortText: " + obj1.text);
        ]]>
      </mx:Script>
      <mx:HTTPService id="dataService" url="data.xml" resultFormat="e4x" result="dataHandler(event);"/>
      <mx:Repeater id="newTeaser" dataProvider="{eventsData}">
        <mx:VBox width="100%">
          <mx:Text id="shortText" width="100%"  text="{newTeaser.currentItem.shortDescription}"/>
          <mx:Label id="readMoreLabel" text="{newTeaser.currentItem.readMore}" color="#3C4593"
            click="clickHandler(event);"/>   
        </mx:VBox>
      </mx:Repeater>
    </mx:Application>
    <?xml version="1.0" encoding="utf-8"?>
    <teasers>
      <item>
        <shortDescription>This is short desc one.</shortDescription>
        <readMore>Read More One</readMore>
        <longDescription>This is long desc one.</longDescription>
      </item>
      <item>
        <shortDescription>This is short desc two.</shortDescription>
        <readMore>Read More two</readMore>
        <longDescription>This is long desc two.</longDescription>
      </item>
      <item>
        <shortDescription>This is short desc three.</shortDescription>
        <readMore>Read More three</readMore>
        <longDescription>This is long desc three.</longDescription>
      </item>
    </teasers>

  • Table View MULTI SELECT option and Event handling problems

    Hello All,
    I am facing problem while giving miltselect option in a table view. When i mention multiselect attribute in Select option in table view, i am unable to select all the rows which i want to select,because i have an event onRowSelection event activated so when i select a row then it will automatically go to the event and i am unable to do multiple select.
    Can you guys pl tell me is there any way thtat i can put check boxes in a table column and by that i can get values of row seelct and can perform my subsequent SQL operation.
    Also i am not able to navigate in table view through BYPAGE or BYLINE option. When I click on navigate button then page got refreshed and i lost data.
    One more query guys , can you pl tell me how can i store my internal table values from one event for the another event. I have used EXport/Import but internal table values get refreshed as page got refreshed on event switching/selection.
    Please respond.

    hye rahul.
      as i told you my second solution, will help you . the values remain in the corresponding UI elements.
    For example , you have a drop down and table view. both will trigger events. bind the data of the table at drop down event and bind the dat of the drop down at table event.
    event = cl_htmlb_manager=>get_event( runtime->server->request ).
    CASE event->id.
    when 'dd1'.                   drop down event is fired.
    bind data for drop down
    dd ?= cl_htmlb_manager=>get_data(
                                          request = runtime->server->request
                                          name    = 'dropdown'
                                          id      = dd_id'           " name of the drop down id
    along with drop down bind data for table view
        tbv ?= cl_htmlb_manager=>get_data(
                                          request = runtime->server->request
                                          name    = 'tableView'
                                          id      = 'tbv_id'           " name of the table view
    when 'tbv_id'.                   drop down event is fired.
    bind data for drop down
    dd ?= cl_htmlb_manager=>get_data(
                                          request = runtime->server->request
                                          name    = 'dropdown'
                                          id      = dd_id'           " name of the drop down id
    along with drop down bind data for table view
        tbv ?= cl_htmlb_manager=>get_data(
                                          request = runtime->server->request
                                          name    = 'tableView'
                                          id      = 'tbv_id'           " name of the table view
    This is how data should be binded in case of Stateless application. All the UI elemets must b binded again.. as the global data is refresed again.
    Hope this helps.
    Regards,
    Imran.

  • Navigation control and event handling in jsf rc1

    afternoon folk,
    i am using the rc1 release of jsf, and am sorting down through some things. i have a question on the proper way to do the following:
    i have a page that gathers some user parameters to be used to submit in generating a report. this report will take around 15 minutes to complete. once i submit the parameters from this page, i have a managed bean stored in session scope that will issue a Thread.run() to run the report as a thread, and allow the page to return without timing out. when the report is complete, it sets a flag in the managed bean i can use to determine that the report is complete. from the user's standpoint, i have a page with the refresh attribute set, that uses the jstl conditional operators to check if the report thread is complete or not. this all works fine. what happens though, is that when the report thread is complete and the page that checks the flag indicating this runs, i haven't found a good way to call the page that i have that will display the results of the operation. my 'monitor' page has the following code snippet in it:
         <c:if test="${MyReport.reportThread.reportRunning}">
         <h:outputText id = "spl" value="#{bundle.stillProcessingLabel}" />
         </c:if>
    <c:if test="${MyReport.reportThread.reportRunning == false}">
         <h:commandLink id="done" action="displayResults">
         <h:outputText id = "vrl" value="#{bundle.viewReportsLabel}" />
              </h:outputLink>
         </c:if>
    in my faces-config.xml file, i have a navigation rule that says to go to the results page on a value of displayResults coming from the monitor page.
    <navigation-rule >
    <from-view-id>/monitor.jsp</from-view-id>
    <navigation-case>
    <description>
    Holding page for the user till the reports are completed
    </description>
    <from-outcome>displayResults</from-outcome>
    <to-view-id>/displayResults.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    what happens is that the stillProcessingLabel message displays for each refresh cycle of the page (that is set using the <meta http-equiv="refresh" content="60"> until the report thread is complete, but once that occurs, i do not see the command link output, and the page that called this monitor page is displayed without any user interaction, not the results page.
    any suggestions as to how to handle this, and why it is occurring would be appreciated.
    thanks
    tom

    I had a similar issue in a project I am working on. I'm not sure if I did this the "Best Practices" way or not, but it works perfectly.
    In the head area of my JSP I include the following:
    <f:view>
        <h:outputText id="refresher1" rendered="#{queryHandler.queryRunning}">
            <f:verbatim escape="false">
                <meta http-equiv="refresh"
                      content="5,<%=response.encodeURL(request.getContextPath()+
                              "/queryStatus.jsf")%>">
            </f:verbatim>
        </h:outputText>
        <h:outputText id="refresher1" rendered="#{queryHandler.queryFinishedRunning}">
            <f:verbatim escape="false">
                <meta http-equiv="refresh"
                      content="5,<%=response.encodeURL(request.getContextPath()+
                              "/queryResults.jsf")%>">
            </f:verbatim>
        </h:outputText>This puts a 5 second refresh meta in the header to direct the browser to the correct page based on the status of the query thread.
    There are many ways to accomplish the effect you want. I suggest putting all the controls into the JSP and making use of the rendered attributes instead of the JSTL conditionals to show the controls you want for the state of the application.
    -jeffhoward

Maybe you are looking for

  • MSI K7N2 Delta-ILSR MB Problems, Need Help ASAP!! PLEASE

    Ok  I just got this motherboard (MSI K7N2 Delta) Yesterday and after getting it setup I began overclocking the Processor (an AMD Athlon XP Barton Mobile 2500+) I was at 11x 215 1.750V Perfectly. I moved to 216 it started to seem unstable so I pushed

  • GR/IR Account - one for internal vendor and another for external vendors

    Hi Experts, Can I have two GR/IR accounts - one for internal vendors and another for external vendors?  Please let me know. Thank you. with regards, Muthu Ganapathy.

  • HT204053 Issue with Apple ID iPhone 4S iOS 6.0.1

    There is an issue, with Apple ID on iPhone 4S Apple ID, by entering wrongly Apple ID at the first time, it can't be changed anymore, or I just can't find where to change it, for proper use of App Store application and update of other apps.

  • To change the receiver port name

    Hi , I am doing  a File to IDOC scenario. We have a requirement to post IDOC flat file to the IDOC in SAP system through PI. We have Partner Number in control record which we receive in the flat file and that has to be sent to the SAP system which we

  • LR cannot see PSE DNG or TIFFS

    I have made a panorama in PSE 9 from TIFFS from LR 3.2. I converted the pano to TIFF. LR cannot see the TIFF to imoprt. Tried converting to DNG. LR cannot see the DNG!!! It can see LR created TIFFs and DNG, but not PSE. Is PSE not compatable with LR?