Since you are using a radio group anyway you'll only be able to select a single entry from the list of employees. Now, if you use a form
element to wrap the controls, your action anchors could simply trigger a submit of the form:
formName := 'employee-form'.
html form
name: formName;
with: [
html unorderedList: [
group := html radioGroup.
self employeeNames do: [ :eachEmp |
html listItem: [
group radioButton
selected: nil "<set tmpVar = empKey>";
callback: [ :value | self "<dependent on button pushed>" ];
with: eachEmp ] ] ] ].
html anchor
submitFormNamed: formName;
callback: [ :value | self handleDelete ]
with: 'delete'
The callback of the anchor will be evaluated after all of the callbacks of the form elements.
Side note: notice the use of with:
to set the anchor and radio button texts. You should almost always use with:
as the last message to html
.