掲示板
PollerProcessor not triggered
I'm trying to configure a custom PollerProcessor but I can't seem to get the processor to trigger when I send requests from my js.. I've been using the Chat portlet and this post as references: http://agile-reflections.opnworks.com/2011/07/polling-liferay-portal.html
I don't see what I'm missing, I have a very simple poller class (extends BasePollerProcessor) with log statements in my methods (i never see them).
The JS: Add listener
send and update functions
I do notice that there's a JSON parsing error but there's no line/file. Maybe that error prevents the request from actually being executed to my poller processor?
firebug output:
Anyone see this before?
I don't see what I'm missing, I have a very simple poller class (extends BasePollerProcessor) with log statements in my methods (i never see them).
@Override
protected void doReceive(PollerRequest req, PollerResponse res)
throws Exception
{
log.info("doReceive invoked, request: " + req +"\r\nResponse: "+ res);
JSONObject obj = JSONFactoryUtil.createJSONObject();
obj.put("title", "MyTitle");
res.setParameter("content", obj);
}
The JS: Add listener
Liferay.Poller.addListener(instance._portletId, instance._onPollerUpdate, instance);
Liferay.bind(
'sessionExpired',
function(event) {
console.log("Removing poller listener");
Liferay.Poller.removeListener(instance._portletId);
//instance._pollExContainer.hide();
}
);
send and update functions
send: function(options, id) {
var instance = this;
console.log("options:" + options + " id: " + id);
Liferay.Poller.submitRequest(instance._portletId, options, id);
},
_onPollerUpdate: function(response, chunkId) {
console.log("Got poller update");
I do notice that there's a JSON parsing error but there's no line/file. Maybe that error prevents the request from actually being executed to my poller processor?
firebug output:
options:[object Object] id: undefined
POST http://localhost:8080/poller/send 200OK 6ms
SyntaxError: JSON.parse: unexpected end of data
Anyone see this before?
7年前 に azhar shaikh によって更新されました。
RE: PollerProcessor not triggered
Junior Member 投稿: 43 参加年月日: 15/08/29 最新の投稿
I am having the same issue.Have you resolved it? or any solution?