Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Modifying table behaviour (Scrolling to the end after inserting new elements)
Modifying table behaviour [message #1008611] Wed, 13 February 2013 04:40 Go to previous message
Urs Beeli is currently offline Urs Beeli
Messages: 164
Registered: October 2012
Location: Bern, Switzerland
Senior Member
I have added a form containing a table to my application that shows messages generated on the server or by other clients (kind of an event log). I have managed to set up a client notification service that keeps this table updated with the latest content. However there is one issue I have not managed to solve.

I disabled sorting of the table (SortEnabled=false) so the entries always appear in the correct order. By default, I want the table to always show the latest entries (which are at the bottom of the table). However, filling the table with updated data scrolls back to the top of the table.

What I've done currently is the following:
In my form class I have:
  public void refreshForm() throws ProcessingException {
    IMessageListProcessService service = SERVICES.getService(IMessageListProcessService.class);
    MessageListFormData formData = new MessageListFormData();
    exportFormData(formData);
    formData = service.load(formData);
    importFormData(formData);
    setEnabledPermission(new ReadTabbedPermission());
    getTableField().getTable().selectLastRow();
    getTableField().getTable().deselectAllRows();
  }

  public class DisplayHandler extends AbstractFormHandler {
    @Override
    public void execLoad() throws ProcessingException {
      refreshForm();
    }
  }


The client notification handler then just calls form->refreshForm().

This scrolls the table to the bottom when refreshForm() is called from the notification handler, but not on its initial call, when the form is filled from form.DisplayHandler.execLoad().

So I have two questions:

  • is there a better way to enforce that the table always scrolls to show its bottom entry?
  • any ideas why my hack above does not work on the initial population of the table?

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:How to extend the LoginDialog
Next Topic:deployment problem
Goto Forum:
  


Current Time: Thu May 23 08:30:21 EDT 2013

Powered by FUDForum. Page generated in 0.01759 seconds