cancel
Showing results for 
Search instead for 
Did you mean: 

Higlighting the input field

Former Member
0 Kudos

Hi Experts ,

i want to higlight the input field based on some condition , i tried using reporting attribute message ,

but how to hide the MSG area ? higliting the input field is enough for me .

have a look at the below image .

[http://i56.tinypic.com/119qnwn.jpg |http://i56.tinypic.com/119qnwn.jpg ]

Regards

Chinnaiya P

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi ,

Have u tried 'REQUEST_FOCUS()' method of the context attribute??

I am not sure if this is making sense,..but still a suggestion.:)

[Look At This|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2e/a9ed633634494da688855433e105da/frameset.htm]

Thanks,

Aditya.

gill367
Active Contributor
0 Kudos

have you tried modifying the visiblity property of the message area to none dynamically at runtime.

thanks

sarbjeet

Former Member
0 Kudos

i tried to set the visiblity in modify view , but still its displaying the msg area .

data:
    lr_msg_area type ref to cl_wd_message_area.

* get a pointer to the msg area
  lr_msg_area ?= view->get_element( 'MSGAREA' ).
  lr_msg_area->SET_VISIBLE( 01 ).

any other way to higlight the input field based on the condition ?

Regards

Chinnaiya P

gill367
Active Contributor
0 Kudos

then the only remainng option is request focus.

or there is one more thing which is also possible.

you can use the grid layout and then control the property cell backgroud design for the input field dynamically.

means you can bind the proerpty cell background design to soem attribute and then change it dynamically when you want to highlight.

thanks

sarbjeet singh

Former Member
0 Kudos

request focus & grid layout options (cell bag ground ) are also not satisfing the requirement ,

client need the inputfield should higlited by red colour .

regards

chinnaiya P

gill367
Active Contributor
0 Kudos

Well hiding message area is not really looking possible.

try something from the portal theme if application is running in portal.

like making backgrnd colour of the input with design fill1 as red or something of that sort if possible.

thanks

sarbjeet

Former Member
0 Kudos

Problem solved by my self .

let me share the piece of code to hide the msg area .

if lv_field1 ne lv_field2.
* get message manager
DATA lo_api_controller     TYPE REF TO if_wd_controller.
DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
lo_api_controller ?= wd_this->wd_get_api( ).
CALL METHOD lo_api_controller->get_message_manager
  RECEIVING
    message_manager = lo_message_manager   .

* report message
CALL METHOD lo_message_manager->report_attribute_error_message
  EXPORTING
    message_text              = 'hiiia '
    element                   =  lo_el_context
    attribute_name            = 'FIELD2'
  receiving
    message_id                = msgid .

* below code will reset the message .
data: l_api_testcase1              type ref to if_wd_view_controller,
      l_api_wdr_test_msg_area      type ref to if_wd_window_controller,
      l_wd_message_area            type ref to if_wd_message_area.

  l_api_testcase1 ?= wd_this->wd_get_api( ).
  l_api_wdr_test_msg_area ?= l_api_testcase1->get_embedding_window_ctlr( ).
  l_wd_message_area = l_api_wdr_test_msg_area->get_message_area( ).
  l_wd_message_area->reset_messages( i_keep_current = 'X' ).
   endif .

have a look to the solution arrived .

[http://i54.tinypic.com/11gna4w.jpg|http://i54.tinypic.com/11gna4w.jpg]

thanks for all those give your valuable suggesion

Regards

chinnaiya P

Edited by: chinnaiya pandiyan on Jan 28, 2011 5:08 PM

gill367
Active Contributor
0 Kudos

Great work.

i think you should make that message_text also equal to '' (null string) other wise it will come up when the user will click on the

input field.

thanks