• 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 disable one radiofield when the other radiofield...

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 2881
  • 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 disable one radiofield when the other radiofield is selected?

swathiba24
swathiba24 over 1 year ago

For example: When we have two radiofields ("Yes", "No")using hiCreateRadiofield() , When "Yes", "No" Radiofield should be disabled

RadioField=hiCreateRadioField(
?name 'netlists
?prompt ""
?choices list("Yes" "No")
?value "Cell View"
?enabled t
)

  • Cancel
Parents
  • p94todorov
    p94todorov over 1 year ago

    You can toggle a field editability/visibility by using the value of one field to determine the condition in the other, by specifying it as a string expression. Assuming you add your fields to some form assigned to variable formVar it should look something like this:

    RadioField1=hiCreateRadioField(

    ?name 'addMetal
    ?prompt "Add Metal"
    ?choices list("Yes" "No")
    ?value "Yes"
    )

    RadioField2=hiCreateRadioField(
    ?name 'metalLayer
    ?prompt "Metal layer"
    ?choices list("M1" "M2" "M3" "M4" "M5")
    ?value "M1"
    ?enabled "formVar~>RadioField1~>value == \"Yes\""
    ?editable "formVar~>RadioField1~>value == \"Yes\""
    )

    Regards,
    Petar

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • p94todorov
    p94todorov over 1 year ago

    You can toggle a field editability/visibility by using the value of one field to determine the condition in the other, by specifying it as a string expression. Assuming you add your fields to some form assigned to variable formVar it should look something like this:

    RadioField1=hiCreateRadioField(

    ?name 'addMetal
    ?prompt "Add Metal"
    ?choices list("Yes" "No")
    ?value "Yes"
    )

    RadioField2=hiCreateRadioField(
    ?name 'metalLayer
    ?prompt "Metal layer"
    ?choices list("M1" "M2" "M3" "M4" "M5")
    ?value "M1"
    ?enabled "formVar~>RadioField1~>value == \"Yes\""
    ?editable "formVar~>RadioField1~>value == \"Yes\""
    )

    Regards,
    Petar

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to p94todorov

    Sadly Petar's proposed approach won't work - there are two issues:

    1. There's no ?editable argument for radio fields
    2. ?enabled doesn't take a string (callback) expression - the value has to be t or nil (it's not like CDF, where the editable and display fields are callbacks).

    In the original post too, the value for the radio field wasn't one of the choices which wasn't correct.

    Anyway, this can be solved by a callback on the first radio field:

    RadioField1=hiCreateRadioField(
    ?name 'addMetal
    ?prompt "Add Metal"
    ?choices list("Yes" "No")
    ?value "Yes"
    ?callback list("MyForm->metalLayer->enabled=MyForm->addMetal->value==\"Yes\"")
    )
    
    RadioField2=hiCreateRadioField(
    ?name 'metalLayer
    ?prompt "Metal layer"
    ?choices list("M1" "M2" "M3" "M4" "M5")
    ?value "M1"
    ;?enabled "formVar~>RadioField1~>value == \"Yes\""
    ;?editable "formVar~>RadioField1~>value == \"Yes\""
    )
    
    hiCreateLayoutForm(
      'MyForm
      "My Form"
      hiCreateFormLayout(
        'layout
        ?items list(RadioField1 RadioField2)
      )
    )
    
    hiDisplayForm(MyForm)

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • swathiba24
    swathiba24 over 1 year ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for your feedback. 
    Is there a possibility to disable only selected radiofields ? 
    In the above example:
    When "Yes" is selected, we would like to disable "M1", "M3"
    When "No" is selected, we would like to disable "M2","M4","M5"

    • 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