How can I refresh UI on DB changed?

Hi there,

How can I refresh UI when DB is changed?

I'm developing a mobile app.

Thanks!

Hi Yatima,

Never did it my self but this should work https://www.outsystems.com/forge/3972/

Regards,

Marcelo

Hi Yatima,

If the data is in the Local Storage, refreshing the Aggregate that gets the data suffices. If the data is in the Server database, then you need to signal the app to refresh (like Marcelo hinted).

Thank you, guys!

I'll try it!

But, when I'm using Local Storage, how can I catch the "DB is changed!" event?

I tried to refresh the Aggregate, but I don't know where should I add the Action.

Yatima Kagurazaka wrote:

Thank you, guys!

I'll try it!

But, when I'm using Local Storage, how can I catch the "DB is changed!" event?

I tried to refresh the Aggregate, but I don't know where should I add the Action.

Hi,

How is your local database being changed?

Cheers


Hi!

Some are simply added new rows, and others are changed data in the row.

Yatima Kagurazaka wrote:

Hi!

Some are simply added new rows, and others are changed data in the row.

What I mean was, is you making those changes when? Like, after an user interaction with the application, on a timer, etc.

Because if you have code that is inserting something in database, for example, and you want to update the UI (a list, for example), all you have to do is to execute the data refresh.

If you are inside a block when you do the update to the entity, and the UI you want to update is outside the web block, you can trigger an event.

If you are outside a block when you update the entity and want to update a block, just create a dummy input parameter, of type boolean, let's say IsChangeThisBlock, and assign to it the value "not IsChangedThisBlock" (without the quotes), as this will trigger the OnParametersChanged event and you can have an action bound to it and refresh an aggregate, etc.

Does this help you?

Cheers.

Thank you for your advice.

That's good to know.


But, they're changed by several ways.

Because of it, I want to listen DB changed itself.


Is it difficult to achieve that?

Hello Yatima,

I don't know any way of achieving that.

Cheers.

Thanks anyway,

I think it should be implemented on OutSystems if not now because it's more natural to automatically refresh UI when local DB is changed.

Yatima Kagurazaka wrote:

Thanks anyway,

I think it should be implemented on OutSystems if not now because it's more natural to automatically refresh UI when local DB is changed.

I confess I never saw an application that refresh UI when the DB changes... Not that they don't exist.
In any case, you can add an IDEA in the ideas section of the web site.

Cheers.