Skip to content

Instantly share code, notes, and snippets.

@keirbowden
Created December 27, 2013 15:50
Show Gist options
  • Save keirbowden/8148850 to your computer and use it in GitHub Desktop.
Save keirbowden/8148850 to your computer and use it in GitHub Desktop.
Visualforce page that sets up the topic subscription and includes the streaming component to display browser notifications.
<apex:page controller="StreamingController">
<apex:pageMessages id="msgs" />
<apex:outputPanel id="all">
<apex:outputPanel rendered="{!topic==''}">
<apex:form >
<apex:actionFunction name="createTopic" action="{!CreateTopic}" rerender="all, msgs" />
<script>
alert('Creating topic - create topic function = ' + createTopic);
createTopic();
</script>
</apex:form>
</apex:outputPanel>
<apex:outputPanel rendered="{!NOT(topic=='')}">
<c:Streaming topic="{!topic}" />
</apex:outputPanel>
</apex:outputPanel>
</apex:page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment