Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Refresh a listbox with a LookupCall backend(Refreshing listbox contents when the linked data source is updated)
Refresh a listbox with a LookupCall backend [message #1862118] Mon, 13 November 2023 21:05 Go to next message
J D is currently offline J DFriend
Messages: 100
Registered: February 2021
Senior Member
Hi there everyone,

I have several smartfields and listboxes on a form all of which are populated by several lookupcalls.

The smartfield contents update in real time when rows are added, updated or deleted in the data source BUT the listboxes do not update at all. At the moment, the only way I can refresh a listbox contents is to close the form and then reopen it.

This is an example of one of my listboxes:

      @Order(1000)
      public class DemandsListBox extends AbstractListBox<Integer> {
        @Override
        protected String getConfiguredLabel() {
          return TEXTS.get("Demands");
        }

        @Override
        protected int getConfiguredGridH() {
          return 6;
        }

        @Override
        protected Class<? extends ILookupCall<Integer>> getConfiguredLookupCall() {
          return DemandLookupCall.class;
        }
      }


Is there any way to make a listbox refresh itself?

Thanks for your kind assistance.

Cheers,

JD
Re: Refresh a listbox with a LookupCall backend [message #1862120 is a reply to message #1862118] Tue, 14 November 2023 04:57 Go to previous messageGo to next message
Matthias OtterbachFriend
Messages: 55
Registered: August 2015
Location: Munich
Member
There is no such thing as an automatic reload for listboxes (actually also not for smart fields however they work differently, they are only loaded after they've been opened and each data request will trigger another load e.g. typing in the field).

However you could manually reload the listbox by calling org.eclipse.scout.rt.client.ui.form.fields.listbox.AbstractListBox#loadListBoxData. You would however still need an event or a trigger when to call this method, out-of-the box there is no such thing like a notification when a list has changed (and this would also only be useful if the list does not change too often) maybe you could add a reload button? Or if you do know about the changes (e.g. add/remove elements on the form itself) trigger the load method immediately again afterwards?

[Updated on: Tue, 14 November 2023 04:58]

Report message to a moderator

Re: Refresh a listbox with a LookupCall backend [message #1862296 is a reply to message #1862120] Wed, 22 November 2023 22:26 Go to previous message
J D is currently offline J DFriend
Messages: 100
Registered: February 2021
Senior Member
The reload button seems like the best option. Thanks a lot Matthias.

JD
Previous Topic:Error by maven build
Next Topic:Table with dynamic number of columns
Goto Forum:
  


Current Time: Wed May 08 22:14:37 GMT 2024

Powered by FUDForum. Page generated in 0.03617 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top