Hi, I have problem on the radio button. The AddField and DeleteField doesn't work when I create multiple RadioField.
Anyone can help? The code work well for single RaioField.
procedure(Form()
let((libName LayerRadio ViaRadio sep1 sep2)
libName=hiCreateStringField(
?name 'libName
?prompt "Library Name"
?callback "ddsUpdateSyncWithForm()"
)
sep1=hiCreateSeparatorField(?name 'sep1)
LayerRadio=hiCreateRadioField(
?name 'layerradio
?prompt "Layer Options"
?choices list("Copy" "Replace" "Remove" "none")
?value "none"
?defValue "none"
?callback list("oferLayerRadioButtonCB()")
)
sep2=hiCreateSeparatorField(?name 'sep2)
ViaRadio=hiCreateRadioField(
?name 'viaradio
?prompt "Via Options"
?choices list("Copy" "Replace" "Remove" "none")
?value "none"
?defValue "none"
?callback list("oferViaRadioButtonCB()")
)
hiCreateAppForm(
?name 'oferExampleForm
?formTitle "Ofer's example form"
?callback 'oferExampleForm
?fields list(libName sep1 LayerRadio sep2 ViaRadio)
)
); let
); procedure Form
procedure(oferLayerRadioButtonCB()
oldLayer=hiCreateStringField(
?name 'oldLayer
?prompt "old Layer"
)
newLayer=hiCreateStringField(
?name 'newLayer
?prompt "new Layer"
)
oferExampleForm->extraFields=list(nil 'oldLayer oldLayer
'newLayer newLayer)
oferExampleForm
let( (radioVal)
radioVal=oferExampleForm->LayerRadio->value
when(radioVal=="none" && oferExampleForm->oldLayer
hiDeleteField(oferExampleForm 'oldLayer))
when(radioVal=="Remove" && oferExampleForm->newLayer
hiDeleteField(oferExampleForm 'newLayer))
when(radioVal=="Copy" || radioVal=="Replace" || radioVal=="Remove"
unless(oferExampleForm->oldLayer
hiAddField(oferExampleForm oldLayer)))
when(radioVal=="Copy" || radioVal=="Replace"
unless(oferExampleForm->newLayer
hiAddField(oferExampleForm newLayer)))
)); procedure oferLayerRadioButtonCB
procedure(oferViaRadioButtonCB()
oldVia=hiCreateStringField(
?name 'oldLayer
?prompt "old Via"
)
newVia=hiCreateStringField(
?name 'newLayer
?prompt "new Via"
)
oferExampleForm->extraFields=list(nil 'oldVia oldVia
'newVia newVia)
oferExampleForm
let( (viaradioVal)
viaradioVal=oferExampleForm->ViaRadio->value
when(viaradioVal=="none" && oferExampleForm->oldVia
hiDeleteField(oferExampleForm 'oldVia))
when(viaradioVal=="Remove" && oferExampleForm->newVia
hiDeleteField(oferExampleForm 'newVia))
when(viaradioVal=="Copy" || viaradioVal=="Replace" || viaradioVal=="Remove"
unless(oferExampleForm->oldVia
hiAddField(oferExampleForm oldVia)))
when(viaradioVal=="Copy" || viaradioVal=="Replace"
unless(oferExampleForm->newVia
hiAddField(oferExampleForm newVia)))
)); procedure oferViaRadioButtonCB
procedure(BEOL()
unless(boundp('oferExampleForm)
Form()
)
hiDisplayForm(oferExampleForm)
)