Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Is there a property to get radio button group values and labels?

Is there a native OI property to get an array of values and labels for a radio button group?

We're generating logs and status messages for certain states on a form, and it would be nice to not only report the INVALUE of a radio button group, but also report the label the user is seeing.

Comments

  • Are you looking for the TEXT property?
  • Hi, Don!

    No, I don't think so...

    In the documentation you linked to above, it says the "TEXT property for a radio group does nothing", which is an exceedingly accurate description for the behavior we're seeing. :)

    But yes -- a "TEXT_LIST" property of some kind (showing the labels for a radio group) is exactly what we're trying to find.
  • You need to apply it to the RADIOBUTTON, not the RADIOGROUP.
  • edited May 2019
    I 100% understand that, but I'm still missing something fundamental. (I'm sure it's quite simple, I'm just not seeing it.)

    In order to use the TEXT property on a RADIOBUTTON, I believe I do something like:

    label = get_Property( form:'.radio_group.Button One', 'TEXT' )

    The problem I have is that this returns "Button One". In other words, in order to ask a radio button what its label is, I apparently have to use its label? It seems like I already need to know the answer before I ask the question.

    That's the problem we're trying to solve. How do we get TEXT properties from radio buttons if we don't already know their labels?
  • I see what you are getting at. Well first of all, the name of the RADIOBUTTON isn't exactly the same as the label displayed. OI will convert the label to a valid control name pattern. However, your point is still noted.

    I don't think there is a way to derive the buttons from the group. I think you'll have to get the list of controls for the form and compare the VALUE property of each button to see if it matches the VALUE property of the group. That's when you know which button to get the TEXT property for.
  • Thanks, Don! That's the direction we were headed, but we were hoping there was a more native way to do it.
Sign In or Register to comment.