November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
I found this old script that I think takes care of only updating the messages. QuickChat.js:
(function($) {
quickchat = {};
quickchat.init = function(e, gadgetContext) {
// Reloads the gadget if it is visible
var reload = function() {
if (gadgetContext.isVisible()) {
// Using the uses the gadet's ajax handler brings
// features such as the ajax loader and error handling
var routeValues = { action: "Messages" }
var actionUrl = gadgetContext.getActionPath(routeValues);
gadgetContext.ajax({
url: actionUrl,
dataType: "html",
success: successHandler
});
}
};
// Updates the messages div with new content retrieved
// by the ajax request
var successHandler = function(data) {
var chatMessages = $(".messages", gadgetContext.element);
chatMessages.html(data);
};
// start reloading the messages at an interval
setInterval(reload, 5000);
};
})(epiJQuery);
Looks promising but (var
gadgetInstance = gadgetContext.instance;),
Gets a null value wich breaks on isVisible function.
anything im missing ?
It seems the code predated the release version and some things have changed. I updated it a bit and it might work better now.
It ain't breaking now but i can't really se any ajax updates either, it's like the 5 sec intervall ain't running.
Firebug in Firefox is not picking upp any ajax calls, not in the net tab or console tab.
Any Clues ?
What happens if you remove the isvisible check? This really isn't a good way to debug old code ;)
Well now it starts refresh every 5 sec, although now i get 500 errors so i gota figure that one out now.
Got it working now but my entire gadget replaced the orginal message list and now is updated. How is your Messages action setup ?
Made a new partial view for the message part and that is working nice now, only updates that part too :)
I just yesterday started trying out gadget development and did the tutorial for a QuickChat (http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-60/Gadgets---Tutorial/) and it's all nice and working, however the ajax update on 5 seconds is a bit anoying since it updates the entire view and not only the messages. If i start typing in the message box for a new message it will be cleared when the gadget gets refreshed.
I found a small gadget api reference (http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-60/OnlineCenter-Developer-Documentation/) but there is no hint about how to do partial updates for a gadget like partial updates in MVC.
Does anyone know how to do this ?