on 02-09-2012 12:19 PM
Hello,
I have standard table UI element defined on one of the views as part of it's layout, two columns only - KEY and VALUE. Both defined as text cell editor by default. Content of the table is dynamic and different combination of keys and values are presented depending on the app context.
Recently the need arised to (depending on the key value) change the cell editor type for single rows only, dynamically from text to link to action - and to register a triggable event for that with some logic behind (to open new window when link is clicked).
Is it possible at all to have a column in Table UI element with different editor types set dynamically on runtime for different rows? Some cells then wolud still be presented as text, some would have a link to action in them.
If possible can I ask for any hints on how to achieve that?
I imagine that first I have to get somehow a reference to the UI element created when the view is triggered first time, then after I recieve values from backend but prior (or after?) binding it to the table context I would like to evaulate the keys and change cell editors accordingly. Then for changed editors (link to action) I would like to register triggable events (on action) which would call some custom methods for further processing. Please advice.
Best regards,
Marcin
Hi,
You can use the cell variants to display different cell editors in different rows.
First in your table column where you want to display different cell editors insert two cell variants
and fill the VARIANT KEY for each cell variant and insert textview under one cell variant and input field
under another cell variant, and bind the text to be displayed to these cell editors, now take an extra
attribute of type string in your node and bind it to the table column property SELECTED CELL VARIANT.
Now depending on your requirement change this attribute to any of the VARIANT KEY defined for cell variants.
loop at itab into wa.
if 'YOUR CONDITION'.
wa-cellvar = 'VAR1'. "cellvar is the attribute which is bound to SELECTED CELL VARIANT
else. " of table column
wa-cellvar = 'VAR2'. " VAR1 and VAr2 are the variant keys of cellvariants
endif.
modify itab from wa.
endloop.
Hope this solves your problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you guys!
Looks like Cell Variants are the way to go. Points rewarded!
Cheers,
Marcin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marcin,
I think you can try using cellvariants and change the celleditor dynamically , I have done it for whole column
But i think it is even possible to do it for each row. just try it out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check cell variants in table : [Cell variants in table UI in WDA|http://wiki.sdn.sap.com/wiki/display/WDABAP/WebDynproforABAPCellVariants]. This might help. As ypou said the table already created. ,check the dynamic programming in Web dynpro ABAP and am not sure about this.
Hope this helps u.,
Thanks & Regards,
Kiran.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.