on 07-16-2015 2:53 PM
Hello!
I'm trying to use WebDynPro property styleClassName.
I've found component WDR_TEST_CUSTOM_STYLES with examples + there is a sample code in if_wd_custom_style documentation.
Everything looks quite simple (sample code I'm using below). New, empty WDP component, only with button + init code.
But! In WDR_TEST_CUSTOM_STYLES its works, in my app - not.
When I tried to copy WDR_TEST_CUSTOM_STYLES to my $TMP it stopped working too (endless loading on views with style).
I didnt find where bug happens - somewhere deep in standart AFTER my code.
Any hints why it could be?
============================
DATA l_style_manager TYPE REF TO if_wd_custom_style_manager.
DATA l_style TYPE REF TO if_wd_custom_style.
" Get the custom style manager
l_style_manager =
wd_comp_controller->wd_get_api( )->get_application( )->get_custom_style_manager( ).
" Create a new custom style with name myButtonStyle for BUTTON elements
l_style =
l_style_manager->create_custom_style( style_class_name = 'STYLE'
element_type = 'BUTTON' ).
" Set font color to red
l_style->add_style_property( name = 'FONTCOLOR'
value = 'RED' ).
" Add custom style
l_style_manager->add_custom_style( l_style ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maxim,
it is working pretty fine for me, with the following code,
I did this in doinit of component controller
data l_style_properties type if_wd_custom_style=>t_style_properties.
l_style_properties = value #( ( name = `fontSize` value = `15px` )
( name = `fontWeight` value = `bold` )
( name = `fontColor` value = `rgb(95,95,95)` ) ).
data(l_custom_style_manager) = wd_this->wd_get_api( )->get_application( )->get_custom_style_manager( ).
data(l_custom_style) = l_custom_style_manager->create_custom_style( style_class_name = `myText`
library_name = 'STANDARD'
element_type = 'TEXT_VIEW'
style_properties = l_style_properties ).
l_custom_style_manager->add_custom_style( l_custom_style ).
Regards,
Harsha
Thx, Harsha.
I think provided code will work for majority or people, but not me
I've created new WDP component, copy-paste your code in wdoinit and created textview with 'myText' style.
In debug everything goes fine - objects created, styles added, but nothing happens -
font color still black.
Maybe some note / basis settings.
The strangest thing is WDR_TEST_CUSTOM_STYLES is works while it in his package.
it will not work with InteractiveForm UI element.
Thanks & Regards,
Mukul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.