on 02-12-2013 5:47 AM
hi,
I have created a 3 views embeded in the main view.
In the first view i have created dynamic buttons . suppose there are 2 buttons in the first view , based on the selection i need data next to that button in second view2 .
my question is how to identify the button in view2. i have created the attributes dynamically as button_1 and button_2.
thanks,
Deepa
hi all,
Thanks for the replies.
I have created a global table in component controller with one key field for button.
i populated this table with view1 entries..
i didnot create dynamic attribute for button.i simply dynamically created the button in view1 with action click
on action click method i wrote the below code. In wa_temp i have the desired row.
l_button_name = wdevent->get_string( name = 'ID' ).
it_temp = wd_comp_controller->gt_temp.
read table it_temp into wa_temp with key key1 = l_button_name.
regards,
Deepa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepa,
From the requirement you stated above here is one design I can suggest:
Create a context node TABLE and add an attribute ATTR1 of type string.
Use a Row Repeater UI element to arrange your data. Bind the dataSource property with the context node Table.
Add a Text and Button UI element to your Row Reapeater.
Assign an action to your button.
Bind the text property of the Button and TextView UI element to the ATTR1.
Now in the event handler of the action defined earlier add the following code:
DATA lr_obj TYPE REF TO object.
DATA lr_ctxt TYPE REF TO if_wd_context_element.
DATA lv_value TYPE string.
CALL METHOD wdevent->get_object
EXPORTING
name = 'CONTEXT_ELEMENT'
RECEIVING
value = lr_obj.
lr_ctxt ?= lr_obj.
CALL METHOD lr_ctxt->get_attribute
EXPORTING
name = 'ATTR1'
IMPORTING
value = lv_value.
lv_value will have the data of the button pressed. Using the value you can use case statements and navigate accordingly.
Hope it helps.
Regards,
Sayan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
See you need to take a data in Component controller(CONTEXT) which is a global one. So that the data or the selection values will be available in all the views.
Thanks
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I guess here you no need to identify any action or button. Onlick of that particular button(onaction method) you can pass that corresponding data to the global attributes or plugs and you can use.
or if you want to know which button was triggered you can create one global attribute and store the button name on click of the button (on action method) and you can use that in your coding.
Thanks
Revati
Hi Deepa,
Please check this thread http://scn.sap.com/thread/633878.
Also after cliking button fire an event with parameter passed with it so that you can guess which button is clicked. Or else if you have created attributes for these buttons then try to access the attributes with index.
Regards,
Sudhir Kothavale.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
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.