How to read values from "Select" Component in Rollbase Mobile - Forum - Mobile - Progress Community

How to read values from "Select" Component in Rollbase Mobile

 Forum

How to read values from "Select" Component in Rollbase Mobile

This question is not answered

I am using the ‘Select’ component  in RB Mobile and there are (2) variables that I could invoke in a java script, (label and Value). I am able to invoke the ‘Value’ to get the info. But can’t invoke the ‘Label’?  

How can I invoke the Label to get its content in a java script ?  I am trying to capture the Label info. To store it in a local variable to write back to the record in the Object in RB from RB Mobile.

Thank you for your help.
Manny.

All Replies
  • Hi Manny,
     
    Use following code snippet to get the selected label name from the ‘Select’ component. This can be invoked on ‘Value change’ event of Select component in Mobile App Builder.
     
                    var mySelectLabel = Progress("mySelectMenu").find(":selected").text();
    alert(mySelectLabel);    
     
    For Retrieving Value associated to label:
     
                    var mySelectval = Progress("mySelectMenu").find(":selected").val();
    alert(mySelectval);
     
    Thanks and Regards,
    Anil Kumar.
     
    From: mvergara [mailto:bounce-mvergara@community.progress.com]
    Sent: Wednesday, October 29, 2014 12:59 AM
    To: TU.Mobile@community.progress.com
    Subject: [Technical Users - Mobile] How to read values from "Select" Component in Rollbase Mobile
     
    Thread created by mvergara

    I am using the ‘Select’ component  in RB Mobile and there are (2) variables that I could invoke in a java script, (label and Value). I am able to invoke the ‘Value’ to get the info. But can’t invoke the ‘Label’?  

    How can I invoke the Label to get its content in a java script ?  I am trying to capture the Label info. To store it in a local variable to write back to the record in the Object in RB from RB Mobile.

    Thank you for your help.
    Manny.

    Stop receiving emails on this subject.

    Flag this post as spam/abuse.

  • Thanks Anil,

    I tested this code and worked. :)

    Cheers,
    Manny.

    From: Anil Kumar <bounce-anikumar@community.progress.com>
    Reply-To: "TU.Mobile@community.progress.com" <TU.Mobile@community.progress.com>
    Date: Tuesday, October 28, 2014 at 4:21 PM
    To: "TU.Mobile@community.progress.com" <TU.Mobile@community.progress.com>
    Subject: RE: [Technical Users - Mobile] How to read values from "Select" Component in Rollbase Mobile

    var mySelectLabel = Progress("mySelectMenu").find(":selected").text();
    alert(mySelectLabel);