简体   繁体   中英

Platform Events

I cant make plaform event work. When in Chrome I cant see any request being made (but if I do XSP.PartialRefreshGet it works. Maybe I have a library version problem?). Here is the code.

<xp:button id="button1" value="ClickMe">
    <xp:eventHandler event="onclick" submit="false">
        <xp:this.script><![CDATA[XSP.publishEvent("publishString", "hello", "string");]]></xp:this.script>
    </xp:eventHandler>
</xp:button>
<xp:label value="Label" id="label1"></xp:label>
<xp:platformEvent id="platformEvent1" eventName="publishString">
    <xp:eventHandler event="onevent" submit="true" refreshMode="complete">
        <xp:this.action><![CDATA[#{javascript:if (context.getSubmittedValue() == null)     getComponent("label1").setValue("No value submitted");
else getComponent("label1").setValue(context.getSubmittedValue());}]]>
        </xp:this.action>
    </xp:eventHandler>
</xp:platformEvent>

PS: can someone upload uncompressed XSPClientDojo library please. It doesnt exist in domino directory for some reason.

publishEvent is part of the support for XPiNC (XPages in the Notes Client), alongside methods like XSP.executeCommand. They deal with integration with the Notes client specifically, so they're best to ignore when doing proper browser development.

Dojo events are probably more what you're looking for: http://dojotoolkit.org/documentation/tutorials/1.7/events/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM