uirepeat

How to collect submitted values of a List<T> in JSF?

爱⌒轻易说出口 提交于 2020-05-23 17:33:43
问题 I have a bean with a List<T> : @Named @ViewScoped public class Bean { private List<Item> items; private String value; @Inject private ItemService itemService; @PostConstruct public void init() { items = itemService.list(); } public void submit() { System.out.println("Submitted value: " + value); } public List<Item> getItems() { return items; } } And I'd like to edit the value property of every item: <h:form> <ui:repeat value="#{bean.items}" var="item"> <h:inputText value="#{bean.value}" /> <

Using EL variable of <c:set> inside Facelets <ui:repeat> tags

China☆狼群 提交于 2020-05-11 08:23:07
问题 I have a Home . Each Home has a list of Room s. Each Room has zero or more Person s. I would like to count total persons of each home. But I can't add a new variable to record person count in any backing beans or entity. So I'd like to count it in the view only via <c:set> . My first attempt look like: <c:set var="personCount" value="${0}" /> <ui:repeat var="home" value="#{mybackingBean.homes}"> <ui:repeat var="room" value="#{home.rooms}"> ${personCount += room.persons.size()} </ui:repeat> <h

Setting a validator attribute using EL based on ui:repeat var

China☆狼群 提交于 2020-01-28 01:55:24
问题 I am looking for a little bit of guidance today with the issue I am running into. What I am trying to accomplish is build a page on the fly with validation and all. The end result is to allow the user to configure the fields on the page through administrative functions. Below is a copy of the code that I am using as the test page where I loop through the "Configured" fields and write out the fields using the defined criteria. <ui:repeat var="field" value="#{eventMgmt.eventFields}" varStatus=

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

孤者浪人 提交于 2020-01-22 08:15:48
问题 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>

Is it ok to use a ui:repeat inside a ui:include

允我心安 提交于 2020-01-06 15:18:18
问题 We all know the difference between build time and render time. It is definitely not a great idea to put a <ui:include> tag (build time) inside a <ui:repeat> (render time), but is the opposite okay to do? Can we use <ui:repeat> inside a <ui:include> ? 回答1: Both ways are OK. It is definitely not a great idea to put a <ui:include> tag (build time) inside a <ui:repeat> (render time) This is not true. You can safely do so. The only limitation is that you can't use the var of <ui:repeat> inside src

JSF ui:repeat in ui:repeat with dynamically assigned var-value

限于喜欢 提交于 2020-01-06 01:33:08
问题 We created a JSF table component for our projects which uses <ui:repeat> to create the table. A new requirement to add a table inside a table (the second table resides in a row and is collapsable) has gotten us into trouble as the <ui:repeat var="row" ...> is set statically inside the table componenten and the inner table uses the row variable of the outer table when iterating through the list. Now what i want to create is something like this: <div> <myfw:mytable dataModel="#{bean.user}"

Expose items of a list while iterating within composite component

浪子不回头ぞ 提交于 2020-01-05 20:23:30
问题 I'm iterating over a list of items in composite component. I want to expose each item of the list so that they could be used within the child component of this composite component, to create a template for how to display all items in the list. Here is my Composite Component implementation: customList.xhtml <ui:component xmlns="http://www.w3.org/1999/xhtml" xmlns:cc="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"> <cc:interface> </cc:interface> <cc

Expose items of a list while iterating within composite component

China☆狼群 提交于 2020-01-05 20:23:19
问题 I'm iterating over a list of items in composite component. I want to expose each item of the list so that they could be used within the child component of this composite component, to create a template for how to display all items in the list. Here is my Composite Component implementation: customList.xhtml <ui:component xmlns="http://www.w3.org/1999/xhtml" xmlns:cc="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"> <cc:interface> </cc:interface> <cc

Components are with the same id inside ui:repeat

假装没事ソ 提交于 2019-12-29 07:53:04
问题 Unfortunately, primefaces accordionPanel doesn't works well in version 2.2.1 if you are trying to create tabs dynamically. This is my case, I need to create accordions if the user clicks an add icon, and remove if he clicks on x icon. No problem, I've created my own composite component, like you can see here: <c:interface> <c:attribute name="titulo" default="" required="false" /> <c:attribute name="renderizar" default="true" required="false" /> <c:attribute name="width" required="false"

f:ajax inside ui:repeat

蓝咒 提交于 2019-12-24 22:44:03
问题 I need to show a list of auction items. When a user clicks on a Bid button next to each item, I'd like to have ajax open a bid form right under this auction item. So I'm going with a ui:repeat and a f:ajax as shown below, but when I go to the page all the auction items have the bid component open next to them. And clicking any of the buttons doesn't do anything. This is the code (with the bid form simplified to just an outputText: ) <h:form> <table border="1"> <ui:repeat var="parcel"