on 11-03-2008 11:01 AM
Hi,
I want to change some particular row based on some condition by making it bold and adding color to them..
how can this be done?
Thanks
Akash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Akashdeep,
If you are working for table,so defaultly all the columns are text views,so text views has the property design and semantic color to change the style and color of the text view.To do this
Create 2 attributes one is for design of type WDUI_TEXT_VIEW_DESIGN and color of type WDUI_TEXTVIEW_SEM_COL in addition to your context node attributes.
Then write the below logic in the method WDDOMODIFYVIEW.
method WDDOMODIFYVIEW .
here i populated design and color attributes conditionally.
DATA:lo_nd_hcm TYPE REF TO if_wd_context_node,
lo_el_hcm TYPE REF TO if_wd_context_element,
ls_hcm TYPE wd_this->element_hcm,
it_hcm type table of wd_this->element_hcm,
it_final type table of wd_this->element_hcm,
ls_final type wd_this->element_hcm,
l_var type abap_bool,
lr_table type ref to cl_wd_table,
lr_column1 type ref to cl_wd_table_column,
lr_column2 type ref to cl_wd_table_column.
* navigate from <CONTEXT> to <HCM> via lead selection
lo_nd_hcm = wd_context->get_child_node( 'HCM' ).
select * up to 20 rows from pa0001 into corresponding fields of table it_hcm .
loop at it_hcm into ls_hcm.
move-corresponding ls_hcm to ls_final.
if l_var = abap_true.
ls_final-design = CL_WD_TEXT_VIEW=>E_DESIGN-HEADER1.
ls_final-color = CL_WD_TEXT_VIEW=>E_SEMANTIC_COLOR-POSITIVE.
l_var = abap_false.
else.
ls_final-design = ''.
ls_final-color = ''.
l_var = abap_true.
endif.
append ls_final to it_final.
endloop.
LO_ND_hcm->BIND_TABLE(
NEW_ITEMS = it_final
SET_INITIAL_ELEMENTS = ABAP_TRUE ).
lr_table ?= VIEW->GET_ELEMENT( 'TABLE1' ).
CALL METHOD LR_TABLE->REMOVE_COLUMN
EXPORTING
ID = 'TABLE1_DESIGN'
* INDEX =
RECEIVING
THE_COLUMN = lr_column1.
CALL METHOD LR_TABLE->REMOVE_COLUMN
EXPORTING
ID = 'TABLE1_color'
* INDEX =
RECEIVING
THE_COLUMN = lr_column2.
endmethod.
Now bind the 2 two attributes to the all the columns text views.
For ALV check my Article
Conditionally Assigning Colors and Input Enable to ALV Columns in Web Dynpro ABAP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Akashdeep,
Please check the following link
Regards,
Lakshman.
Edited by: Lakshman N on Nov 3, 2008 12:29 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
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.