uirepeat

How to repeat output of text via simple for loop in Facelets without model?

天涯浪子 提交于 2019-12-03 02:23:43
问题 How to repeat output of some content in JSF using only standard tags (ui:, h: etc) ? In other words - how to do equivalent to PHP code below in JSF ? I immediately wanted to take advantage of ui:repeat , but it needs collection - I have only number. for ($i = 0; $i < 10; $i++) { echo "<div>content</div>"; } 回答1: Either use <c:forEach> instead (true, mixing JSTL with JSF is sometimes frowned upon, but this should not harm in your particular case because you seem to want to create the view

How to save an array in JSF with ui:repeat + h:inputText + managed bean?

我与影子孤独终老i 提交于 2019-12-03 00:51:34
In a postgres database I have a table with, among others, an int[] field. In my model I have a persisted bean that maps the table, including the int[] field. In this class I have implemented all the needed setters/getters. Now, I have a managed bean which plays also the controller role, and links to the model bean. So, in my xhtml I'm trying to do this: <ui:repeat value="#{drawsetController.selected.editableBaseSetList}" var="baseNumber"> <h:inputText value="#{baseNumber}"/> </ui:repeat> baseSetList is the int[] array. The problem is that when I submit my form only this element is not updated.

How to re-render <ui:repeat> using <f:ajax render>

我的未来我决定 提交于 2019-12-02 19:36:35
I have implemented a list created by a repeater: <ui:repeat value="#{projectData.paginator.list}" var="project"> <h:outputText value="#{project.title}" /> </ui:repeat> and a Button that filters my list: <h:commandLink action="#{overviewController.filterNew}"> <h:outputText value="Filter List" /> </h:commandLink> So, is there an easy way to render only my repeater after clicking the command link (with AJAX) :-) I tried following: <f:ajax render="repeater"> ui:repeat id="repeater" value="#{projectData.paginator.list}" var="project"> <h:outputText value="#{project.title}" /> </ui:repeat> <f:ajax

How to repeat output of text via simple for loop in Facelets without model?

风流意气都作罢 提交于 2019-12-02 15:53:06
How to repeat output of some content in JSF using only standard tags (ui:, h: etc) ? In other words - how to do equivalent to PHP code below in JSF ? I immediately wanted to take advantage of ui:repeat , but it needs collection - I have only number. for ($i = 0; $i < 10; $i++) { echo "<div>content</div>"; } Either use <c:forEach> instead (true, mixing JSTL with JSF is sometimes frowned upon, but this should not harm in your particular case because you seem to want to create the view "statically"; it does not depend on any dynamic variables): xmlns:c="http://java.sun.com/jsp/jstl/core" ... <c

How do I attach a FacesMessage from the backing bean to a specific field in a ui:repeat?

家住魔仙堡 提交于 2019-12-01 20:56:13
I have a form with a variable number of input elements, like this: <ui:repeat var="_lang" value="#{myBean.languages}"> <h:inputTextarea value="${_lang.title}" id="theTitle" /> <h:messages for="theTitle"/> </ui:repeat> When a certain method in the backing bean is triggered, I want to add a message to, say, the second iteration of the ui:repeat , but not the other ones. I've seen different variations of this question around here , and all problems appear to be due to the ui:repeat 's iterations not being available in the JSF component tree. What I have tried so far: Bind the h:inputTextarea s to

<h:inputText> doesn't seem to work within <ui:repeat>, only the last entry is submitted

拈花ヽ惹草 提交于 2019-12-01 11:31:08
I have an <ui:repeat> with <ui:inputText> : <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" template="./templates/masterLayout.xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core"> <ui:define name="content"> <ui:repeat value="#{genproducts.dbList()}" var="itemsBuying"> <div class="indproduct"> <p class="center">#{itemsBuying.name}</p> <div class="center"> <h:form style="margin-left: auto; margin-right: auto;"> <h:inputText value="#

<h:inputText> doesn't seem to work within <ui:repeat>, only the last entry is submitted

半腔热情 提交于 2019-12-01 08:27:43
问题 I have an <ui:repeat> with <ui:inputText> : <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" template="./templates/masterLayout.xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core"> <ui:define name="content"> <ui:repeat value="#{genproducts.dbList()}" var="itemsBuying"> <div class="indproduct"> <p class="center">#{itemsBuying.name}</p>

JSF ui:repeat included by ui:include wrapped in h:panelGroup with conditional rendering… A mouthfull

久未见 提交于 2019-12-01 08:27:10
Original question is below, but as I have come up with a more minimal example to demonstrate this problem, and figured it should go at the top. Anyway, it appears that ui:repeat tags are processed before checking to see if parent elements are actually rendered. To recreate this, here is the facelet (minimalTest.xhtml): <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <h:head> <title>Test JSF <ui:repeat> inside <h:panelGroup rendered="false"></title> </h:head> <h:body> <h:form>

JSF ui:repeat included by ui:include wrapped in h:panelGroup with conditional rendering… A mouthfull

天涯浪子 提交于 2019-12-01 06:22:27
问题 Original question is below, but as I have come up with a more minimal example to demonstrate this problem, and figured it should go at the top. Anyway, it appears that ui:repeat tags are processed before checking to see if parent elements are actually rendered. To recreate this, here is the facelet (minimalTest.xhtml): <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <h:head>

JSF ui:repeat vs h:dataTable

孤街醉人 提交于 2019-11-30 21:53:43
Before asking this question, I visited many other related ones and tried to gather the maximum of information. But, what I found till now let me understand that there is no real/major difference between ui:repeat and h:dataTable , and that whenever we can use h:dataTable we can also use ui:repeat (sometimes one of them is a little complex than the other, but at the end we got same results). So, is there any use cases where the only choice is to use h:dataTable ? or the opposite (only choice is ui:repeat )? is there any use cases where the only choice is to use h:dataTable? If you want to use