This content has been marked as final.
Show 2 replies
-
1. Re: Dynamically generate form elements
villo Apr 28, 2006 9:46 AM (in response to villo)Ok, I have been trying the jstl way...
Nevertheless I have been running into the following problem:
In my jsp I have<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> ... <h:dataTable var="question" value="#{section.questions}"> <h:column> <h:outputText value="#{question.text}"/><br> <c:choose> <c:when test="${question.radio}"> <h:selectOneRadio value="#{register.selection[question]}" required="true" layout="pageDirection"> <f:selectItems value="#{question.answerTypes}"/> </h:selectOneRadio> </c:when> <c:otherwise> <h:outputText value="#{question.type}"/> </c:otherwise> </c:choose> </h:column> </h:dataTable>
and actually question.isRadio() returns true.
The problem is that it always takes the otherwise branch. I don't really understand what's the problem, it's almost the same that the dvd example does (same libraries as well).
Can it be of me using jsps instead of facelets? Is it supposed to matter anyway?
Thanks for any hint on this! -
2. Re: Dynamically generate form elements
gavin.king Apr 28, 2006 11:32 AM (in response to villo)Mixing JSTL with JSF in JSP usually does not work very well. Seriously consider using facelets instead.
BTW, this might be a good case for a JSF custom component.