PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 01/17/2014 7:38 AM by  Chris12
OnClick Question
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Chris12
Private
Private
Veteran Member
(366 points)
Veteran Member
Posts:150


Send Message:

--
01/16/2014 3:39 PM
    I have a screen in DS which contains multple buttons.  I would like to have multiple onClick events (one for each button) ....

    How do I segrate the onClick events such that each button knows what OnClick function to use ...

    This one is killing me
    Robert Spurr
    Private
    Private
    Veteran Member
    (344 points)
    Veteran Member
    Posts:130


    Send Message:

    --
    01/16/2014 3:48 PM
    the OnClick button has a variable call 'id'. Every object in design studio is assigned an 'id'. For buttons it will something like 'push7'. All you need to do check the the 'id' to determine the action you want to take.
    if(id=="push7")
    {
    //Do something
    }
    Chris12
    Private
    Private
    Veteran Member
    (366 points)
    Veteran Member
    Posts:150


    Send Message:

    --
    01/16/2014 7:04 PM
    Thanks Robert ....
    But how to a link the button to the function ....

    It seems when I click the button (ie push 7) it does nothing
    Terry P
    Private
    Private
    Veteran Member
    (612 points)
    Veteran Member
    Posts:234


    Send Message:

    --
    01/16/2014 7:32 PM
    With the button you're trying to use, click on the Properties for it. You'll see at the bottom "Action". When you open that, then typically you'll click the radio option for "Function". When you do that, all your custom functions are listed. Create a function you want to execute when the button is pushed.
    Chris12
    Private
    Private
    Veteran Member
    (366 points)
    Veteran Member
    Posts:150


    Send Message:

    --
    01/17/2014 7:38 AM
    Thanks all .... in my if statement I only had "=" and not "==" ....

    Thanks so much
    You are not authorized to post a reply.