cancel
Showing results for 
Search instead for 
Did you mean: 

How to close a table popin using code.

ManuCerisier
Explorer
0 Kudos

Hi,

I have a table with a table popin. When the table popin is open, I can close it using the button on the right but I'd like to be able to close it using my own button. Is there a way to do that ?

Thanks for your answer.

Emmanuel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please try this way...

cl_wd_table->get_popin.....returns a cl_wd_table_popin.

If you were able to keep a button in the popin then try to use the method set_on_close method of cl_wd_table_popin.

Regards,

Lekha.

ManuCerisier
Explorer
0 Kudos

Thanks Lekha, but I'm not quite sure to understand how to do this.

I'm in the method trigger by my own button, how can I get the popin.

Thanks in advance.

Former Member
0 Kudos

Hi,

In the modifyview method, get the reference of the table and using this table reference try to use

the method get_popin and do the rest. try to use the global vairables to store the reference.

One more query...were you able to Keep the button on the popin....

DATA:
lr_table type ref to cl_wd_table.
lr_view_ele type ref to IF_WD_VIEW_ELEMENT.           " View UI element

  CALL METHOD VIEW->GET_ELEMENT
    EXPORTING
      ID      = 'TABLE'         "Table Id
    RECEIVING
      ELEMENT = lr_view_ele.
***Gettig the button object reference for REVIEW button
  lr_table ?= lr_view_ele.

Regards,

Lekha.

ManuCerisier
Explorer
0 Kudos

My button is in the popin.

I wanted to use the modifyview method but I have no idea how to get the proper open popin. Let's say we have 3 open popins and I want to be sure to close the second one.

What was your idea when you said I can use set_on_close method of cl_wd_table_popin ?

Former Member
0 Kudos

Hi,

Are you using the single table or 3tables....

If you have 3popins then you can get the references of the each popin and use the set_on_close by passing the Popin Id.

How are you using the popin...........I mean row/cell popin in a single table or are showing 3tables as 3popins...

Regards,

Lekha.

ManuCerisier
Explorer
0 Kudos

One table with one table popin but at row level, I can open the popin for separated rows. In each popin I have my own close button. When I click the button for one line I just want the popin of this line to be closed.

Former Member
0 Kudos

Hi,

Please check this example how to get that reference of that popin.

WDR_TEST_TABLE---check the view ROW_POPIN.

In the node to which you have bound the table, create a context attribute SELECTED_POPIN of type string and try to work on open and closing the popin based on this attribute.

Refer to the above example for the same...

Regards,

Lekha.

Answers (1)

Answers (1)

former_member40425
Contributor
0 Kudos

Hi,

Create a Attribute context_element Ref To IF_WD_CONTEXT_ELEMENT in the onaction of BUTTON which You have added in POP-IN

And Write the following code in onactionclose.

method ONACTIONCLOSE .

context_element->set_attribute( name = 'SELECTED_POPIN' value = '' ).

endmethod.

I hope it helps.

Regards,

Rohit

ManuCerisier
Explorer
0 Kudos

Yes, that's what I've done.