Reputation: 135
I tried to call the pnotify with a button.
When I clic and if there isn't message, then a message (pnotify) arrives with success and the same with error int the other case.
<xp:div id="divMessages">
<xp:messages id="messagesValidation" styleClass=" customErreurSaisie customErreur">
</xp:messages>
</xp:div>
<xp:button id="btnEnregistrer">
<xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="divMessages">
<xp:this.action>
<xp:actionGroup>
<xp:saveDocument var="dsdModeleDeMasque">
</xp:saveDocument>
</xp:actionGroup>
</xp:this.action>
<xp:this.onComplete><![CDATA[
var messages = XSP.getElementById("#{id:messagesValidation}");
if (messages) {
notifyLastAction("Document non sauvegardé", "essai", "error");
} else {
notifyLastAction("Document sauvegardé", "essai", "success");
}
var proprietes = XSP.partialRefreshGet("#{id:lesProprietes}");
if (proprietes)
{
XSP.partialRefreshGet("#{id:lesProprietes}");
}
]]></xp:this.onComplete>
</xp:eventHandler>
</xp:button>
My error in the console is TypeError: "Impossible to get the property "destroy" with null or undefined reference ".
Could you help me ?
Upvotes: 0
Views: 104