cancel
Showing results for 
Search instead for 
Did you mean: 

Message Area Visible Area increasing

Former Member
0 Kudos

Hi All,

I'm developing a web dynpro component and in this component i'm using "Message Area" UI element. I want to display multiple

messages in this message area. Problem I'm facing is when I'm displaying like 10 or more message the size of message area

is increasing and I dont want this to happen. I want message area to display 3 or 4 messages and then have a scroll bar.

I'm getting scroll bar but message area is increasing with the number of messages (displaying all 10 or 20 messages at a time).

I tried to setting "Max Visible Lines" property of message to '3' & '1' & '2' nothing worked, also tried changing layout to of the view to matrix, as i will get Height property but no luck.

Now system is displaying message as below.

but i want to display as following.

Above screen shot is from standard web dynpro application "WDR_TEST_MSG_AREA". I maintained properties of message area in my application similar to the message area of standard application, but didn't got results.

Thanks in Advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

You could create an Transparent container and set the height( in px) and scrolling mode to auto. Then place your message area inside it.

hope this helps,

Regards,

Kiran

Former Member
0 Kudos

Hi Kiran,

Thanks for your reply. I created Transparent container and set height and scroll mode. Now I'm able to set the height of the message area, but new problem came up. Now I'm having double vertical scroll bars, 1 for Transparent container and other for Message area. I tried a lot but couldn't get rid of scroll bar of message area. I couldn't find a way to disable scroll bar of message area.

Thanks in advance.

ramakrishnappa
Active Contributor
0 Kudos

Hi MRA,

To remove scroll bar of message area, you need to set the Max visible messages to always more than the no. of visible messages.

proceed as below

  • Create an attribute MAX_MSG_VISIBLE of type I, just under CONTEXT
  • Bind the attribute to property "MaxVisibleMessages"
  • Now, write the below code in wddomodifyview( ) method

             

 


     METHOD WDDOMODIFYVIEW.


   data lo_api_controller     type ref to if_wd_controller.

   data lo_message_manager    type ref to if_wd_message_manager.

   data lt_messages           type if_wd_message_manager=>TY_T_MESSAGES.

   data lv_msgs_count         TYPE i.


   lo_api_controller ?= wd_This->Wd_Get_Api( ).

   CALL METHOD lo_api_controller->GET_MESSAGE_MANAGER

     RECEIVING

       MESSAGE_MANAGER = lo_message_manager

       .

   lt_messages = lo_message_manager->GET_MESSAGES( ).

 

   describe TABLE LT_MESSAGES.


" Visible area is more than the no. of msgs, so no scroll bar

   lv_msgs_count = sy-tfill + 1.

 

   wd_context->set_attribute( EXPORTING

                              name = 'MAX_MSG_VISIBLE'

                              VALUE = lv_msgs_count ).

ENDMETHOD.



Hope this resolves your issue.


Regards,

Rama



former_member184578
Active Contributor
0 Kudos

Hi,

Did you still set the maxVisibleMessages property! if so remove it.

Regards,

Kiran

Former Member
0 Kudos

Hi

I don't have any option to bind "MaxVisibileMessage", I have highlighted in the attached screen shot.

I removed value for "MaxVisibleMessage", still i'm having dbl scroll bars.

ramakrishnappa
Active Contributor
0 Kudos

Hi MRA,

Please write the below logic to set the maxVisibleMessages dynamically.

  METHOD WDDOMODIFYVIEW.


   data lo_api_controller     type ref to if_wd_controller.

   data lo_message_manager    type ref to if_wd_message_manager.

   data lt_messages           type if_wd_message_manager=>TY_T_MESSAGES.

   data lv_msgs_count         TYPE i.


   lo_api_controller ?= wd_This->Wd_Get_Api( ).

   CALL METHOD lo_api_controller->GET_MESSAGE_MANAGER

     RECEIVING

       MESSAGE_MANAGER = lo_message_manager

       .

   lt_messages = lo_message_manager->GET_MESSAGES( ).

   describe TABLE LT_MESSAGES.


" Visible area is more than the no. of msgs, so no scroll bar

   lv_msgs_count = sy-tfill + 1.

  data lo_message_area type ref to cl_wd_message_area.

          lo_message_area = view->get_element( 'MSG_AREA').

              

          if lo_message_area is bound.

                    lo_message_area->SET_MAX_VISIBLE_MESSAGES( value = lv_msgs_count ).

          endif.

ENDMETHOD.


Note: here MSG_AREA is name of message area ui element.


Hope this helps you.


Regards,

Rama

Former Member
0 Kudos

Hi Rama,

data: lo_message_area type ref to cl_wd_message_area.

lo_message_area = view->get_element( 'MSG_AREA').


Error at above highlighted line, the output of view->get_element is not convertible to lo_message_area.




Thanks!!


former_member184578
Active Contributor
0 Kudos

Hi,

Use casting.

lo_message_area ?= view->get_element( 'MSG_AREA').


Regards,

Kiran

Former Member
0 Kudos

Thanks for you reply, but this didn't help.

I'm still having multiple scroll bars.

ramakrishnappa
Active Contributor
0 Kudos

Hi MRA,

Please replace the line with

lo_message_area ?= view->get_element( 'MSG_AREA').

Regards,

Rama

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi MRA,

Please share the snapshot of properties set for message area?

Regards,

Rama