2 Replies Latest reply on Sep 23, 2015 4:35 AM by Suntanned

    How to affect a PageItem within an OnClick handler




      I'm trying to set the geometricBounds of a PageItem and that works fine until I do it within a button click handler, then nothing happens.




      function createDialog(header, message, pageItem) {
           var dialog = new Window("dialog", header),
                textArea = dialog.add("statictext {preferredSize: [200, 100], properties: {multiline: true}}"),
                correctButton = dialog.add("button", undefined, "Correct");
           textArea.text = message;
           correctButton.onClick = function() {
                pageItem.geometricBounds = [1, 1, 8, 8];


      Also, only the first alert pops up. 'After' is never shown.


      Any ideas?