• Dave Wakeman
    May 25, 2016 at 1:45 pm #1911

    Hello,

    I am working on a coach view that has a function in my inline javascript.  On my layout I have a text box whose control id is “newComment”.  In the On Change event I added this:  @addComment();

    I had originally wrote the function without a parameter:
    this.addComment = function() {
    
    var myComment = this.ui.get("newComment").getText();
    
    This seems to work just fine; when the function runs the value of myComment is whatever text was entered in the text box.  Later I decided to add a parameter to the function, like so:
    
     this.addComment = function(vaComment) {
    ...
    }
    
    so I updated my On Change event as well, to this:  @addComment(me.getText());
    
    I expected the function to get a string containing the content of the text box by no matter what addressing style I use I get some sort of object that I think is the view, not a string.  
    
    What am I doing wrong?  What is the correct syntax for passing the value of a control to a function in my inline javascript from that same control's events?
    
    I have read your Control Addressing article many times and nothing I found there (and I have tried every variation) seems to work.
    
    Please help!  Thanks!
    
    - Dave
    
    
    
    

     

     

     

    SPARK Support
    May 25, 2016 at 3:00 pm #1914

    Hey Dave,

    The @ notation is a shorthand way of calling a function without passing in parameters. When passing in parameters, try using this code:

    me.ui.invoke(“addComment”, me.getText())

    Here is an article to learn more about this function – http://support.salientprocess.com/docs/enterprise/bpmext.ui.View.html#invoke

    -Elliot P.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Start typing and press Enter to search