I noticed that the <g:radioGroup/>
of grails does not tab index to other values. ex. if my radio group has two values like True and False. When user tabs using keyboard, it only highlights the True and stops, not highlighting False. So there is no way user can choose the other option using keyboad. How can I put tabindex for the second option? We have our own radio group, can anyone modify this for the tab index to be implemented on all values? thanks!
def myRadioGroup = {attrs ->
attrs.values.eachWithIndex { obj, i ->
out << "${attrs.labels[i]} "
out << "<input type='radio' name='${attrs.name}' value='${obj}'"
if(obj.equals (attrs.value)){
out << " checked='checked' "
}
if(attrs.function){
out << " ${attrs.function}"
}
if(attrs.disabled != null){
out << " disabled='disabled' "
}
out << " /> "
}
}
I tried adding this, but did not help. it still won't tab to the next option.
if(attrs.tabIndex != null){
out << " tabIndex='${i}' "
}
Although I haven't found any source to back this up, you can't tab to multiple radios in the same group (aka the same name). You can tab to the first one and then can use arrow keys, but not multiple tabs.
This isn't a problem of generating the HTML correctly, but a limitation of HTML.