cancel
Showing results for 
Search instead for 
Did you mean: 

select all and deselect all in table control

Former Member
0 Kudos

Hi experts,

I want to make the select all and deselect all options in my table control.

But i can't able to do that one. Kindly suggest me how to do that one.

one more thing, if i select some rows in the table control, and press save it should be saved in some other table. how can i implement that one.

Waiting for ur reply.

Regards...

Arun.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Arun,

In the context node that you bind to the table, set the cardinality as 0..n and selection as 0..n. In the UI element Table, set the property selectionMode as 'multi'. Then a toggle button for select/deselect all will appear automatically in your table. You can see it in the top left corner.

For your second question, after selecting the elemets and pressing 'save', in your event handler, do a get_selected_elements( ) on your node. This will return you a set of context elements. Loop through each element and do a get_static_attributes to get the rows. Then you can append these rows to another internal table and bind it to the context. Bind your second table to this node. If the two tables are in different views, the context nodes need to be present in the component controller and mapped to the views.

Hope this helps.

Regards

Nithya

Former Member
0 Kudos

Hi nithya,

Initially for the context node i am having cardinality as 1.n, when i changed that one to 0.n as u said. then the total table got disabled.

since i am new to this abap wd, i can't able to understand what is wrong.

also kindly explain me abt the cardinality.

Regards..

Arun.

Former Member
0 Kudos

Hi Arun,

1..n should work fine too. Cardinality is the number of elements that your UI elements will hold. When you give it as 0..n, you say that there can be none or multiple elements. If it is 1..n, then there will be atleast one element and can be multiple also. This will work fine by specifying both caridnality and selection as 0..n or 1..n

Regards

Nithya

Former Member
0 Kudos

nithya,

I have done what u have said, but i can't able to see the select all and deselect all buttons.can u suggest me some other way.

On cardinality, when i give 1.n it is working, when i give 0.n it is showing some error like 'Null object reference not working'.

Regards...

Arun.

Former Member
0 Kudos

You are trying to access some reference which is initial. Thats why the null object exception. Can you paste your code here? You only need to fetch the data that you need and do a bind_table.