Results 1 to 6 of 6
  1.    #1  
    Hi!
    I have a ListSelector in my application and do not know how to get the actual choise of the widget. E.g. the choises are:
    Code:
    [
    {
    value: 1,
    label: "test1"
    },
    {
    value: 2,
    label: "test2"
    }
    ]
    So how do I get the actual selected label, in this case "test1" if I select the first choise.
  2. #2  
    from the model.value
  3.    #3  
    But this.model.value returns just value and not the label. So it returns "1" and not "test1" what I want, if the selected value is 1.
  4. #4  
    For such selectors, the value is what you want your program to handle, while the label is what the user sees. If you want the user to choose '1' and you read out 'test1', then you should use '1' as the label, and 'test1' as the value.

    If you are wanting to choose 'test1' and get out 'test1', you should set both the label and the value to 'test1'

    The reason for the separation is so that you can present the user something nice that represents something easily handled by your program.
  5.    #5  
    Aaaah okay, now I get it
    I thought you could get also the label, but setting the value=label also does the work for me. Thank you very much!
  6. #6  
    If you wanted to go that way, choices[] can be in the 'model' instead of the 'attributes'.

Posting Permissions