You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "vasiliy.kiryanov" <go...@mail.ru> on 2006/06/08 09:33:04 UTC
ids generating for elements
Good afternoon, devs.
I have asked that question on user forum but noone can suggest something.
I have too many inputText elements. Therefore I generate ids for it.
But I can't find right way.
If i use:
<%for(int i=0; i<PriceBackBean.numberGraduations; i++) {%>
<tr>
<td
class="Nkrs"><%=(String)PriceBackBean.graduationsNames.get(i)%></td>
<%for(int j=0; j<=9; j++) {
out.println("<td class=\"NCell\"><t:inputText id=\"FE_"+i+"_"+j+"\"
styleClass=\"inputNCell\"/></td>");
}%>
</tr>
<%}%>
jsf pass to web-tier t:inputText so it can be parsed by browser like normal
HTML input tag.
If I use
<%for(int i=0;
i<PriceBackBean.numberGraduations; i++) {%>
<tr>
<td
class="Nkrs"><%=(String)PriceBackBean.graduationsNames.get(i)%></td>
<%for(int j=0; j<=9; j++) {%>
<td
class="NCell"><t:inputText id="FE_<%=i%>_<%=j%>" styleClass="inputNCell"/>
<%}%>
</tr>
<%}%>
then I get:
javax.servlet.ServletException: Exception in JSP: /price.jsp:87
84: <tr>
85: <td class="Nkrs"><%=(String)PriceBackBean.graduationsNames.get(i)%></td>
86: <%for(int j=0; j<=9; j++) {%>
87: <td class="NCell"><t:inputText id="FE_<%=i%>_<%=j%>"
styleClass="inputNCell"/>
88: <%}%>
89: </tr>
90: <%}%>
Stacktrace:
javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
therefore now i mix jsf code and simple html INPUT tag with generated ids.
does anybody can suggest something near a jsf way?
thank you.. for you time
--
View this message in context: http://www.nabble.com/ids-generating-for--elements-t1753473.html#a4767479
Sent from the My Faces - Dev forum at Nabble.com.