JSF Loop

Salam. Mən jsf də bir table yaradiram, Bu table ın xanalarina inputText lər yerləşdirmək istəyirəm. Bunu dövrlə necə edə bilərəm? xhtml -in içərisində dövr işləmir

Verilmiş cavablar və yazılan şərhlər (9 cavab var)

Emil.Axmedov (2011-04-07 16:50:29)
[code] <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:c="http://java.sun.com/jsp/jstl/core"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Dynamic İnputs</title> </head> <body> <table> <tr> <c:forEach var="x" begin="1" end="9" step="1"> <td> <c:forEach var="y" begin="1" end="32" step="1"> <input type="text" name="s_${y}_${x}" /> </c:forEach> </td> </c:forEach> </tr> </table> </body> </html> [/code] Son variantda kod belə oldu. İşləyir.

admin (2011-04-07 16:45:56)
Həlli də yazın lütfən. Ki kimdə rast gəlsə cavabı tapa bilsin burdan.

nicat_behbudov (2011-04-07 14:22:32)
mənim sayəmdə :D

Emil.Axmedov (2011-04-07 14:19:26)
Duzeltdim. Çox sagolun)

Emil.Axmedov (2011-04-07 14:17:20)
Kodda belə bir düzəliş etdim, amma bu dəfə başqa səhv verir. Error Parsing /index.xhtml: Error Traced[line: 28] XML document structures must start and end within the same entity. [code] <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:c="http://java.sun.com/jsp/jstl/core"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Dynamic İnputs</title> </head> <body> <p:dataTable> <tr> <c:forEach var="x" begin="1" end="32" step="1"> <td> <c:forEach var="y" begin="1" end="9" step="1"> <input type="text" name="s_${x}_${y}" /> </c:forEach> </td> </c:forEach> </tr> </p:dataTable> </body> </html> [/code]

Emil.Axmedov (2011-04-07 14:13:01)
Mehmet, çox təşəkkürlər :)

Emil.Axmedov (2011-04-07 14:11:15)
[code] <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:c="http://java.sun.com/jsp/jstl/core"/> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Dynamic İnputs</title> </head> <body> <table border="1"> <tr> <c:forEach var="x" begin="1" end="32" step="1"> <td> <c:forEach var="y" begin="1" end="9" step="1"> <input type="text" name="s_${x}_${y}" /> </c:forEach> </td> </c:forEach> </tr> </table> </body> </html> [/code] Ramin muəllim, kodu belə yazdım, amma məndə belə bir səhv verir. Error Parsing /index.xhtml: Error Traced[line: 13] The markup in the document following the root element must be well-formed.Bunun səbəbi nədir?

Mehmet KILIC (2011-04-07 13:23:56)
KArdesim eger sorunu dogru anladiysam cevabi buyuk ihtimal bu : Zaten jsf kompanenti DataTable value'sine list biciminde alir ve donguye sokmus gibi olursun .. sadece cagirdigin method'tan List biciminde deger cekmen lazim outPutText kullandim ben oraya inputText'i de sorunsuz birsekilde kullanabilirsin [code] <h:dataTable value="#{personControl.persons}" var="person"> <h:column> <f:facet name="header"> <h:outputText value="Adi"/> </f:facet> <h:commandLink value="#{person.firstName}" action="#{personControl.linkDetailAction}"> <f:param name="personEmail" value="#{person.email}"/> </h:commandLink> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Last Name"/> </f:facet> <h:outputText value="#{person.lastName}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Email"/> </f:facet> <h:outputText value="#{person.email}"/> </h:column> </h:dataTable> [/code] Iyi Calismalar ;)

Ramin Orucov (2011-04-07 12:58:18)
JTSL forEach tag-i ilə aşağıdakı kimi yazmaq olar. [code] <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Dynamic İnputs</title> </head> <body> <table border="1"> <tr> <c:forEach var="x" begin="1" end="32" step="1"> <td> <c:forEach var="y" begin="1" end="9" step="1"> <input type="text" name="s_${x}_${y}" /> </c:forEach> </td> </c:forEach> </tr> </table> </body> </html> [/code]

Mövzu üzrə bənzər suallara da baxa bilərsiniz.

JSF də kömək lazımdır

Java JSF selectOneMenu

Spring MVC yoxsa JSF?

JSF Editable table rows