• 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 prompt error when one check box is missing

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 8845
  • 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 prompt error when one check box is missing

Drake96
Drake96 over 3 years ago
toggle_Entry=hiCreateToggleField(
  ?name 'toggle_Entry
  ?choices list(list('aa "test1") list('bb "test2") list('cc "test3"))
  ?value list(nil nil nil) 
  ?callback list("CCFupdatePathEnter(hiGetCurrentForm())")
)

procedure(CCFupdatePathEnter(form)
  let((listOfStrings)
    listOfStrings=
      setof(elem 
        foreach(mapcar (toggle data) form->toggle_Entry->value 
          list("1" "2" "3") toggle && data)
        elem
      )
    if(listOfStrings then
      form->path_enter->value=strcat("use " buildString(listOfStrings ","))
    else
      form->path_enter->value=""
    )
  )
)

path_enter=hiCreateStringField(
  ?name 'path_enter
; commented out so can see what is going on
;  ?invisible t  
)

hiCreateLayoutForm(
  'ForumForm
  "Forum test"
  hiCreateFormLayout(
    'lay
    ?items list(toggle_Entry path_enter)
  )
)
hiDisplayForm(ForumForm)

above code found from skill forum-

for above code it creates three check boxes 1 ,2 ,3 ...i want that when if check box 2,3 are checked or if all three are checked then it should not prompt any error...and if only box 3 is checked then it should throw error message to check box 2 and 3 together?
how to achieve that

drake

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    Not sure where you want this error message to appear or when. Presumably you'd put it in the form callback (it would get a bit annoying if it was on the toggle field callback). I would assume you'd just check the number of toggles which were enabled, or check for the specific combinations you wish to allow or disallow (your title doesn't really match the description of what you want).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Drake96
    Drake96 over 3 years ago in reply to Andrew Beckett

    Lemme clear you more. If i run above code- i get this forum, now

    in this i want ,when am selecting only test3 , it should throw error via dialog box that test3 cannot select alone, test2 and test3 both should be selected.
    How can we do that as u say Presumably you'd put it in the form callback (it would get a bit annoying if it was on the toggle field callback)

    drake

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to Drake96
    toggle_Entry=hiCreateToggleField(
      ?name 'toggle_Entry
      ?choices list(list('aa "test1") list('bb "test2") list('cc "test3"))
      ?value list(nil nil nil) 
      ?callback list("CCFupdatePathEnter(hiGetCurrentForm())")
    )
    
    procedure(CCFupdatePathEnter(form)
      let((listOfStrings)
        listOfStrings=
          setof(elem 
            foreach(mapcar (toggle data) form->toggle_Entry->value 
              list("1" "2" "3") toggle && data)
            elem
          )
        if(listOfStrings then
          form->path_enter->value=strcat("use " buildString(listOfStrings ","))
        else
          form->path_enter->value=""
        )
      )
    )
    
    procedure(CCFvalidateToggleFields(form)
      if(form->toggle_Entry->value=='(nil nil t) then
        hiDisplayAppDBox(
          ?name 'CCFbadToggles
          ?dboxBanner "Please take SKILL course"
          ?dboxText "Cannot select only test3"
          ?dialogType hicErrorDialog
          ?dialogStyle 'modal
        )
        hiSetCallbackStatus(form nil)
      else
        hiSetCallbackStatus(form t)
      )
    )
    
    path_enter=hiCreateStringField(
      ?name 'path_enter
    ; commented out so can see what is going on
    ;  ?invisible t  
    )
    
    hiCreateLayoutForm(
      'ForumForm
      "Forum test"
      hiCreateFormLayout(
        'lay
        ?items list(toggle_Entry path_enter)
      )
      ?callback 'CCFvalidateToggleFields
      ; allows the form callback to veto the unmapping of the form
      ?unmapAfterCB t
    )
    hiDisplayForm(ForumForm)
    
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Drake96
    Drake96 over 3 years ago in reply to Andrew Beckett

    Thanks Andrew,
    I have enroll for skill training started learning :))

    • 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