• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. How to set default values in radio field

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 10672
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to set default values in radio field

saurabh96
saurabh96 over 4 years ago

Hello Guys,

i have created radio field below and call their default value(i.e "",-excute1 and -excute 2) from radio field ..am facing an issue when am selecting any radio button its value is coming "nil"  ...as (form->radio_entry->value) is coming nil..how to correct it-

below code -

radio_Entry=hiCreateRadioField(
?name 'radio_Entry
?choices list("None" "Check1" "Check 2")
?value "None"
?enabled t
?callback list("MyFields(hiGetCurrentForm())")
)

procedure(MyFields(form)
case(form->radio_Entry->value
("None"
form->->value=""
)
("Check1"
form->->value="-excute h1"
)
("Check 2"
form->->value="-excute h2"
)
)
)
)

  • Cancel
Parents
  • mbracht
    mbracht over 4 years ago

    Hi

    The value slot of the radio field data structure must be one of the strings defined in the ?choices list - watch your CIW output and you will see a warning about this:
    WARNING* Form 'MyForm', field 'radio_Entry': Bad value "Ceck1".
        Radio value must be one in the list of choices.

    Other than that this callback is totally useless - the assignment to the value slot happens automatically when you click one of the radio buttons, why would you want to overwrite it???

    Max

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • mbracht
    mbracht over 4 years ago

    Hi

    The value slot of the radio field data structure must be one of the strings defined in the ?choices list - watch your CIW output and you will see a warning about this:
    WARNING* Form 'MyForm', field 'radio_Entry': Bad value "Ceck1".
        Radio value must be one in the list of choices.

    Other than that this callback is totally useless - the assignment to the value slot happens automatically when you click one of the radio buttons, why would you want to overwrite it???

    Max

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • saurabh96
    saurabh96 over 4 years ago in reply to mbracht

    Hey max,

    thank you for quick response.few questions

    1) If i defined "None" in radio value, as it is defined in  radio choices also..shouldn't is right??

    2) if we don't use callback, how i can append values as radio choices and their respective values are different.

    let me brief more

    Actually i have scenario in which i have to write the input given from radio field into file.   fprintf(cell "-chk %L " form->chk_path_enter->value );cell is file name

    so if user selects none then value should be  = blank("")

    same if check1 then value should be=  -excute1

    check2 then value should be =  -excute2.

    regards,

    srv

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to saurabh96

    So your code doesn't match the picture, and I've no idea what the ->-> bits were for. Anyway, I made some small modifications to the code and now you have a ->chk_path_enter->value you can retrieve:

    It would be far better if you provided a complete example, and I'm rather surprised after the help on the previous topics that you're unable to get this kind of thing working. None of this is that complicated!

    Andrew

    radio_Entry=hiCreateRadioField(
      ?name 'radio_Entry
      ?choices list("None" "Check1" "Check 2") 
      ?value "None"
      ?enabled t
      ?callback list("MyFields(hiGetCurrentForm())") 
    )
    hiCreateLayoutForm(
      'MyForm
      "SRV form"
      hiCreateFormLayout(
        'lay
        ?items list(
          radio_Entry
          hiCreateStringField(
            ?name 'chk_path_enter
            ?editable nil
          )
        )
      )
    )
    
    procedure(MyFields(form) 
      case(form->radio_Entry->value
        ("None" 
          form->chk_path_enter->value=""
        )
        ("Check1"
          form->chk_path_enter->value="-excute h1"
        )
        ("Check 2"
          form->chk_path_enter->value="-excute h2"
        )
      )
    )
    
    hiDisplayForm(MyForm)
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information