cancel
Showing results for 
Search instead for 
Did you mean: 

Lose Context SelectedItems on calling Create_popup_to_confirm

jaime_romo
Explorer
0 Kudos

Hi,

I hope someone can give me an advice,

I have a multiselectable table and an delete selected rows option,

I want to confirm the delete action, I have subscribed an event ok_delete that is triggered after the user select ok in the popup window,

The problem is that when the popup is displayed, the selected items i have get unselected.

I could save selected items in a different context node before calling the popup window and read it from onactionok_delete, but i think this is not the better way.

Can anyone tell me why the selected items get unselected after calling the popup to confirm window.

Waiting for comments,

Greetings.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

You can keep the table/structures by declare them as global attributes. For this refre to the below steps:

1) Go to Comp controller and create a Global Node (Which you want to access globally), add attributes in this Node.

2) click on Attribute tab.

3) Declare the Table/structure here and give the attribute type as ELEMENT_<Context Node Name> for structure and ELEMENTS_<Context Node Name> for Table.

4) Make sure to check the Public check box.

Now you can access this attribute anywhere in ur Component as below.

I) in Comp Controll - WD_THIS-><Attribute Name>

II) In View - WD_COMP_CONTROLLER-><Attribute Name>

Hope it helps you.

jaime_romo
Explorer
0 Kudos

Hi SANKET SETHI,

I followed the steps,

Creating a COMPONENTCONTROLLER context node called SEL_PROD with attributes and cardinality 1..n

Creating an Attribute called SEL_HDOCS checking Public and with associated type ELEMENTS_SEL_PROD

I binded The table where the user select the rows to this context SEL_PROD and the same problem appears,

I will try to use a context view node to be binded into the table where the user selects the rows

and a public context node to fill with only the selected rows before calling the popuptoconfirm and access to this node before confirmation

If i missed something please let me know,

Thanks

Former Member
0 Kudos

Jaime - when the user selects the rows of SEL_PROD are you setting the attribute SEL_HDOCS with the value of the row?

for example: wd_comp_controller->sel_hdocs = row of SEL_PROD.

then your row will be in the wd_comp_controller->sel_hdocs

hope this help!

Jason PV

jaime_romo
Explorer
0 Kudos

JperezVelez ,

Yes, because the table where the user selects is mapped to the public context node being public with the attribute elements_sel_prod ant it have the items selected before calling the popup and lose when i call the popop.

I solved using an auziliary node that i filled after calling the popup with selected rows.

Thank you,

But if there is another way i will be gratefull to know.

jaime_romo
Explorer
0 Kudos

Solved Own

Using Global Auxiliary Node to save selected rows only

Former Member
0 Kudos

Jaime - did you declare your context node in the component controller?

If you declared the node in the component controller, then just DRAG and DROP the node to your MAIN view and also DRAG and DROP the same node to your POPUP view.

Once you select your record you just need to set_attribute in your main view and then at the popup view your attribute will have the value of the MAIN view, that way you don't lose your value.

The subscribe event (the ACTION) of the OK_POPUP has to be code it in the MAIN VIEW your popup will work just as confirmation, when the user click OK the code will go to your MAIN VIEW OK_POPUP ACTION.

hope this help!

Please provide points if is helpful!

thanks!

Jason PV

jaime_romo
Explorer
0 Kudos

JperezVelez ,

Thanks for your thread but im not using a popop within a view, it is only a standard popoptoconfirm that is SAP predesigned and returns only the option that the user selected.

Thank you,