cancel
Showing results for 
Search instead for 
Did you mean: 

Change in font color for label or input field

preethi_santhanam
Participant
0 Kudos

Hi,

I have a label and an input field. I need to somehow indicate when the values in the input field is changed.

For example, If I have entered 'Hi' in the input field, clicked on 'Save' button and now, if I change the value in the input field to 'Hello', I must get an indication by either changing the font color of label or input field to show that the value in input field has been changed.

I am aware that we cannot change the background color for an input field, so could you please suggest any alternate approach.

Also, if you have any idea,as to what causes a color change in the input field when the mandatroy field is left blank, could help me get a solution to this problem.

Thanks in advance.

Best Regards,

Preethi.

Accepted Solutions (0)

Answers (3)

Answers (3)

RenaldWittwer
Contributor
0 Kudos

Hi,

if you have the GridLayout you can manipulate the CellBackgroundDesign in the same way.

Best regards

Renald

RenaldWittwer
Contributor
0 Kudos

Hi,

I just checked my idea, it works so far.

In the context I have a node ui_elements and a attribute "design" (type WDUI_LABEL_DESIGN). I connected this context with the design-attribute of the label of my input field.

In "OnActionSave" I have the following code (mostly generated)


method ONACTIONSAVE .
  DATA lo_nd_ui_elements TYPE REF TO if_wd_context_node.
  DATA lo_el_ui_elements TYPE REF TO if_wd_context_element.
  DATA ls_ui_elements TYPE wd_this->element_ui_elements.
  DATA lv_design LIKE ls_ui_elements-design.
* navigate from <CONTEXT> to <UI_ELEMENTS> via lead selection
  lo_nd_ui_elements = wd_context->get_child_node( name = wd_this->wdctx_ui_elements ).

* get element via lead selection
  lo_el_ui_elements = lo_nd_ui_elements->get_element(  ).

* set single attribute
  lv_design = '02'.
  lo_el_ui_elements->set_attribute(
    EXPORTING
      name =  `DESIGN`
      value = lv_design ).

endmethod.

After clicking on the save button the label will be emphasized

Best regards

Renald

preethi_santhanam
Participant
0 Kudos

Hi Renald,

Thanks so much for your help. I too had tried this, but as per the requirement, all the labels are emphasized by default.

Best Regards,

Preethi.

RenaldWittwer
Contributor
0 Kudos

Hi,

I don't know if it works, but reading your question I had the following idea.

Put the design-attribute of the label in the context and connect it wit the label-element design attribute. Change the context after input.

Hope that helps

Best regards

Renald