cancel
Showing results for 
Search instead for 
Did you mean: 

ItemListbox Scrollbar

0 Kudos

Hi All,

         I have an itemlistbox which contains about 50 items and i am displaying 10 initially. When i scroll down to item 11 and perform some action, the action is performed as expected.But the issue i am facing is, After the action is done, the itemlistbox refreshes and the the scroll bar moves to the top which displays first 10 items. I want the scroll bar to be there at the 11th item. Can this be achieved in webdynpro java? Any help would be greatfull..

Thanks,

Nooruddin

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member216897
Discoverer
0 Kudos

The problem is with the focus. You can solve it with following workaround:

1. Get the view reference and store it as a view attribute:

METHOD wddomodifyview .
  wd_this->iv_view = view.
ENDMETHOD.

2. Set the focus to the listbox after filling the values with following code:

  DATA: lo_view_element       TYPE REF TO if_wd_view_element.

  IF wd_this->iv_view IS BOUND.

    wd_this->iv_view->get_element( EXPORTING id = 'ILB_xxx'  " id of your itemlistbox in the view's layout
                                   RECEIVING element = lo_view_element ).

    IF lo_view_element IS BOUND.
      wd_this->iv_view->request_focus_on_view_elem( EXPORTING view_element = lo_view_element ).
    ENDIF.

  ENDIF.

Your scrolling problem will be solved.

ErvinSzolke
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I think you can change the leadselection to the desired item after you perform your action.

Regards,

Ervin

Sharathmg
Active Contributor
0 Kudos

Thnx Ervin. I had the same option in  mind but was not sure as an item list box with multiple selection will reset focus of the selected element.

Regards,

Sharath

0 Kudos

Thanks Ervin and Sharath for the response. The selected items stay selected after action.No problem with that.But my problem is the scroll bar movesup. I want the scrollbar to stay where i have selected items at the bottom.

thanks,

Nooruddin

Former Member
0 Kudos

Yes...Actually I had tried this in one of my requirement for drop down UI element..You can refer following document to find the selected entry from the ItemListBox..but as Sharath told may be there would be some issue in case of multiple selection.

http://scn.sap.com/thread/381722

0 Kudos

Hi Patralekha Sur,

                              I am able to select values and  perform the logic. But my problem is with the scroll bar after selecting the values and performing action, the scroll bar of the itemlistbox moves to the top automatically. I want the scrollbar to be there where i scrolled down.

thanks,

Nooruddin

Former Member
0 Kudos

Hi Shaik,

I think you can go for previous & next button or Paging to avoid this prob.

Please follow below links to do that.

1) Previous & Next button:-

https://scn.sap.com/thread/3427336

2) Paging :-

http://scn.sap.com/people/bertram.ganz/blog/2008/11/27/web-dynpro-java-table-paging-unleashed-optimi...

Thanks,

Patralekha