Updating certain view programmatically from a JMS listener class

前端 未结 1 559
隐瞒了意图╮
隐瞒了意图╮ 2021-01-21 11:39

I was able to integrate ActiveMQ and create a JMS consumer into my OpenXava application. Now, I need to update certain transient view with the data received in the message, whi

相关标签:
1条回答
  • 2021-01-21 12:12

    An option can be using JavaScript to calling regularly to know if a new record is added in the table or whatever, and if it is case refreshing.

    If you're liferay you can create a portlet in that page with the JavaScript code. This code can do the call using DWR, and if there is new data it can call to the "CRUD.refresh" action directly.

    Something like this:

    refreshData = function() {
       openxava.executeAction('YourApplication', 'YourModule', '', false, 'CRUD.refresh')
       setTimeout('refreshData()', 5000);
    }
    setTimeout('refreshData()', 5000);
    

    I didn't test this code, so surely it does not work as is. Take it as an idea.

    Really, this is a dirty trick. The ideal would be that OpenXava would have direct support for comet, you could accomplish this just calling to an method in the server. Do you think that adding comet support to OX worth?

    0 讨论(0)
提交回复
热议问题