cancel
Showing results for 
Search instead for 
Did you mean: 

how to identify the changed fields on view

former_member188831
Contributor
0 Kudos

Dear Colleagues,

can you please let me know how can we identify what are all the fields are changed by user and what all the fields are not changed.

example: i have 10 fld on my screen i changed only 3 fld we need to know which is changed and which is not.

i tried with wd_context->is_changed_by_client( ) , buy this we can know whether any changed is done by client or not. But i need to know at UI element wise.

Thanks,

Mahesh.Gattu

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Mahesh,

Is_Changed_by_client will return true even if you do some changes to one of the input values and then revert back to original value before calling the method.

So it will not serve any prupose.

We had a requirement like this in which we have data bound to editable table and we have to find the changed Row.

For this we created a backup node which contains the same set of data as main node when first displayed.

Main Node will be bound to all UI elements.

Whenever you want to perform some actions you can compare the values of backup node and main node and find if any difference is there.

Upon updating you should update the back up node also so as to replicate the values of Main Node.

Regards

Manas Dua

former_member188831
Contributor
0 Kudos

Hi Manas,

this is very lengthy process i found very easy way to get it done.

keep this code in wddoinit of component controller.

* enable context change log
    data: context type ref to if_wd_context.
    context = wd_context->get_context( ).
    context->enable_context_change_log( ).

then write one method in component contoller like get_changes.

keep this code in get_changes.

CHANGES Returning 0 0 WDR_CONTEXT_CHANGE_LIST

method get_changes .
    data: context type ref to if_wd_context.
    context = wd_context->get_context( ).
    changes = context->get_context_change_log( ).
endmethod.

in above code what ever the chagnes are done it will come into chagne table.

in debug mode you can find the table values.

if you want more details you can refer to the WDC: demo_context_changes as refered by Leka.

Thanks Leka.

Thanks,

Mahesh.Gattu

Former Member
0 Kudos

Using the context change log.

Refer to DEMO_CONTEXT_CHANGES.

Regards,

Lekha.