cancel
Showing results for 
Search instead for 
Did you mean: 

Update checkbox status to the DB table

Former Member
0 Kudos

Hello to all,

I intend to show a name-value pair in a table in web dynpro.

The value is basically a checkbox.

Steps i have taken are :-

1. Created a node in the view's context and attched it to the DB table's columns.

2. Displayed the DB table in a view (using Bind_Table).

3. When the user clicks on the checkbox, that corresponding value (true/false) should be saved in the database.

For the above to happen i think one has to use the OnToggle event in the checkbox. But how do we find out the status of checkbox in consideration, moreover the concern is to commit it to the DB.

Any idea on this.

(PS : <b>Have already checked WDR_TEST_EVENTS and</b> WDR_TEST_UI_ELEMENTS that was not much of use.)

Regards,

abhishek

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Abhishek.

If you really want to save the entry each time a user clicks in the checkbox

you can get the corresponding element which contains the row of the table thru

the wdevent parameter of your actionhandler method.

lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).

lr_element->get_attribute(

name = 'CHECKBOX_ATTRIBUTE'

value = lv_boolean ).

But you also could add a button to update the db at once aftr user finished

selection. Her you would not need to handle it via checkboxes cause selection

can be handled by the tabble itself.

Hope this helps.

Sascha

Former Member
0 Kudos

thanks Sascha

Answers (1)

Answers (1)

former_member194099
Active Participant
0 Kudos

Hi,

If the data type of the table field with which you have bound the checkbox attribute is boolean then data transport should happen automatically.

When you check it in UI it sets the context attribute to 'X.

Regards

Sagar