on 07-01-2010 4:24 PM
Hi All,
I need to implement a Table like that:
Mo Tu Wd Th Fr Sa
8.00 - 10.00 Green Red Green Green Green Green
8.00 - 10.00 Green Green Green Green Red Green
The words Green and Red must be icons or images (or something similar) that can be clicked on and the color toggles from Green to Red to Gray depending on the Status.
How can I do that?
Thanks, Johannes
Hi Johannes,
It is definitely possible.
as you want something to be clicked upon, Use Button with Image source = ~Icon/GreenLed or YellowLed or RedLed.
When you click, in button event handler method, write code to assign Image souce dynamically.
Hope it helps you.
Thanks,
Phani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Johannes,
Whenever you click upon a cell within the table the framework would be passing a parameter WDEVENT of type CL_WD_CUSTOM_EVENT. You can make use of this parameter for obtaining your row number. You can use the code snippet below to derive the row in which the user clicked upon:
DATA: row TYPE i,
lob_element TYPE REF TO if_wd_context_element.
lob_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
row = lob_element->get_index( ).
And how many such sort of table cells do you need to have in your application? If its just a single one then you can go for the Table's concept of SingleMarkableCell instead. You can check the standard Web Dynpro component WDR_TEST_TABLE for checking out this SingleMarkableCell concept.
Regards,
Uday
It's worth noting that the event will give you the context element (row) selected and not the attribute (column).
Instead - the parameter returned is the ID - which is the ID of the editor which launched the action - it should be reasonably easy in your code to map this to the attribute in the context element to update.
An easier alternative to getting the selected element from the WDEVENT object is to use the event parameters - in the Actions tab of your view, select your event - and then click on the little blue box (no this is not a Tiffany's ad) next to the search icons on the toolbar above the list of actions - here you can easily add any standard available parameters for the action - id and context element generally being part of these. The parameters are then implicitly available within your event code.
Cheers,
Chris
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.