Having implemented a valueChangeListener, using an onclick=”submit()”

With the code resulting in

            //          Now update GUI

            FacesContext.getCurrentInstance().renderResponse();

My screen is redrawn – it has quite a few components displayed and so the User sees the top of the screen being displayed

Is there any way to ‘mark’ which component should be scrolled into view when the redraw occurs



As far as I know there isn't currently any way to force a particular component to be scrolled into view after a round-trip to the server.

This might make a nice tomahawk component:
  <t:scrollToView>
    <!-- example of a component to scroll to after refresh -->
    <h:inputText .../>
  </t:scrollToView>
or
  <t:scrollToView componentId="id_of_component_to_scroll_to"/>

There are a number of different possible implementations in javascript. From a brief look around I see:
  obj.scrollIntoView(true) --> IE only?
  obj.scrollTop="10px" --> ??

However in most cases you want to set focus on this component as well as scrolling it into view, yes? And I suspect that if you set focus on a component the browser will automatically scroll it into view if it isn't already. So maybe a custom component like this would be more useful:

  <t:focus componentId="id_of_component_to_focus"/>

This should also be mush easier to implement in a portable manner...


Regards,

Simon

Reply via email to