Alarm Journal Refresh

Is there a method to force an alarm Journal Table to refresh (other than changing the start or end dates)?

I want to be able to dynamically filter the journal table on associated data. I added the filter string as a dynamic property on the journal table, but changing it’s value will not update the table. The only way I can get the table to update is to change the date range and then change it back.

I’ve got the same question. I arbitrarily tried running the below code, but neither line works, I just get warnings that it is “unable to find a refresh-compatible property binding”

system.db.refresh(event.source.parent.getComponent('Alarm Journal'), "data") system.db.refresh(event.source.parent.getComponent('Alarm Journal'), "alarms")

Anyone else have any luck refreshing the Alarm Journal Table component?

Here is my workaround, it’s actually very smooth from the user’s perspective.

My Alarm Journal Component’s startDate and endDate properties are bound to the startDate and endDate properties of a Date Range component. To get a refresh to happen, I put a Button component on the screen which adjusts the Date Range’s startDate and then immediately changes it back. I named this my “Refresh Button.” Here is the code from my refresh button’s actionPerformed event handler.

[code]startDate = event.source.parent.getComponent(‘Date Range’).startDate

#Subtract one minute from the start time on the range so the Alarm Journal Table component refreshes its dataset.
startDate = system.date.addMinutes(startDate, -1)
event.source.parent.getComponent(‘Date Range’).startDate = startDate

#Add the minute back so our range is still the same.
startDate = system.date.addMinutes(startDate, 1)
event.source.parent.getComponent(‘Date Range’).startDate = startDate[/code]

Then, to get it to work automatically, I added a Timer component with the following code in its actionPerformed event handler.

event.source.parent.getComponent('Refresh Button').doClick()

After that, it’s just a matter of modifying the Timer’s delay so that the Journal refreshes at the rate you want. You can even make the refresh button invisible if you don’t want users to know it’s happening. Or leave it visible and they will have the ability to refresh at their own pace in addition to the timed refresh rate.

Now that I think about it, you could probably have the refresh button directly modify the Alarm Journal Table’s startDate instead of doing it indirectly like I did. Probably would have the same effect.

We use a dropdown list to filter the alarms like you do, but in the PropertyChange event on the dropdown we do the following

event.source.parent.getComponent('Alarm Journal').startDate=event.source.parent.getComponent('Range').startDate

It just rewrites the start date to the same value and it triggers the refresh and filter.

Doug,
In your case you could just set the EndDate to an expression like

now(5000)
3 Likes

Hey @MMaynard, what is the 5000 mean, is this the refresh rate for refresh every 5 seconds? Thank you!

It is the polling rate in milliseconds. In this case the expression would update every 5 seconds.

1 Like

Thank you sir!