cancel
Showing results for 
Search instead for 
Did you mean: 

problem with page in message area..pls help

Former Member
0 Kudos

Hi friends,

I am using WDDOAFTERACTION METHOD and populating the errors emssages in this method.

So now even if i do any actoins, the messages remains in the message area.

But each time when i do an action.. hte page is completely taking me to the top.

and i have to scroll down to come to the point where i was more keen into.

can we stop the page/window/browser at one point till i navigate it to up/down manually??

is this possible in WDA?

also in gave my view name in l_message_manager->report_t100_message. But when i click OVS help and hit COPY button, the errors in my view are GONE.. how to keep these errors still there even if i use OVS search help..

kindly help,

thanks,

Niraja

Edited by: Niraja on Dec 11, 2008 5:28 PM

Accepted Solutions (1)

Accepted Solutions (1)

uday_gubbala2
Active Contributor
0 Kudos

Hi Niraja,

Try explicitly setting the focus in the WDDOAFTERACTION method. After you populate the error messages within this method try to explicitly set the focus on the section of the screen which you want to remain in focus. It should work that way.

There are two ways to set the focus:

Using an UI element (which can be called only from WDDOMODIFYVIEWVIEW

Within the WDDOMODIFYVIEW you can pass on the ID of the inputfield that you want to focus & then specifically set the focus on it using the below coding:

data: lr_element type ref to if_wd_view_element.
" Get the reference of the desired element within the WDDOMODIFYVIEW & save it into an view level attribute    
    CALL METHOD VIEW->GET_ELEMENT
      EXPORTING
        ID      = 'INPUT2'      * id of the element in layout
      RECEIVING
        ELEMENT = lr_element.

" Now within the WDDOAFTERACTION method try to set the focus using this saved reference    
    CALL METHOD VIEW->REQUEST_FOCUS_ON_VIEW_ELEM
      EXPORTING
        VIEW_ELEMENT    = lr_element.

You can also do it in this way as the last resort. All ui elements have a method FOCUS_BY_CONTEXT_ELEMENT to set the focus on the respective element by passing the context attribute.

I will give it a try for the OVS thing and check it out...

Regards,

Uday

Former Member
0 Kudos

Hi Uday,

I dont know i understood ur answer or not, let me explain it again.

See for example when my WDA loads(it may populate with errors). Normally when lot of errors are there, the screen size grows, and a scroll bar will be there in the right hand side..

now i ahve for ex a table in the bottom.

Here i scorlldowned and i have a button to add a new row to this table.

when i click add button, its addign a new row, but the scroll is automatically coming to the top(where i can see the first starting point of my window).

Now what i want is, when i scroll down, and hit ADD button , it shud not move.. the window.... thats what i want....

i didnt understood the INPUT2 which u gave, how can i hardocode it.. because it can be any UI element.. and i have lot of actions in my WDA.

how to do this, pls respond... Also my error messages are disappearing... when i hit OVS search help, and hit copy button.. pls tell me how to do..

thanks in advance,

Niraja

uday_gubbala2
Active Contributor
0 Kudos

Hi Niraja,

The interface if_wd_view_element has a method REQUEST_FOCUS_ON_VIEW_ELEM using which you can explicitly set the focus on a particular element of your component. So first just get the reference of your desired element from within the WDDOMODIFYVIEW and save the reference into an attribute defined in the Attributes tab. Now suppose you use the REQUEST_FOCUS_ON_VIEW_ELEM within the WDDOAFTERACTION method then the system would be explicitly setting the specified element in focus. So you can try decide up on 1 particular ui element in your view which you would like to set focus to so that your desired section of the application remains in view without the user having to scroll further down.

Regards,

Uday

Former Member
0 Kudos

So Uday u mean,

in what ever action i click,.. in that action event, i will set the UI element in a global attribute..

and in wddoviewmodify method, i have to just use set focus method to set to this UI element..

this is what u mean right..?

Niraja

uday_gubbala2
Active Contributor
0 Kudos

Hi Niraja,

No you cannot get the reference of the ui element in any other method other than the WDDOMODIFYVIEW as only this method has the parameter VIEW being passed to it. It the only way by which you can work with your layout. So within your WDDOMODIFYVIEW just get & save the reference of your ui element (say table) into an attribute declared in your views "Attribute" tab.

ex:

method WDDOMODIFYVIEW .
  check first_time = abap_true.
  wd_this->gr_table ?= view->get_element( id = 'TABLE' ).
endmethod.

Now within your WDDOMODIFYVIEW you can try set the focus explicitly by using the saved reference in this attribute.

CALL METHOD VIEW->REQUEST_FOCUS_ON_VIEW_ELEM
      EXPORTING
        VIEW_ELEMENT    = wd_this->gr_table.

Hope this helps make it clear for you.

Regards,

Uday

uday_gubbala2
Active Contributor
0 Kudos

Hi Niraja,

Regarding getting a scrollbar for the MessageArea... I had already explained the same to you in another [thread|; which you had created earlier. Am pasting the same comments from in there for your reference:

You can try proceed in this way. Create a TransparentContainer at the area where you want your messages to be displayed. Specify fixed width & height for this TransparentContainer. Now embed the MessageArea ui element inside this TransparentContainer so it would also inherit the same properties as the TransparentContainer. Now if the number of messages increases the TransparentContainer would get a scrollbar & they would get displayed within the fixed area specified by you. You wouldn't be having the problem of them eating up too much of your screen space.

Set the scrollingMode property of the TransparentContainer to "Auto" so that you will have the scrollbars appear within the container depending up on the number of messages that are getting displayed. If you ommit setting this property you will find no difference & all the messages would get displayed like how they were getting earlier & eat up your screen space.

Regards,

Uday

Former Member
0 Kudos

Uday,

but u mentioned the get element and focus has to be done in WDDOMODIFYVIEW only, then what the user of an attribute defined in attributes tab?

the UI element can be anything and dynamically changed right... its not everytime same table...

how to set the current UI element where User has done some action?

i understood the set focus method... but not setting or getting the attribute with UI element.

can u pls be more precise..

and thanks for message scroll, i ll check it.

Niraja

uday_gubbala2
Active Contributor
0 Kudos

Hi Niraja,

Sorry for the mixup I guess that the earlier suggested approach wouldn't work out for you. Try using the 2nd approach that I had suggested. Get the reference of the desired element in the WDDOMODIFYVIEW itself & instead of using the REQUEST_FOCUS_ON_VIEW_ELEM method go for the FOCUS_BY_CONTEXT_ELEMENT method of that ui element. This method can be called from within any method unlike REQUEST_FOCUS_ON_VIEW_ELEM.

Regards,

Uday

Former Member
0 Kudos

I am not able to find the method: FOCUS_BY_CONTEXT_ELEMENT in the class which u gave wdinput.

how can i do this, can u pls reply... Also on first approach yes, its not wkring..

i made a global attribute, and in modifyview, i am using REQUEST_FOCUS_ON_VIEW_ELEM , but its not working. my screen is scorlling up, even i make some actions at the bottom.

can u pls give me steps on approach one...??

Also Uday, when i have errors in the message area which is plaed in a TR, then only this window is scrolling to the top when i do an action...

is there any option for messaages, wehre this can be handled.. no scrolling to the top

Niraja

Edited by: Niraja on Dec 12, 2008 10:57 AM

Former Member
0 Kudos

how to controll the sroll bar vertical of WDA, when messages are placed..

can someone tell me pls..

when i have messages in the msg area at the top, if i come down by scrolling down the WDA, and do some action for ex: in the table, the sroll is taking up automatically, and at the top.. i ahve to scroll down again n again..

how to avoid this..

Niraja

Former Member
0 Kudos

Friends,

Can someone tell me how to stop the scroll bar.. scrolling to the top each time when i do an action in WDA..

this is happening only when i have messages in teh message area..

pls help,

Niraja

uday_gubbala2
Active Contributor
0 Kudos

Hi Niraja,

Am sorry for the late reply. I did try explicitly setting the focus as how you were asking for. (I was using the REQUEST_FOCUS method of IF_WD_WINDOW_CONTROLLER for the same.)

DATA lo_nd_sbook TYPE REF TO if_wd_context_node.
  DATA lo_el_sbook TYPE REF TO if_wd_context_element.
  DATA ls_sbook TYPE wd_this->element_sbook.

* navigate from <SFLIGHT> to <SBOOK> via lead selection
  lo_nd_sbook = wd_context->path_get_node( 'SFLIGHT.SBOOK' ).

* get element via lead selection
  lo_el_sbook = lo_nd_sbook->get_element(  ).

* @TODO handle not set lead selection
  IF lo_el_sbook IS INITIAL.
  ENDIF.

  DATA lo_view_contr TYPE REF TO if_wd_view_controller.

  lo_view_contr = wd_this->wd_get_api( ).
  lo_view_contr->request_focus( EXPORTING context_element = lo_el_sbook
                                          attribute = 'CARRID' ).

However it seems that the framework does automatically set the focus on the MessageArea if there are any messages being displayed in the view. I tried explicitly setting the focus when there were no messages and its working fine in that case. For example I tried reporting the messages in the WDDOINIT method & was trying to set the focus on to a table when the user clicked up on a button in its toolbar. Since I was reporting the error messages in the WDDOINIT method the messages were lost up on click of the button and the focus was working fine. However if I tried to report the messages from within the WDDOAFTERACTION then the messages would remain intact even on click of the button and the focus wouldn't work out. I guess that someone like Thomas would be the best person to comment on whether we can explicitly set the focus on an ui element when the MessageArea contains some messages.

Regards,

Uday

Answers (0)