grails checking first radio button

220 Views Asked by At

I've created a <g:each in my gsp nested with the following radio button.

<input type="radio" value="${productQuantityInstance?.quantity}" 
    name="quantity" id="quantity_${productQuantityInstance?.quantity}" 
    ${productInstance?.productQuantities.toArray()[0].quantity.equals(productQuantityInstance?.quantity) ? 'checked="checked"' : ''}> 

I'm wondering if this is the best way to go about selecting the first radio button?

I'm aware of the grails radioGroup, but it won't work for me in my application.

0

There are 0 best solutions below