Recording User Input with the Context Change Log
The context change log displays a list of changes the user has made to the DataGrid on the client side.
Before you can record user input, first activate the context change log with method ENABLE_CONTEXT_CHANGE_LOG of interface IF_WD_CONTEXT:
method WDDOINIT . wd_context->get_context( )->enable_context_change_log( ). endmethod.
For example, in the event handler you can query details of a context node of type IF_WD_CONTEXT_NODE_2D in order to get a detailed change log. The source code below displays an example of the onEnter event of a CInputFields:
method ONACTIONON_ENTER .
data lo_element type ref to if_wd_context_element.
data lo_node_2d type ref to if_wd_context_node_2d.
data lt_changes type if_wd_context_node_2d=>ty_t_change_log_2d.
lo_element = wdevent->get_context_element( `CONTEXT_ELEMENT` ).
lo_node_2d ?= lo_element->get_node( ).
if lo_node_2d is bound.
lt_changes = lo_node_2d->get_context_change_log_2d( ).
endif.
endmethod.
Alternatively, you can use method GET_CONTEXT_CHANGE_LOG:
wd_context->get_context( )->get_context_change_log( ).
In this case, the two-dimensional key in the attribute name must be encoded to avoid inconsistencies between traditional and two-dimensional context nodes.
| Attribute Name | Key of X-Dimension | Key of Y-Dimension | Encoded Name of Attribute |
|---|---|---|---|
| VALUE | 1 | 1 | VALUE[1,1] |
| VALUE | 1 | 10 | VALUE[1.10] |