You need to sign in to do that
Don't have an account?
Patrick Mayer 4
I am trying to use the streaming API to rerender this list when any case is changed. I am guessing I should use some different javascript. Has anyone done this?
I have checked workbench and am seeing the notifications. Also, a secondary minor question, is there any way to put a text output or something inside of the subscribe just as a sanity check that it gets hit?
Using Streaming API to rerender an EnhancedList
<apex:page id="page" tabStyle="Case"> <apex:includeScript value="{!$Resource.cometd}"/> <apex:includeScript value="{!$Resource.jquery}"/> <apex:includeScript value="{!$Resource.json2}"/> <apex:includeScript value="{!$Resource.jquery_cometd}"/> <script type="text/javascript"> var j$ = jQuery.noConflict(); j$(document).ready(function() { j$.cometd.init({ url: window.location.protocol+'//'+window.location.hostname+'/cometd/28.0/', requestHeaders: { Authorization: 'OAuth {!$Api.Session_ID}'} }); j$.cometd.subscribe('/topic/CaseUpdates', function(message) { document.getElementById('{!$Component.page.PageBlock}').style.display = 'none'; document.getElementById('{!$Component.page.PageBlock}').style.display = 'block'; }); }); </script> <apex:pageBlock id="PageBlock"> <apex:enhancedList type="Case" height="300" rowsPerPage="10" id="AccountList" /> </apex:pageBlock> </apex:page>
I am trying to use the streaming API to rerender this list when any case is changed. I am guessing I should use some different javascript. Has anyone done this?
I have checked workbench and am seeing the notifications. Also, a secondary minor question, is there any way to put a text output or something inside of the subscribe just as a sanity check that it gets hit?
For more details
https://www.salesforce.com/us/developer/docs/api_streaming/index_Left.htm#CSHID=create_a_pushtopic.htm|StartTopic=Content%2Fcreate_a_pushtopic.htm|SkinName=webhelp