I am writing an application with Java EE using JSF 1.2 and the Seam framework. I have a form which takes input from radio button like this:
<h:selectOneRadio value="#{testAction.selectedOptionId}"
id="selectedQuestionOption"
layout="pageDirection">
<s:selectItems var="selectedOption" value="#{currentQuestion.options}"
label="#{selectedOption.optionString}"
itemValue="#{selectedOption.optionId}"/>
</h:selectOneRadio>
<h:commandButton id="goToNextQuestion" value="Submit"
action="#{testAction.postAnswer}"/>
I want that, I would accept the result if anyone submits the form without selecting a radio button, but it does not work. Because in the validation phase jsf rejects the submission and results in a validation error. I tried to write a custom validator for it, unfortunately that also did not worked for me.
Any suggestion?