2

I found this article at Xomino : pines notify

This works fine from csjs for example :

<![CDATA[$.pnotify({ pnotify_title: 'Regular Notice', pnotify_text: 'Check me out! I\'m a notice.' });]]>

How can I use it in an ssjs ? (In the ssjs I 'll decide if it has to be displayed and what the contents of it will be)

Marc Jonkers
  • 496
  • 1
  • 7
  • 17

1 Answers1

1

You can use csjs combined with ssjs to solve your requirements.

Take a look at the following example:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" dojoForm="true" dojoParseOnLoad="true" dojoTheme="true">

    <xp:this.beforePageLoad><![CDATA[#{javascript:viewScope.title = "Title of the dialog"}]]></xp:this.beforePageLoad>

    <xp:scriptBlock id="scriptBlock1">
        <xp:this.value><![CDATA[dojo.ready(function(){

  dojo.require("dijit.Dialog");
    // create the dialog:
    myDialog = new dijit.Dialog({
        title: "#{javascript:viewScope.title}",
        content: "test content",
        style: "width: 300px"
    });

});]]></xp:this.value>
    </xp:scriptBlock>

    <xp:button value="Label" id="button1">
        <xp:eventHandler event="onclick" submit="false">
            <xp:this.script><![CDATA[myDialog.show();]]></xp:this.script>
        </xp:eventHandler>
    </xp:button>

</xp:view>

I hope this helps :)

Georg Kastenhofer
  • 1,387
  • 12
  • 32
  • I would like to fire up the dialog with ssjs not csjs – Marc Jonkers Nov 19 '15 at 13:33
  • You could use `view.postScript("XSP.openDialog('#{id:myDialogId}')")` or `facesContext.getViewRoot().postScript("XSP.openDialog('#{id:myDialogId}')");` to open the dialog from ssjs – Georg Kastenhofer Nov 19 '15 at 13:40
  • When I try this , I'm getting a TypeError : XSP.openDialog is not a function I would also prefer to fire up the pines notify dialog with ssjs.... – Marc Jonkers Nov 19 '15 at 14:29