cancel
Showing results for 
Search instead for 
Did you mean: 

Get value of changed field of create_decision_popup window in lineedit mode

Former Member
0 Kudos

Hi there,

i'm calling a create_decision_popup popup in lineedit mode.

So i could edit the values of the selected line.

How could i acces the value of the changed fields after closing the popup window in the event_sel event.

Here my code:

v_popup = comp_controller->window_manager->create_decision_popup( iv_title = 'Window title'

iv_selection_mode = 'LINEEDIT'

iv_display_table = gt_table

iv_visible_columns = lt_visible_columns

iv_visible_row_count = lv_row_count ).

v_popup->set_on_close_event( iv_event_name = 'event_sel' iv_view = me ).

v_popup->open( ).

DATA: lr_outputnode TYPE REF TO cl_bsp_wd_context_node.

lr_outputnode ?= v_popup->get_context_node( 'OUTPUTNODE' )

Thanks,

Regards TomSd

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

close event.

    METHOD eh_onpopup_closed.

     DATAlr_outputnode TYPE REF TO cl_bspwdcmp_bspwdcomponen_cn01,
            lv_event_name TYPE string,
            lt_index      TYPE int4_table,
            lv_index      TYPE int4.

     TRY.

         lr_outputnode ?= popup_file_upload->get_context_node( 'OUTPUTNODE' ).
         lv_index      = lr_outputnode->get_selectedrowindex( ).
         lt_index      = lr_outputnode->get_selectedrowindex_t( ).
         lv_event_name = lr_outputnode->get_event_name( ).

       CATCH cx_sy_ref_is_initial cx_sy_move_cast_error.

     ENDTRY.

   ENDMETHOD.

Former Member
0 Kudos

You want to edit the selected value from popup, so first populate the selected row in table and then edit in the table.

Open the popup using :

CALL METHOD me->comp_controller->window_manager->create_decision_popup

       EXPORTING

         iv_title             = 'Route'

         iv_description       = 'Route' 

         iv_selection_mode    = 'SINGLE'

         iv_visible_row_count = '10'

         iv_display_table     = gt_route

         iv_visible_columns   = lt_table

       RECEIVING

         rv_result            = gr_popup.


gr_popup->set_on_close_event( iv_event_name = 'DEC_POPUP_CLOSED' iv_view = me ).

gr_popup->open( ).

Now on close event i.e. DEC_POPUP_CLOSED write the code to transfer the selected row into the table.

lv_outputnode ?= gr_popup->get_context_node( 'OUTPUTNODE' ).

lv_index = lv_outputnode->get_selectedrowindex( ).

     IF lv_index IS NOT INITIAL.

       READ TABLE gt_route INTO ls_route INDEX lv_index.

       lr_col ?= me->typed_context->zroute->collection_wrapper.

       CREATE DATA lr_tab_data.

       CREATE OBJECT lr_valuenode

         EXPORTING

           iv_data_ref = lr_tab_data.

       lr_valuenode->set_properties( is_attributes = ls_route ).

       lr_col->add( EXPORTING iv_entity    = lr_valuenode ).

       REFRESH: gt_route.

       CLEAR: gr_popup.

endif.

Now you can see the selected row in your table view and the popup will be closed.

To make the row editable go to htm page on which table view is created, and then modify

editMode              = "ALL"

in  <chtmlb:configCellerator>

Former Member
0 Kudos

Hi Thomas,

You need to have, a close event handler for the popup.

You can access the popup values from the context node.

DATA: lr_target_node      TYPE REF TO cl_bsp_wd_context_node,
        lr_node             TYPE REF TO cl_bsp_wd_context_node,
        lr_entity           TYPE REF TO if_bol_bo_property_access,
        lv_customerid       TYPE string,
        lv_fired_outbound   TYPE seocmpname.

  FIELD-SYMBOLS: <pointer> TYPE ANY.

  ASSIGN me->context->('CONTEXT NODE NAME') TO <pointer>.           "#EC NOTEXT
  lr_target_node ?= <pointer>.

  IF sy-subrc NE 0.
    RAISE EXCEPTION TYPE cx_bsp_wd_incorrect_implement.
  ENDIF.

  CHECK lr_target_node IS BOUND.

  IF   account_popup IS BOUND.
* get the result (list) from the search

    lv_fired_outbound =   account_popup->get_fired_outbound_plug( ).
    CHECK lv_fired_outbound IS NOT INITIAL.

*   only if this outboundplug is fired, the selected value should be put
*   to the attribute (in case of cancel -> nothing selected -> no returnresult

    lr_node =   account_popup->get_context_node( 'PARTNER' )."#EC NOTEXT
    CHECK lr_node IS BOUND.

    lr_entity = lr_node->collection_wrapper->get_current( ).
    CHECK lr_entity IS BOUND.

    lv_customerid = lr_entity->get_property_as_string( 'XXXXX' )."#EC NOTEXT
  ENDIF.

Regards,

Masood Imrani S.

Former Member
0 Kudos

Hello Masood,

i open the window with the following code:

v_popup = comp_controller->window_manager->create_decision_popup( iv_title = 'Window title'

iv_selection_mode = 'LINEEDIT'

iv_display_table = gt_table

iv_visible_columns = lt_visible_columns

iv_visible_row_count = lv_row_count ).

v_popup->set_on_close_event( iv_event_name = 'event_sel' iv_view = me ).

v_popup->open( ).

So i have a close event.

The lines that are displayed in the popup window are in table gt_table.

So at the moment i have no context node and no outbound plug.

Is it nessacery to create a context node or is the outbound plug enough?

Thanks,

Regards TomSd

Former Member
0 Kudos

Hi Thomas,

Try using code in method EH_ONINSERT of class CL_BT311H_C_RESTREEVIEWSE.

They are using MULTISELECT'selection mode here.

The close event handler is EH_ONDEC_POPUP_CLOSED. You can take a look at it.

Regards,

Masood Imrani S.

Former Member
0 Kudos

Hi Masood,

they don't change anything in the popupwindow because the fields are not editable.

And in the close event they only read the index of the selected lines but not the values.

So i need an example where something is changed and afterwards read in the close event.

Thanks,

TomSd

Edited by: Thomas Strehle on Feb 4, 2010 8:37 AM

Khayelihle
Explorer
0 Kudos

Hi Thomas,

Did you get this right? I want to do exactly the same thing but I'm not getting it right.

Regards,

Khaya