Implementing addAll() method for a Queue

I'm trying to optimize some code I have written which include a addAll(Collection c) method and was wondering if there was a better way to do. I need to check the content on the list before adding new elements as I don't want to have any duplicate.
private LinkedList elements;
public void add(Object elem) {
  if ( !contains(elem) ) {
    this.elements.add(elem);
public void addAll(LinkedList l) {
  for ( Object elem : l ) {     
    add(elem);
}Edited by: qhreul on Mar 7, 2008 5:27 PM

qhreul wrote:
I need to check the content on the list before adding new elements as I don't want to have any duplicate.Then what you really need is a Set, not a List.

Similar Messages

  • Is there a quick fix option for implementing the unimplemented methods for an interface?

    Hi guys,
    It's a useful feature and it seems to exist in raw Eclipse.  I'm aware of the Source -> Override/Implement methods, but this is clunky when you could hover over an interface and hit Ctrl+1 and auto-implement all methods  for that interface (which seems to be pretty much most use cases for me).  At the moment the quick-fix only seems to have renaming options.  Is there something wrong with my configuration?
    If not, is there a way to make feature requests?  :-))
    Thanks!
    Jarrod

    I have safari on my iPone and like it there... thought that I would give it a try. Well, IE just started to slow to a paint drying speed and then wouldn't load anything. Safari was installed but crashed in threee seconds each occuarnce. No reason, no error message.
    I downloaded (eventually) Firefox... loaded it, chose my extentions and have never had a problem with it since. I unloaded 5 times (gave up on) Safari, reset IE, reinstalled the extentions for that and now it is working after cleaning all of the files, passwords, forms autocomplete, temp files, etc.
    Firefox works and all of my freinds and kids use it. That is why it is so good. Remember, if your car worked like your PC you wold junk it right away. Reliability is not in the MS dictionary. It is something that you have to add via tons of fixes, add-ons and program balancing so that conflicts don't occer. I want my MAC, I want my, I want my MAC...

  • Queue access method for In-memory databases

    Hi,
    I am trying to use the Queue access method for an in-memory database
    with no backing file. Here is the how I've created the environment and
    the database.
    int env_flags_create = DB_CREATE | DB_INIT_LOG | DB_INIT_LOCK |
    DB_INIT_MPOOL |DB_INIT_TXN |
    DB_SYSTEM_MEM | DB_RECOVER | DB_THREAD ;
    ret = env->set_shm_key(env, 17);
    ret = env->open(env, R_"in-mem-env", env_flags, 0644);
    int db_flags = DB_CREATE | DB_THREAD | DB_AUTO_COMMIT;
    DB_MPOOLFILE *mpf = subs_db->get_mpf(subs_db);
    mpf->set_flags(mpf, DB_MPOOL_NOFILE, 1);
    ret = queue_db->set_re_len(queue_db, 512);
    ret = queue_db->open(queue_db, NULL, NULL, "queue", DB_QUEUE,
    db_flags, 0644);
    My application has one reader threads and one writer thread. The
    writer write to the queue with the "DB_APPEND" flag and the reader
    consumes the queue using the "DB_CONSUME_WAIT" flag.
    After inserting a few thousand messages the database fails to insert
    any new records and starts returning the following error.
    "unable to allocate space from the buffer cache"
    From the db_stat -e output (attached below) I can see that none of
    the buffer cache pages are ever being freed up.
    149907 Requested pages found in the cache (99%)
    3 Requested pages not found in the cache
    2004 Pages created in the cache
    0 Pages read into the cache
    0 Pages written from the cache to the backing file
    0 Clean pages forced from the cache
    0 Dirty pages forced from the cache
    0 Dirty pages written by trickle-sync thread
    2004 Current total page count
    0 Current clean page count
    2004 Current dirty page count
    4099 Number of hash buckets used for page location
    153851 Total number of times hash chains searched for a page
    BDB reference manual (http://www.oracle.com/technology/documentation/
    berkeley-db/db/api_c/frame.html) says that the pages associated with a
    queue can only be reclaimed by setting a queue extent by using the
    "set_q_extentsize" method. When I try to use this method on my in-
    memory database I get the following error.
    " Extent size may not be specified for in-memory queue database"
    Does this mean that I can never use the queue access method for in-
    memory database? Because no matter how big of a shared memory pool I
    allocate to the in-memory database it will eventually get used up by
    the queue (if I'm inserting and consuming records) and there is no way
    to free up the pages associated with the deleted records.
    thx
    nina

    As far as I know you can choose any method as long as print setting are set to "send to spool"
    Regards
    Juan

  • Equal opportunities for all queues

    Hi!
    My application receives messages from several queues. I use separate MyListener instance for every queue. I synchronized the onMessage method on static Object, so only one message from all queues is processed in given moment:
    MyListener implements MessageListener
    static Object object;
    onMessage (Message message)
    synchronized (object)
    //process
    Do the "synchronized" and "onMessage" promise equal opportunities for all input queues? Can you give a link to relevant documentation?

    According to the JMS specification, a session is a single threaded context that shields applications from worrying about thread safety. So if you create all the queue receivers from the same session, you shouldn't need to synchronize onMessage. To promote equal opportunities, you'll want to synchronize as little as possible - but this is really a JMS implementation issue and you'll probably need to experiment a little to find out if any starvation occurs.
    - Bjarne.

  • SUBMIT inside a method & the automation queue

    Hi,
    I call a method via a tree toolbar button in that calls a standard SAP report using the SUBMIT AND RETURN command. This is done within a screen with several docking containers and split screens attached.
    The problem is that when I press the toolbar button, the report (which also has docking container) is presented partially inside my screen.
    When I put a BREAK-POINT on the SUBMIT statement it is good and I can see SAP's report with no issues and I do not see my screen. When I take the break point off it is back to the original problem.
    This leaves me to think that it is an automation queue problem or something like that.
    How can I get over this?
    Thanks,
    Itay

    Hello Itay
    I tried to simulate your situation. Perhaps you get from this sample report (which was copied from BCALV_TREE_DEMO and the adjusted) some ideas how to solve your problem. In my report all controls are displayed properly.
    [code]&----
    *& Report  ZUS_SDN_BCALV_TREE_DEMO_8                                   *
    *& Based on: BCALV_TREE_DEMO                                           *
    REPORT  zus_sdn_bcalv_tree_demo.
    DATA:
      gd_okcode        TYPE ui_func,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_splitter      TYPE REF TO cl_gui_splitter_container,
      go_cell_left     TYPE REF TO cl_gui_container,
      go_cell_right    TYPE REF TO cl_gui_container,
      go_grid          TYPE REF TO cl_gui_alv_grid.
    data:
      gt_knb1          type standard table of knb1.  " dummy
    *$Comment: begin
    DATA:
      gd_delete_nkey    TYPE lvc_nkey.
    *$Comment: end
    CLASS cl_gui_column_tree DEFINITION LOAD.
    CLASS cl_gui_cfw DEFINITION LOAD.
    DATA tree1  TYPE REF TO cl_gui_alv_tree.
    DATA mr_toolbar TYPE REF TO cl_gui_toolbar.
    INCLUDE <icon>.
    INCLUDE ZUS_SDN_BCALV_TB_EVENT_RCVR8.
    *INCLUDE zus_sdn_bcalv_tb_event_rcvr.
    *include bcalv_toolbar_event_receiver.
    INCLUDE ZUS_SDN_BCALV_TREE_EVENT_RCVR8.
    *INCLUDE zus_sdn_bcalv_tree_event_rcvr.
    *include bcalv_tree_event_receiver.
    DATA: toolbar_event_receiver TYPE REF TO lcl_toolbar_event_receiver.
    DATA: gt_sflight      TYPE sflight OCCURS 0,      "Output-Table
          gt_fieldcatalog TYPE lvc_t_fcat, "Fieldcatalog
          ok_code LIKE sy-ucomm.           "OK-Code
    START-OF-SELECTION.
    Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          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 splitter container
      CREATE OBJECT go_splitter
        EXPORTING
          parent            = go_docking
          rows              = 1
          columns           = 2
         NO_AUTODEF_PROGID_DYNNR =
         NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Get cell container
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_left.
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 2
        RECEIVING
          container = go_cell_right.
    Create ALV grid
      CREATE OBJECT go_grid
        EXPORTING
          i_parent          = go_cell_right
        EXCEPTIONS
          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.
      CALL METHOD go_grid->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNB1'
        CHANGING
          it_outtab        = gt_knb1
        EXCEPTIONS
          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.
    Link the docking container to the target dynpro
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
         CONTAINER                   =
        EXCEPTIONS
          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.
      CALL SCREEN 100.
    END-OF-SELECTION.
    *&      Module  PBO  OUTPUT
          process before output
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN100'.
      IF tree1 IS INITIAL.
        PERFORM init_tree.
      ENDIF.
      CALL METHOD cl_gui_cfw=>flush.
    ENDMODULE.                             " PBO  OUTPUT
    *&      Module  PAI  INPUT
          process after input
    MODULE pai INPUT.
      translate ok_code to upper case.
      CASE ok_code.
        WHEN 'EXIT' OR 'BACK' OR 'CANC'.
          PERFORM exit_program.
    *$Comment: begin
        WHEN 'DELETE'.
          CALL METHOD tree1->delete_subtree
            EXPORTING
              i_node_key                = gd_delete_nkey  " = folder 'AA'
             I_UPDATE_PARENTS_EXPANDER = SPACE
             I_UPDATE_PARENTS_FOLDER   = SPACE
            EXCEPTIONS
              node_key_not_in_model     = 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.
          CALL METHOD tree1->update_calculations
            EXPORTING
              no_frontend_update = ' '. " do frontend update
    *$Comment: end
        WHEN OTHERS.
          CALL METHOD cl_gui_cfw=>dispatch.
      ENDCASE.
      CLEAR ok_code.
      CALL METHOD cl_gui_cfw=>flush.
    ENDMODULE.                             " PAI  INPUT
    *&      Form  build_fieldcatalog
          build fieldcatalog for structure sflight
    FORM build_fieldcatalog.
    get fieldcatalog
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'SFLIGHT'
        CHANGING
          ct_fieldcat      = gt_fieldcatalog.
      SORT gt_fieldcatalog BY scrtext_l.
    change fieldcatalog
      DATA: ls_fieldcatalog TYPE lvc_s_fcat.
      LOOP AT gt_fieldcatalog INTO ls_fieldcatalog.
        CASE ls_fieldcatalog-fieldname.
          WHEN 'CARRID' OR 'CONNID' OR 'FLDATE'.
            ls_fieldcatalog-no_out = 'X'.
            ls_fieldcatalog-key    = ''.
          WHEN 'PRICE' OR 'SEATSOCC' OR 'SEATSMAX' OR 'PAYMENTSUM'.
            ls_fieldcatalog-do_sum = 'X'.
        ENDCASE.
        MODIFY gt_fieldcatalog FROM ls_fieldcatalog.
      ENDLOOP.
    ENDFORM.                               " build_fieldcatalog
    *&      Form  build_hierarchy_header
          build hierarchy-header-information
         -->P_L_HIERARCHY_HEADER  strucxture for hierarchy-header
    FORM build_hierarchy_header CHANGING
                                   p_hierarchy_header TYPE treev_hhdr.
      p_hierarchy_header-heading = 'Hierarchy Header'.          "#EC NOTEXT
      p_hierarchy_header-tooltip =
                             'This is the Hierarchy Header !'.  "#EC NOTEXT
      p_hierarchy_header-width = 30.
      p_hierarchy_header-width_pix = ''.
    ENDFORM.                               " build_hierarchy_header
    *&      Form  exit_program
          free object and leave program
    FORM exit_program.
      CALL METHOD tree1->free.
      LEAVE PROGRAM.
    ENDFORM.                               " exit_program
    *&      Form  build_header
          build table for html_header
    -->  p1        text
    <--  p2        text
    FORM build_comment USING
          pt_list_commentary TYPE slis_t_listheader
          p_logo             TYPE sdydo_value.
      DATA: ls_line TYPE slis_listheader.
    LIST HEADING LINE: TYPE H
      CLEAR ls_line.
      ls_line-typ  = 'H'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      ls_line-info = 'ALV-tree-demo: flight-overview'.          "#EC NOTEXT
      APPEND ls_line TO pt_list_commentary.
    STATUS LINE: TYPE S
      CLEAR ls_line.
      ls_line-typ  = 'S'.
      ls_line-key  = 'valid until'.                             "#EC NOTEXT
      ls_line-info = 'January 29 1999'.                         "#EC NOTEXT
      APPEND ls_line TO pt_list_commentary.
      ls_line-key  = 'time'.
      ls_line-info = '2.00 pm'.                                 "#EC NOTEXT
      APPEND ls_line TO pt_list_commentary.
    ACTION LINE: TYPE A
      CLEAR ls_line.
      ls_line-typ  = 'A'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      ls_line-info = 'actual data'.                             "#EC NOTEXT
      APPEND ls_line TO pt_list_commentary.
      p_logo = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "build_comment
    *&      Form  create_hierarchy
          text
    -->  p1        text
    <--  p2        text
    FORM create_hierarchy.
      DATA: ls_sflight TYPE sflight,
            lt_sflight TYPE sflight OCCURS 0.
    get data
      SELECT * FROM sflight INTO TABLE lt_sflight
                            UP TO 200 ROWS .                "#EC CI_NOWHERE
      SORT lt_sflight BY carrid connid fldate.
    add data to tree
      DATA: l_carrid_key TYPE lvc_nkey,
            l_connid_key TYPE lvc_nkey,
            l_last_key TYPE lvc_nkey.
      LOOP AT lt_sflight INTO ls_sflight.
        ON CHANGE OF ls_sflight-carrid.
          PERFORM add_carrid_line USING    ls_sflight
                                  CHANGING l_carrid_key.
        ENDON.
    *$Comment: begin
        IF ( ls_sflight-carrid = 'AA' ).
          gd_delete_nkey = l_carrid_key.
        ENDIF.
    *$Comment: end
        ON CHANGE OF ls_sflight-connid.
          PERFORM add_connid_line USING    ls_sflight
                                           l_carrid_key
                                  CHANGING l_connid_key.
        ENDON.
        PERFORM add_complete_line USING  ls_sflight
                                         l_connid_key
                                CHANGING l_last_key.
      ENDLOOP.
    calculate totals
      CALL METHOD tree1->update_calculations.
    this method must be called to send the data to the frontend
      CALL METHOD tree1->frontend_update.
    ENDFORM.                               " create_hierarchy
    *&      Form  add_carrid_line
          add hierarchy-level 1 to tree
         -->P_LS_SFLIGHT  sflight
         -->P_RELEATKEY   relatkey
        <-->p_node_key    new node-key
    FORM add_carrid_line USING     ps_sflight TYPE sflight
                                   p_relat_key TYPE lvc_nkey
                         CHANGING  p_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_sflight TYPE sflight.
    set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-t_image = '@3P@'.
      ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensifd_critical.
      APPEND ls_item_layout TO lt_item_layout.
    add node
      l_node_text =  ps_sflight-carrid.
      DATA: ls_node TYPE lvc_s_layn.
      ls_node-n_image   = space.
      ls_node-exp_image = space.
      CALL METHOD tree1->add_node
        EXPORTING
          i_relat_node_key = p_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_sflight
          is_node_layout   = ls_node
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = p_node_key.
    ENDFORM.                               " add_carrid_line
    *&      Form  add_connid_line
          add hierarchy-level 2 to tree
         -->P_LS_SFLIGHT  sflight
         -->P_RELEATKEY   relatkey
        <-->p_node_key    new node-key
    FORM add_connid_line USING     ps_sflight TYPE sflight
                                   p_relat_key TYPE lvc_nkey
                         CHANGING  p_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_sflight TYPE sflight.
    set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-t_image = '@3Y@'.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensified.
      ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
      APPEND ls_item_layout TO lt_item_layout.
    add node
      l_node_text =  ps_sflight-connid.
      CALL METHOD tree1->add_node
        EXPORTING
          i_relat_node_key = p_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_sflight
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = p_node_key.
    ENDFORM.                               " add_connid_line
    *&      Form  add_cmplete_line
          add hierarchy-level 3 to tree
         -->P_LS_SFLIGHT  sflight
         -->P_RELEATKEY   relatkey
        <-->p_node_key    new node-key
    FORM add_complete_line USING   ps_sflight TYPE sflight
                                   p_relat_key TYPE lvc_nkey
                         CHANGING  p_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value.
    set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
      ls_item_layout-class   = cl_gui_column_tree=>item_class_checkbox.
      ls_item_layout-editable = 'X'.
      APPEND ls_item_layout TO lt_item_layout.
      CLEAR ls_item_layout.
      ls_item_layout-fieldname = 'PLANETYPE'.
      ls_item_layout-alignment = cl_gui_column_tree=>align_right.
      APPEND ls_item_layout TO lt_item_layout.
      l_node_text =  ps_sflight-fldate.
      DATA: ls_node TYPE lvc_s_layn.
      ls_node-n_image   = space.
      ls_node-exp_image = space.
      CALL METHOD tree1->add_node
        EXPORTING
          i_relat_node_key = p_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          is_outtab_line   = ps_sflight
          i_node_text      = l_node_text
          is_node_layout   = ls_node
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = p_node_key.
    ENDFORM.                               " add_complete_line
    *&      Form  register_events
          text
    -->  p1        text
    <--  p2        text
    FORM register_events.
    define the events which will be passed to the backend
      DATA: lt_events TYPE cntl_simple_events,
            l_event TYPE cntl_simple_event.
    define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_click.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
      APPEND l_event TO lt_events.
      CALL METHOD tree1->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.                          "#EC NOTEXT
      ENDIF.
    set Handler
      DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
      CREATE OBJECT l_event_receiver.
      SET HANDLER l_event_receiver->handle_node_ctmenu_request
                                                            FOR tree1.
      SET HANDLER l_event_receiver->handle_node_ctmenu_selected
                                                            FOR tree1.
      SET HANDLER l_event_receiver->handle_item_ctmenu_request
                                                            FOR tree1.
      SET HANDLER l_event_receiver->handle_item_ctmenu_selected
                                                            FOR tree1.
    ENDFORM.                               " register_events
    *&      Form  change_toolbar
          text
    -->  p1        text
    <--  p2        text
    FORM change_toolbar.
    get toolbar control
      CALL METHOD tree1->get_toolbar_object
        IMPORTING
          er_toolbar = mr_toolbar.
      CHECK NOT mr_toolbar IS INITIAL.
    add seperator to toolbar
      CALL METHOD mr_toolbar->add_button
        EXPORTING
          fcode     = ''
          icon      = ''
          butn_type = cntb_btype_sep
          text      = ''
          quickinfo = 'This is a Seperator'.                    "#EC NOTEXT
    add Standard Button to toolbar (for Delete Subtree)
      CALL METHOD mr_toolbar->add_button
        EXPORTING
          fcode     = 'DELETE'
          icon      = '@18@'
          butn_type = cntb_btype_button
          text      = ''
          quickinfo = 'Delete subtree'.                         "#EC NOTEXT
    add Dropdown Button to toolbar (for Insert Line)
      CALL METHOD mr_toolbar->add_button
        EXPORTING
          fcode     = 'INSERT_LC'
          icon      = '@17@'
          butn_type = cntb_btype_dropdown
          text      = ''
          quickinfo = 'Insert Line'.                            "#EC NOTEXT
    Add SUBMIT-Button
      CALL METHOD mr_toolbar->add_button
        EXPORTING
          fcode     = 'SUBMIT'
          icon      = '@15@'
          butn_type = cntb_btype_button
          text      = ''
          quickinfo = 'SUBMIT report'.                         "#EC NOTEXT
    set event-handler for toolbar-control
      CREATE OBJECT toolbar_event_receiver.
      SET HANDLER toolbar_event_receiver->on_function_selected
                                                          FOR mr_toolbar.
      SET HANDLER toolbar_event_receiver->on_toolbar_dropdown
                                                          FOR mr_toolbar.
    ENDFORM.                               " change_toolbar
    *&      Form  init_tree
          text
    -->  p1        text
    <--  p2        text
    FORM init_tree.
    create fieldcatalog for structure sflight
      PERFORM build_fieldcatalog.
    create container for alv-tree
    DATA: l_tree_container_name(30) TYPE c,
           l_custom_container TYPE REF TO cl_gui_custom_container.
    l_tree_container_name = 'TREE1'.
    IF sy-batch IS INITIAL.
       CREATE OBJECT l_custom_container
         EXPORTING
               container_name = l_tree_container_name
         EXCEPTIONS
               cntl_error                  = 1
               cntl_system_error           = 2
               create_error                = 3
               lifetime_error              = 4
               lifetime_dynpro_dynpro_link = 5.
       IF sy-subrc <> 0.
         MESSAGE x208(00) WITH 'ERROR'.                        "#EC
    *NOTEXT
       ENDIF.
    ENDIF.
    create tree control
      CREATE OBJECT tree1
        EXPORTING
            parent              = go_cell_left
            node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
            item_selection      = 'X'
            no_html_header      = ''
            no_toolbar          = ''
        EXCEPTIONS
            cntl_error                   = 1
            cntl_system_error            = 2
            create_error                 = 3
            lifetime_error               = 4
            illegal_node_selection_mode  = 5
            failed                       = 6
            illegal_column_name          = 7.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.                          "#EC NOTEXT
      ENDIF.
    create Hierarchy-header
      DATA l_hierarchy_header TYPE treev_hhdr.
      PERFORM build_hierarchy_header CHANGING l_hierarchy_header.
    create info-table for html-header
      DATA: lt_list_commentary TYPE slis_t_listheader,
            l_logo             TYPE sdydo_value.
      PERFORM build_comment USING
                     lt_list_commentary
                     l_logo.
    repid for saving variants
      DATA: ls_variant TYPE disvariant.
      ls_variant-report = sy-repid.
    create emty tree-control
      CALL METHOD tree1->set_table_for_first_display
        EXPORTING
          is_hierarchy_header = l_hierarchy_header
          it_list_commentary  = lt_list_commentary
          i_logo              = l_logo
          i_background_id     = 'ALV_BACKGROUND'
          i_save              = 'A'
          is_variant          = ls_variant
        CHANGING
          it_outtab           = gt_sflight "table must be emty !!
          it_fieldcatalog     = gt_fieldcatalog.
    create hierarchy
      PERFORM create_hierarchy.
    add own functioncodes to the toolbar
      PERFORM change_toolbar.
    register events
      PERFORM register_events.
    adjust column_width
    call method tree1->COLUMN_OPTIMIZE.
    ENDFORM.                    " init_tree[/code]
    <b>INCLUDE ZUS_SDN_BCALV_TB_EVENT_RCVR8.</b>
    [code]----
      INCLUDE ZUS_SDN_BCALV_TB_EVENT_RCVR8                               *
    CLASS lcl_toolbar_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS: on_function_selected
                   FOR EVENT function_selected OF cl_gui_toolbar
                     IMPORTING fcode,
                 on_toolbar_dropdown
                   FOR EVENT dropdown_clicked OF cl_gui_toolbar
                     IMPORTING fcode
                               posx
                               posy.
    ENDCLASS.                    "lcl_toolbar_event_receiver DEFINITION
          CLASS lcl_toolbar_event_receiver IMPLEMENTATION
    CLASS lcl_toolbar_event_receiver IMPLEMENTATION.
      METHOD on_function_selected.
        DATA: ls_sflight TYPE sflight.
        CASE fcode.
          WHEN 'SUBMIT'.
            SUBMIT zus_sdn_two_alv_grids AND RETURN.
          WHEN 'DELETE'.
          get selected node
            DATA: lt_selected_node TYPE lvc_t_nkey.
            CALL METHOD tree1->get_selected_nodes
              CHANGING
                ct_selected_nodes = lt_selected_node.
            CALL METHOD cl_gui_cfw=>flush.
            DATA l_selected_node TYPE lvc_nkey.
            READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
          delete subtree
            IF NOT l_selected_node IS INITIAL.
              CALL METHOD tree1->delete_subtree
                EXPORTING
                  i_node_key                = l_selected_node
                  i_update_parents_expander = ''
                  i_update_parents_folder   = 'X'.
            ELSE.
              MESSAGE i227(0h).
            ENDIF.
          WHEN 'INSERT_LC'.
          get selected node
            CALL METHOD tree1->get_selected_nodes
              CHANGING
                ct_selected_nodes = lt_selected_node.
            CALL METHOD cl_gui_cfw=>flush.
            READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
          get current Line
            IF NOT l_selected_node IS INITIAL.
              CALL METHOD tree1->get_outtab_line
                EXPORTING
                  i_node_key    = l_selected_node
                IMPORTING
                  e_outtab_line = ls_sflight.
              ls_sflight-seatsmax = ls_sflight-price + 99.
              ls_sflight-price = ls_sflight-seatsmax + '99.99'.
              CALL METHOD tree1->add_node
                EXPORTING
                  i_relat_node_key = l_selected_node
                  i_relationship   = cl_tree_control_base=>relat_last_child
                  is_outtab_line   = ls_sflight
                is_node_layout
                it_item_layout
                  i_node_text      = 'Last Child'.              "#EC NOTEXT
              importing
                e_new_node_key
            ELSE.
              MESSAGE i227(0h).
            ENDIF.
          WHEN 'INSERT_FC'.
          get selected node
            CALL METHOD tree1->get_selected_nodes
              CHANGING
                ct_selected_nodes = lt_selected_node.
            CALL METHOD cl_gui_cfw=>flush.
            READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
          get current Line
            IF NOT l_selected_node IS INITIAL.
              CALL METHOD tree1->get_outtab_line
                EXPORTING
                  i_node_key    = l_selected_node
                IMPORTING
                  e_outtab_line = ls_sflight.
              ls_sflight-seatsmax = ls_sflight-price + 99.
              ls_sflight-price = ls_sflight-seatsmax + '99.99'.
              CALL METHOD tree1->add_node
                EXPORTING
                  i_relat_node_key = l_selected_node
                  i_relationship   = cl_tree_control_base=>relat_first_child
                  is_outtab_line   = ls_sflight
                is_node_layout
                it_item_layout
                  i_node_text      = 'First Child'.             "#EC NOTEXT
              importing
                e_new_node_key
            ELSE.
              MESSAGE i227(0h).
            ENDIF.
          WHEN 'INSERT_FS'.
          get selected node
            CALL METHOD tree1->get_selected_nodes
              CHANGING
                ct_selected_nodes = lt_selected_node.
            CALL METHOD cl_gui_cfw=>flush.
            READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
          get current Line
            IF NOT l_selected_node IS INITIAL.
              CALL METHOD tree1->get_outtab_line
                EXPORTING
                  i_node_key    = l_selected_node
                IMPORTING
                  e_outtab_line = ls_sflight.
              ls_sflight-seatsmax = ls_sflight-price + 99.
              ls_sflight-price = ls_sflight-seatsmax + '99.99'.
              CALL METHOD tree1->add_node
                EXPORTING
                  i_relat_node_key = l_selected_node
                  i_relationship   =
                                 cl_tree_control_base=>relat_first_sibling
                  is_outtab_line   = ls_sflight
                is_node_layout
                it_item_layout
                  i_node_text      = 'First Sibling'.           "#EC NOTEXT
              importing
                e_new_node_key
            ELSE.
              MESSAGE i227(0h).
            ENDIF.
          WHEN 'INSERT_LS'.
          get selected node
            CALL METHOD tree1->get_selected_nodes
              CHANGING
                ct_selected_nodes = lt_selected_node.
            CALL METHOD cl_gui_cfw=>flush.
            READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
          get current Line
            IF NOT l_selected_node IS INITIAL.
              CALL METHOD tree1->get_outtab_line
                EXPORTING
                  i_node_key    = l_selected_node
                IMPORTING
                  e_outtab_line = ls_sflight.
              ls_sflight-seatsmax = ls_sflight-price + 99.
              ls_sflight-price = ls_sflight-seatsmax + '99.99'.
              CALL METHOD tree1->add_node
                EXPORTING
                  i_relat_node_key = l_selected_node
                  i_relationship   =
                                 cl_tree_control_base=>relat_last_sibling
                  is_outtab_line   = ls_sflight
                is_node_layout
                it_item_layout
                  i_node_text      = 'Last Sibling'.            "#EC NOTEXT
              importing
                e_new_node_key
            ELSE.
              MESSAGE i227(0h).
            ENDIF.
          WHEN 'INSERT_NS'.
          get selected node
            CALL METHOD tree1->get_selected_nodes
              CHANGING
                ct_selected_nodes = lt_selected_node.
            CALL METHOD cl_gui_cfw=>flush.
            READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
          get current Line
            IF NOT l_selected_node IS INITIAL.
              CALL METHOD tree1->get_outtab_line
                EXPORTING
                  i_node_key    = l_selected_node
                IMPORTING
                  e_outtab_line = ls_sflight.
              ls_sflight-seatsmax = ls_sflight-price + 99.
              ls_sflight-price = ls_sflight-seatsmax + '99.99'.
              CALL METHOD tree1->add_node
                EXPORTING
                  i_relat_node_key = l_selected_node
                  i_relationship   =
                                 cl_tree_control_base=>relat_next_sibling
                  is_outtab_line   = ls_sflight
                is_node_layout
                it_item_layout
                  i_node_text      = 'Next Sibling'.            "#EC NOTEXT
              importing
                e_new_node_key
            ELSE.
              MESSAGE i227(0h).
            ENDIF.
        ENDCASE.
      update frontend
        CALL METHOD tree1->frontend_update.
      ENDMETHOD.                    "on_function_selected
      METHOD on_toolbar_dropdown.
    create contextmenu
        DATA: l_menu TYPE REF TO cl_ctmenu,
              l_fc_handled TYPE as4flag.
        CREATE OBJECT l_menu.
        CLEAR l_fc_handled.
        CASE fcode.
          WHEN 'INSERT_LC'.
            l_fc_handled = 'X'.
          insert as last child
            CALL METHOD l_menu->add_function
              EXPORTING
                fcode = 'INSERT_LC'
                text  = 'Insert New Line as Last Child'.        "#EC NOTEXT
          insert as first child
            CALL METHOD l_menu->add_function
              EXPORTING
                fcode = 'INSERT_FC'
                text  = 'Insert New Line as First Child'.       "#EC NOTEXT
          insert as next sibling
            CALL METHOD l_menu->add_function
              EXPORTING
                fcode = 'INSERT_NS'
                text  = 'Insert New Line as Next Sibling'.      "#EC NOTEXT
          insert as last sibling
            CALL METHOD l_menu->add_function
              EXPORTING
                fcode = 'INSERT_LS'
                text  = 'Insert New Line as Last Sibling'.      "#EC NOTEXT
          insert as first sibling
            CALL METHOD l_menu->add_function
              EXPORTING
                fcode = 'INSERT_FS'
                text  = 'Insert New Line as First Sibling'.     "#EC NOTEXT
        ENDCASE.
    show dropdownbox
        IF l_fc_handled = 'X'.
          CALL METHOD mr_toolbar->track_context_menu
            EXPORTING
              context_menu = l_menu
              posx         = posx
              posy         = posy.
        ENDIF.
      ENDMETHOD.                    "on_toolbar_dropdown
    ENDCLASS.                    "lcl_toolbar_event_receiver IMPLEMENTATION[/code]
    <b>INCLUDE ZUS_SDN_BCALV_TREE_EVENT_RCVR8.</b>
    [code]----
      INCLUDE ZUS_SDN_BCALV_TREE_EVENT_RCVR8                                  *
    class lcl_tree_event_receiver definition.
      public section.
        methods handle_node_ctmenu_request
          for event node_context_menu_request of cl_gui_alv_tree
            importing node_key
                      menu.
        methods handle_node_ctmenu_selected
          for event node_context_menu_selected of cl_gui_alv_tree
            importing node_key
                      fcode.
        methods handle_item_ctmenu_request
          for event item_context_menu_request of cl_gui_alv_tree
            importing node_key
                      fieldname
                      menu.
        methods handle_item_ctmenu_selected
          for event item_context_menu_selected of cl_gui_alv_tree
            importing node_key
                      fieldname
                      fcode.
        methods handle_item_double_click
          for event item_double_click of cl_gui_alv_tree
          importing node_key
                    fieldname.
        methods handle_button_click
          for event button_click of cl_gui_alv_tree
          importing node_key
                    fieldname.
        methods handle_link_click
          for event link_click of cl_gui_alv_tree
          importing node_key
                    fieldname.
        methods handle_header_click
          for event header_click of cl_gui_alv_tree
          importing fieldname.
    endclass.
    class lcl_tree_event_receiver implementation.
      method handle_node_ctmenu_request.
      append own functions
        call method menu->add_function
                    exporting fcode   = 'USER1'
                              text    = 'Usercmd 1'.          "#EC NOTEXT
        call method menu->add_function
                    exporting fcode   = 'USER2'
                              text    = 'Usercmd 2'.          "#EC NOTEXT
        call method menu->add_function
                    exporting fcode   = 'USER3'
                              text    = 'Usercmd 3'.          "#EC NOTEXT
      endmethod.
      method handle_node_ctmenu_selected.
        case fcode.
          when 'USER1' or 'USER2' or 'USER3'.
            message i000(0h) with 'Node-Context-Menu on Node ' node_key
                                  'fcode : ' fcode.           "#EC NOTEXT
        endcase.
      endmethod.
      method handle_item_ctmenu_request .
      append own functions
        call method menu->add_function
                    exporting fcode   = 'USER1'
                              text    = 'Usercmd 1'.
        call method menu->add_function
                    exporting fcode   = 'USER2'
                              text    = 'Usercmd 2'.
        call method menu->add_function
                    exporting fcode   = 'USER3'
                              text    = 'Usercmd 3'.
      endmethod.

  • I been try this 6 method for three days!!!

    import java.util.*;
    public class ArraySet implements Set {
         private Object[] set;
         private int size;
         public ArraySet(){
              set = new Object[10];
              size = 0;
    public void add(Object object){
       for (int i=0 ; i<size.length;i++){
         if(set.equals(object))
         System.out.println("must be unique");
    else{          
    set[size] = object;
         size++;          }
    public void remove(Object object){
    if(object .equals(size - 1))
    size--;
    return;          
    public boolean contains(Object object){
    for ( int i = 0; i < size.length; i++ )
    if ( set[ i ].equals( object ) )
    return true;
    return false;
    public boolean equals(Set set){
    for ( int i = 0; i < size.length; i++ )
    if ( set[ i ].contains( set ) )
    return true;
    return false;
    public String toString(){
    // returns a String of the set.
    public Iterator iterator(){
    I been doing this 6 method for three days....but still getting error....can anyone fix for me...it make me crazy....
    for last two can someone show me how to do it??
    Thanks very much..
    yenyen

    Okay, here's a piece of code that compiles:
    Do whatever you want into this; and don't ask questions before reading the fundamentals properly.
    import java.util.*;
    public class ArraySet implements Set {
         private Object[] set;
         private int size;
         public ArraySet(){
              set = new Object[10];
              size = 0;
         public boolean add(Object object){
              for (int i=0 ; i<size;i++){
                   if(set.equals(object))
                        System.out.println("must be unique");
                   else{
                        set[size] = object;
                   size++;
              return false;
         public boolean remove(Object object){
         if(object.equals(size - 1)) {
              size--;
              return false;
         // Do something proper here...
         return false;
         public boolean contains(Object object){
              for ( int i = 0; i < size; i++ ) {
                   if (set[i].equals(object)) {
                        return true;
              return false;
         public boolean equals(Set set){
              for (int i = 0; i < size; i++) {
                   if (set.contains(this.set[i]) ) {
                        return true;
              return false;
         public String toString(){
              // returns a String of the set.
              // Do something proper here...
              return "";
         public Iterator iterator(){
              // Do something proper here...
              return null;
         public Object[] toArray(Object[] obj) {
              // Do something proper here...
              return null;
         public Object[] toArray() {
              // Do something proper here...
              return null;
         public boolean retainAll(Collection coll) {
              // Do something proper here...
              return false;
         public boolean removeAll(Collection coll) {
              // Do something proper here...
              return false;
         public boolean containsAll(Collection coll) {
              // Do something proper here...
              return false;
         public boolean isEmpty() {
              // Do something proper here...
              return false;
         public void clear() {
              // Do something proper here...
         public int size() {
              // Do something proper here...
              return 1;
         public boolean addAll(Collection coll) {
              // Do something proper here...
              return false;
    Certainly this won't run unless you code something nicely :)
    Rich.

  • Ow can i implement some method to perform task even if the user close

    Dear All
    I have a process need long time to complete , now how can i implement some method to perform this task even if the user close the browser??
    e.g
    if i have a button to update some value on one million recode which will take about 1 hour, is there a way to complete this update even if the user close his browser?

    Jaber,
    Sure, that works just fine too (having a Java application running). In order to "notify" it to run something, you can use whatever technology you like; if I were doing it, I'd probably use something like JMS backed by Oracle AQ to queue up tasks for it to do, however, that's just personal preference. You would have to design something that meets the needs of your particular use case. Perhaps another way would be to run it as a database job, in which case you can use the database scheduler to run it. There are probably one million and four different ways of doing it - the one you choose would depend upon your requirements and the technology you are comfortable with.
    John

  • How to implement secure Licencing for Java Apps?

    Hi
    I'm already thinking some months about this topic. I serached the web, some books and magazines, i asked quite a lot of people - but in the end, there seems to be no really satisfying answer.
    My main question is: what can i do to protect the software i wrote? The problem is, where ever i start, i end with open questions.....
    I may start delivering a custom licence key with my software that contains information i.e. about who may run it and for how long. To check integrity i sign the licences key (with a digest) and ckeck the integrity in the application. Like this, i could make sure, that the software runs only with a valid licence.
    But two new problem araise - if the licence key is given to the web, everyone will be able to run the software. Second, i have to implement a methode to check the digest, so i have to deliver the key with the software and like this, the key could just be used to generate new licence files. Third, i hav to protect my code, since anyone could recompile it, he could check the algorithms i use to check the digest and even worse, he just could disable the codeblock that checks the licence.
    So i use an obfuscator to scramble my code, and to get the most out of this technique, i use a controlflow obfuscator. This adds some security, but still the code can be decompiled but wouldn't be too easy to understand. For making it even a little bit harder to read, i will "distribute" the licence digest check over some different classes.
    But still the first two problems remain. So i think about encrypting the licence file. To make that secure, i would use a public/private key encryption since if i use a secret key encryption i would have to deliver the key with the software and anyone could use it to generate new encrypted licene files. The problem with the public/private key is, that i should deliver a public key with the software that is only capable of decrypting, but not of encrypting. Like this, i can implement a decryption methode in the software that can decrypt the licence file and read all requiered licence data but the user is not able to generate a new licence file because he has the read-only key. Obvisouly there is no such private/public key technique that allows one key to be decrypt only and the other to be encrypt and decrypt (or at least encrypt only). Algorithms like PGP have a public key that allows encryption only and a private key that allows decryption only.
    I could go on presenting some more ideas i found to "protect" software/licence but the all come to the same point where they leave a lot of other open questions.
    I wonder what you all out there do to protect your software, what kind of technique you use for licencing implementation. I would be very glad to read what problem you face reagarding this topics and maybe how you solved it or what your conclusion was.
    Greetings
    josh

    >
    yes, absolutely. That's the point. Try to make it hard
    to get the software some other way. So it's easer to
    get the software by buying it.
    Nope.
    - There are those who steal it just to steal it. They don't use it.
    - There are those who steal it because the price is too extreme. If your income for the year is measured as only several thousand dollars you are not going to be able to buy a package that costs a thousand dollars or more.
    - There are those who steal it because the preceived benifit is less than the cost. For instance, at least in the past, MS software cost at least three times as much in some european companies compared to the exchange rate.
    - Finally there are those who steal simply because they don't want to pay for it.
    As far as I am concerned the last category is the only relevant one. And that is far smaller than any software theft estimates that the software industry regularly claims.
    >
    >>
    Here is an example of someone who thinks that their
    work is good enough and valuable enough to stand on
    its own...http://www.fileviewer.com/.
    And I liked it enough that at one company I hadthem
    purchase a site license. And I like it enough thatI
    still remember the company five years after thelast
    time I needed the product.that's fine and it would be very nice if everybody
    would be like you. But that's not the case and you
    even may not be sure if not someone in that company
    took a copy of the software and the licence and now is
    using it for free are even gave it in the "public
    domain". Woulnd't that be sad if the company would
    have to close down someday because just a few people
    are paying for it. Even if it is such a smart
    product?There was a clothing chain that closed down because they claimed that, even after installing anti-theft devices, they were still losing too much money from shop lifters.
    If that is the case why do all of the other companies still exist?
    If your product is good then people will buy it. The successes for that are abundant. The only success stories for copy protection schemes are for the copies that sell those schemes.
    >
    i wonder if you close your door when you leava your
    appartment. I mean, what's wrong with protecting a
    code? It's just the same as protecting the money you
    earn, the furnish in your appartment, ...
    Sorry, when I buy a product then I expect to be able to use it.
    With your analogy I would have to use a code that you provided everytime I wanted to get into and out of my apartment.
    So for any comments, ideas, ... on how to addsome
    more protection i'm very thankfull.You search for "obfuscator".yes, as i wrote in the first posting, i know about
    obfuscator, i'm using it, but it's just very poor
    protection. That's why I'm looking for a smart concept
    to gain a little bit more protection.And if you search for that term in these forums, and read the lengthy posts, you might find some ideas. Which is why I suggested it. (And you might understand why the alternatives are not used.)

  • CSS Flexbox - a new layout method for web pages

    Hi,
    As you may all know, css flexbox is a new layout method for laying out your web page, and with Firefox releasing version 22 within the next few days, (should have been yesterday) it is now no longer hidden behind browser settings. Add to this the fact that all desktop browser except IE10 and Safari 5 & 6, no longer require the use of a vendor prefix, and that http://html5please.com/ simply say ’USE’, flexbox is now finally a viable layout alternative, especially for responsive layouts.
    Flexbox has been available on all Android and iOS devices, (and any device using the webkit engine, e.g. new blackberry’s and Kindle Fire devices) since they were first release.
    To help find problems, and provide help in using flexbox, we would be grateful if you would experiment and provide feedback in the use of flexbox for layouts.
    To help you get started a video tutorial, (with files to download) and examples of layouts, (more to be added next week) and tips & tricks to help with some of the more common problems have been provided at http://flexboxlayouts.com/. This site will also be updated to provide you with a list of problems and hopefully the solutions to those problems, so that you will have a ’one stop’ reference site for using flexbox.
    If you have any tips in using flexbox, or a flexbox layout that you would like added to the site, then you can use the ’Submit’ email address on the http://flexboxlayouts.com/ site.
    For more info on the css flexbox specifications see -
    http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/
    or if you just want to know what property is supported by which browser/device -
    http://flexboxlayouts.com/pdfs/flexbox%20browser%20Properties%20.pdf
    Note to regular contributors & moderators:
    As I only have time to visit and help in the forum for a few hours per week, should you find any flexbox problems unanswered then please let me know via email.
    PZ

    Hi Al
    Yes I know, and this is why I am asking people to experiment with flexbox.
    The fix for IE10 is to give the right hand sidebar, (or the content) a larger flex-grow property, the bug is caused by the flex shorthand property not recognizing % values, and using the flex-basis as a set width instead of a preferred size.
    I have logged the bug, (and many others) with the various browser bug bases.
    This and other bugs, do have 'fixes', so I hope users will experiment with flexbox and provide feedback.
    Flexbox is no different than any other css feature, "we can only find the problems in actual use".
    Strangely enough, I have found the most consistent to use is the old 2009 implementation on mobile devices, (no doubt iOS7 will change all that ).
    PZ

  • How to implement SEARCH HELP for input field in WDA

    Hi All,
    I am doing a tool for my team. in this tool there are 4 input fields to show different processes. I implemented the 4 input fields and also bind the respective tables to these fields successfully. Actually I want to filter the data between 2 fields . Means the data in the 2nd input field should be based on the 1st input field. Means when I'll select for example 'CHI' (code for CHINA) in the 1st input field the 2nd field meant for country name should show all country name with value 'CHINA'. But the problem is that all values related to each field are in different table with no foreign key relationship and also some combinations are in single table..
    I have tried the import and export parameter method for search help but no luck till now.
    Can anyone please suggest me how to implement this scenario..
    Thanks in advance...
    sekhar

    Hi sekhar,
    Your Requirement can be implemented by OVS(Object Value selector) This is the custom search help .So that you can define on what basis the value has to be fetched.
    Look at the below link
    http://wiki.sdn.sap.com/wiki/display/WDABAP/ABAPWDObjectValueSelector(OVS)
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    You need to use the component WDR_OVS.
    It has 3 phases
    In phase 1
         You will fetch the value from input field to F4 help dialog box.
    In phase 2
         You will generate the search results , in this phase look for the input value given in field 2 and accordingly generate search result for the field 3.
    In phase 3
         The selected value will be returned to the original screen.
    Regards
    Karthiheyan M

  • Implementing Dynamic Styles for Popups based on Query

    I have a page with multiple report regions which are individually displayed depending upon values assigned to variables via a search page. On the resulting report region, I display the results of my SQL query as text, text fields, select lists, textarea, and popups. These fields are editable and will be submitted to update the data displayed and stored in the database. To maintain database referential integrity, obviously some fields will be reuired and some will have default values. I want to visually emphasize these two characteristics to the user by changing the field background color and font color depending upon whether the element is required or whether a default value is being displayed.
    I have tried to accomplish as much as possible via inline styling and can accomplish everything except the popups. If I hard-code the style values for the popup IDs, I can affect the styles. The problem is that the number of rows which need to be addressed is dependent upon the number of rows in my table. Popup IDs are indexed by the row number (e.g. f01_0001 is the ID for the popup field for row 1; f01_0002 is the ID for the popup field for row 2, etc). Changing the template would affect all popups and I only want to address specific ones. I have tried to implement a JavaScript function (FORMAT_DEFAULT_AND_REQUIRED_COLUMNS(formItem1,formItem2,formItem3)) on the page HTML Header section which is called by onload="jvascript:FORMAT_DEFAULT_AND_REQUIRED_COLUMNS('P30_DATA_TYPE','P30_VIEW_OR_EDIT','P30_SOURCE');" from the "On Load - Page HTML Body Attribute."
    Basically, I want this function to execute each time the page is loaded to dynamically assign style values to the popups (and potentially other columns as well). Depending upon the values of the three formItems, the function would know which column tags would need to be affected. From within the JavaScript function, I would call:
    document.getElementById(f01tag).style.setExpression("background-color", "blue", "JavaScript");
    This would occur within a loop from 1 to the number of rows to be displayed on the report region and the f01tag would be incremented by the loop counter.
    Any ideas, assistance, or direction would be greatly appreciated. Thank you.

    Ed
    Taken a look at it using the developer access you provided. Think you were nearly there!
    The style sheet wasn't being picked up because of the link href in the page template. Think you must have cut and pasted the existing link for the theme CSS and left in the themes/theme_10/ component? That would apply for style sheets stored there in the file system. For your ApEx CSS from the database you just need #WORKSPACE_IMAGES#pdam.css.
    To get the styles defined in the CSS appearing for all of the items - including the popups - I added class="default|required|default_required" attributes using the p_attributes parameter in the APEX_ITEM package methods referenced in your report source query. (Probably possible to do this in the Tabular Form Element section of the report definition too, but if you've got dynamic requirements as to which classes are needed where, the former approach is more likely to be useful - you can control which classes using DECODE, CASE, scalar subqueries etc.)
    Seems to be working in Windows IE 5.5/6/7 and Opera 9; Mac Firefox 2 and Safari 3 beta. Safari 2 doesn't support styling of the select lists, as I mentioned in my previous post.
    Few points on your CSS:
    1. Setting font size in pixels causes accessibility issues, both due to Win IE lacking support for user resizing of pixel sized text, and because of general variation in display resolutions. Use a different method for real world use.
    2. Always specify a generic font family as a fallback in case your preferred fonts are not available: font-family: "Times New Roman", Times, serif;
    3. text-shadow is not yet a widely supported CSS 3 property. Although it is working in Safari 3 - even (to my surprise!) in a form control - it looks kind of unreadable, and I doubt that even when widely available it will be universally supported for forms controls. Anyway, note that text-shadow properties are not specified enclosed in quotes.
    Hope this lets you progress.

  • **URGENT** No getter method for property searchText of bean org.apache.stru

    I'm implementing a query page as described in the HowTo ADF_ComplexMasterDetail.zip
    When running the query page, I'm receiving the error:
    javax.servlet.jsp.JspException: No getter method for property searchText of bean org.apache.struts.taglib.html.BEAN
    I have my searchEmployees writen and 'exposed' (at least I can see it in the Data palette). But seems like something is missing, and can't find this searchText beam property specified in the html:text tag.
    Can someone help in this one?
    Here is the Help description inside the HowTo example:
    Section 3
    queryEmployees
    queryEmployeesInDept provides an interface for entering a simple search criteria for querying a list of
    employees. This does not use the Find mode Query By Example functionality that the other query screens
    use, but rather presents a much simpler search interface. The actual search is carried out using a
    function
    searchEmployees that the underlying view object exposes. (See the EmployeesView view object in the
    model project)
    1. Drop a new Data Page onto the page flow diagram call it queryEmployees
    2. In the page flow diagram, drag the searchEmployees operation from the AllEmployeesView
    collection in the Data Control Palette and drop it on top of the new Data Page. This will cause the
    framework to run a search whenever the page is called.
    3. In the Structure pane, locate the queryEmployees node and expand it, select the child node
    paramNames[0], and change it's value attribute to ${param.searchText}. This will pass the URL
    parameter searchText on to the business method to qualify the query.
    4. Drill down into the page and expand the Data Control Palette to select the AllEmployeesView
    collection. Set the Drag and Drop as: list to Read-OnlyTable. Then drag the collection onto the page.
    This will create a tabular containing the query results.
    5. Select the Struts HTML component palette and drag a Form onto the page above the output table. Set
    the handling action to this Data Page (queryEmployees.do)
    6. Drag a text field from the component palette inside of this new form. Set the property attribute of
    the
    <html:text> tag to searchText (the same value you used in the paramNames[0] for the Data Page)
    7. Create a new submit button in the form to submit the search. Set the property attribute of the button
    to
    event_search.
    8. Finally we need to subclass the data page to prevent the search action from being fired when it is not
    appropriate for the page ( for instance when we first display it). To do this we need to Go to Code on
    the Data Page's context menu, and override the invokeCustomMethod() method:
    * We only want to invoke the custom method i.e. the call to change
    * the Where clause on the collection, if the Action has been called with
    * a search event on the page with a search term supplied.
    * If the user got here via a link or another event, we bypass the model call
    * unless a URL parameter event=search is supplied, in which
    * case the method will also be called.
    protected void invokeCustomMethod(DataActionContext actionContext)
    List events = actionContext.getEvents();
    // If the event is "search" do the custom event call
    if ((events != null) && (events.contains("search")))
    String searchTerm = (String)((DynaActionForm)actionContext.getActionForm())
    Get("searchText");
    if (searchTerm != null)
    super.invokeCustomMethod(actionContext);
    }

    Solved with Oracle JDeveloper HowTo:
    Creating Search Pages with Both Fixed and Dynamic Criteria
    Author: Steve Muench, Oracle ADF Development Team
    Date: September 16, 2004
    http://www.oracle.com/technology/products/jdev/howtos/10g/dynamiccrit/index.html

  • Finder methods for CMP beans

    We do not implement finder method in Bean class for CMP. As such, where do we implement finder methods such as findInRange() method? How does the container implement my custom "find" methods.
    Thanks

    Using CMP 2.x, your custom finder and select methods are implemented by the container based on the EJB QL query you provide in the ejb-jar.xml. In CMP 1.1, there was no portable way to express the semantics of the query, so most vendors had a vendor-specific syntax for describing the query.
    See chapter 27 of the J2EE 1.4 Tutorial for some examples of using EJB QL :
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
    --ken
    Kenneth Saks
    J2EE SDK Team
    SUN Microsystems

  • How to Implement Screen Exits for MK01...

    Hi All,
    I have to implement screen exits for Tcode MK01.
    There is a BADI namely VENDOR_ADD_DATA_CS for Mk01.
    Please guide me on how to implement a screen exit..
    If possible send me the steps to be followed.
    Regards,
    Vidya.

    Hi,
      Check this:
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    Have a look at this thread:
    your working with BADI Then do as follows....
    you follow the SPRO way and do everything they say.
    1.you make an own z program with your subscreens
    2.by VENDOR_ADD_DATA you put something like this to method CHECK_ADD_ON_ACTIVE:
    Aktivierung Zusatzfelder für ZDB
    if i_screen_group = 'Z1'.
    e_add_on_active = 'X'.
    endif.
    3.by VENDOR_ADD_DATA_CS you put something like this to get_taxi_screen
    CASE i_taxi_fcode.
    Premier
    WHEN 'Z1_SRCE1'.
    e_screen = '0100'.
    e_program = 'ZPM_SCREENEXIT_MK02'. " your own program
    e_headerscreen_layout = ' '.
    Deuxiem
    WHEN 'Z1_SRCE2'.
    e_screen = '0110'.
    e_program = 'ZPM_SCREENEXIT_MK02'.
    e_headerscreen_layout = ' '.
    ENDCASE.
    4. you make sure, that everything is active
    Regards
    Kiran
    Edited by: Kiran Sure(skk) on Apr 11, 2008 3:42 PM

  • Creating data server for JMS Queues in ODI

    hi,
    I am trying to create data server for JMS Queues in ODI.
    I am getting following error:
    java.sql.SQLException: Cannot load connection class because of underlying exception: 'javax.jms.JMSException: Cannot find the Connection Factory (jms/QueueConnectionFactory) in JNDI'.
    To implement this, I am giving following parameters:
    JNDI driver : com.evermind.server.rmi.RMIInitialContextFactory
    JNDI url : ormi://localhost/default
    JNDI resource : jms/QueueConnectionFactory
    Please help.
    Thanks,
    Monika

    Hi,
    according to docs
    http://docs.oracle.com/cd/E23943_01/integrate.1111/e12644/hypersonic_sql.htm#ODIKM590
    i see
    JDBC Driver: org.hsqldb.jdbcDriver
    JDBC URL: jdbc:hsqldb:hsql://<host>:<port>
    could you modify
    JDBC Driver : org.hsqldb.jdbc.JDBCDriver
    JDBC Url : jdbc:hsqldb:hsql://localhost
    according to docs?
    Thanks

Maybe you are looking for