on 02-26-2014 10:23 AM
Dear All Gurus,
Is there any method to capture "ON CLICK" event on Business Graphic.
Hi,
There is onAction event for Business Graphics, which will get triggered when user selects certain area in business graphics.
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In the onAction event handler method, you have to create the importing parameter EVENT_ID of type string. Then the clicked event ID will automatically available in EVENT_ID parameter.
Edit: Check the below image for reference:
You can check the standard WDA application WDR_TEST_EVENTS (business graphics) for reference
Hope this helps u,
Regards,
Kiran
You need to add Action to the Business graphic event by creating a new onAction <action_name>
Inside the <action_name> handler, you need to read the values from the context.
For example if you have following node structure
Node- Chart
Attributes - Month, Count
DATA lo_nd_chart TYPE REF TO if_wd_context_node.
DATA lo_el_chart TYPE REF TO if_wd_context_element.
DATA ls_chart TYPE wd_this->element_chart.
* navigate from <CONTEXT> to <CHART> via lead selection
lo_nd_chart = wd_context->get_child_node( name = wd_this->wdctx_chart ).
* get element via lead selection
lo_el_chart = lo_nd_chart->get_element( ).
* get all declared attributes
lo_el_chart->get_static_attributes(
IMPORTING
static_attributes = ls_chart ).
The above code will give the value of the selected column in the ls_chart (structure)
Regards,
Karan
Hi Tharu,
DATA lo_nd_chart TYPE REF TO if_wd_context_node.
DATA lo_el_chart TYPE REF TO if_wd_context_element.
DATA ls_chart TYPE wd_this->element_chart.
* navigate from <CONTEXT> to <CHART> via lead selection
lo_nd_chart = wd_context->get_child_node( name = wd_this->wdctx_chart ).
* get element via lead selection
lo_el_chart = wdevent->get_context_element( 'CONTEXT_ELEMENT' ). " This will return the data
* get all declared attributes
lo_el_chart->get_static_attributes(
IMPORTING
static_attributes = ls_chart ).
Hope this will help you
Thanks & Regards,
Sankar Gelivi
Hi,
I hope you have created the context node like below and bind the data source of business graphics to that Context node
Now, in onAction, when you read the context, you will get the selected column values
DATA lo_nd_series TYPE REF TO if_wd_context_node.
DATA lo_el_series TYPE REF TO if_wd_context_element.
DATA ls_series TYPE wd_this->element_series.
* navigate from <CONTEXT> to <SERIES> via lead selection
lo_nd_series = wd_context->get_child_node( name = wd_this->wdctx_series ).
lo_el_series = lo_nd_series->get_element( ).
lo_el_series->get_static_attributes(
IMPORTING
static_attributes = ls_series ). " ls_series will contain the selected column values
Regards,
Kiran
Hi Fernando,
I am facing the same issue as yours. When i try to click on a portion of Business Graphic's, the selection is giving only first record of the node and not the selected record. The value of 'CONTEXT_ELEMENT' is initial under the action method. Did you get an answer to overcome it ?
Thanks in advance..
Hi Kiran,
When i try to click on a portion of Business Graphic's, the code that you gave is giving only first record of the node and not the selected record. The value of 'CONTEXT_ELEMENT' is initial under the action method. Am i missing anything to get the selected record details ?
Thanks in advance..
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.