uirepeat

How to use <h:selectBooleanCheckbox> in <h:dataTable> or <ui:repeat> to select multiple items?

拜拜、爱过 提交于 2019-12-17 02:22:34
问题 I have a Facelets page with a <h:dataTable> . In each row there is a <h:selectBooleanCheckbox> . If the checkbox is selected the object behind the corresponding row should be set in the bean. How do I do this? How to get the selected rows or their data in a backing bean? Or would it be better to do it with <h:selectManyCheckbox> ? 回答1: Your best bet is to bind the h:selectBooleanCheckbox value with a Map<RowId, Boolean> property where RowId represents the type of the row identifier. Let's

Display database blob images in <p:graphicImage> inside <ui:repeat>

北城以北 提交于 2019-12-17 02:22:22
问题 I'm using PrimeFaces 3.2 on JBoss 7.1.1. I am trying to display an image which is stored in a BLOB in a MySQL database in <ui:repeat> . The image is stored in a byte[] and then converted to a StreamedContent as follows: InputStream stream = new ByteArrayInputStream(ingredient.getImage()); ingredient.setJsfImage(new DefaultStreamedContent(stream, "image/jpg")); Then I am trying to display it in a Facelet as follows: <ui:repeat var="ingredient" value="#{formBean.ingredientResultSet}"> <p:panel

ui:repeat in o:tree not working as expected

拈花ヽ惹草 提交于 2019-12-13 18:28:43
问题 I'm using a omnifaces o:tree of "branches" where each branch has a "list of leafs" with the attribute "color" which should be editable in the tree. - branch 0 - leaf 0 (color = "green") - leaf 1 (color = "yellow") - branch 1 - leaf 0 (color = "purple") - branch 1_0 - leaf 1 (color = "red") - leaf 2 (color = "orange") - leaf 3 (color = "brown") Adding/removing branches and adding leafs to any branch works fine and as expected. Also the rendering of any complex tree including all the list of

input binding in ui:repeat in jsf

心不动则不痛 提交于 2019-12-12 13:17:53
问题 i am using facelets jsf 2.0 with primefaces 3.0.M2 component library. i am trying to achieve dynamic numbers of rows including iput fields that are filled when a datatable selection occurs. whenever a selection is made the dynamic rows generated correctly with input fields but after the first selection for following selections dynamic row count changes correctly but the input fields does not update and keeps showing inputs from the first selection. here is how i iterate list in facelet; <ui

Valuechange Listener inside ui:repeat only works for the last repeated component [duplicate]

我们两清 提交于 2019-12-12 05:39:08
问题 This question already has an answer here : <h:form> within <ui:repeat> not entirely working, only the last <h:form> is processed (1 answer) Closed 4 years ago . I'm using JSF and Glassfish. I have in a ui:repeat several h:inputtextarea where I have a valuechange Listener. The problem is that the valuechangelistener only fires for the last component. here is my code. The answerhandler return a list of Answerentities (JPA) which define the content. The answerhandler itself is a ManagedBean

ui:repeat in o:treeNodeItem

北战南征 提交于 2019-12-12 04:34:10
问题 I have an <o:tree> where i am displaying list of persons and each person what it has children and every child what it have children where the level of children is not known The data is displayed correctly but the displayed node is an <h:commandLink> where its action is a java bean function Snippet of java code : public class PersonController{ //class Person having List of children //some code public void readChild(double childId){ } //some code } Snippet of jsf code : <o:tree> <o:treeNodeItem

Jsf ui:repeat size doesn't gets java bean value

核能气质少年 提交于 2019-12-11 10:42:03
问题 JSF 2.0's ui:repeat tag gets the value of java bean(arraylist) as it's value property but size property doesn't. I am using the ui repeat inside of a datatable which shows statuses iteratively and ui repeat shows comments for each status. I am giving the size property of ui repeat from a java class because each status has a different number of comments. Therefore size should be decided dynamically. Here is the summary of what i've done. Model classes: @ManagedBean @RequestScoped public class

Use ui:repeat with b:carousel?

烂漫一生 提交于 2019-12-11 00:09:50
问题 Environment: I'm working with JSF2.2, Bootsfaces 0.9.1, Primefaces 6.0, JEE7 and Hibernate 5.2 in combination with MySQL 5.7 DB. What I have: I've got a model which has a set of images. The set contains instances of my custom Image class which holds values for the Image like a title, description and the filename. The images are stored on the filesystem and I got the MySQL DB for storing the models. I tried to display images on a view in my webapp and everything works fine. I also displayed

ViewScoped CDI bean recreated after some AJAX requests

假如想象 提交于 2019-12-10 11:56:21
问题 I have a CDI ViewScoped bean and a JSF page. After a couple of AJAX requests the bean somehow recreated. Here is the full code of the application: index.xhtml <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://xmlns.jcp.org/jsf/facelets"> <h:head> <title>Facelet Title</title> </h:head> <h:body> Hello from Facelets <h:form> <h:inputText value="#{questionBean.newTag}"></h:inputText> <h:commandButton value=

JSF ui:repeat vs h:dataTable

微笑、不失礼 提交于 2019-12-09 00:54:02
问题 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