uirepeat

Primefaces :radioButton inside a ui:repeat

扶醉桌前 提交于 2019-12-24 00:15:20
问题 This is my xhtml 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:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui"> <h:head> <title>Custom Radio Test</title> </h:head> <h:body> <h:form id="mF" > <p:selectOneRadio id=

Using dynamic ui:include inside ui:repeat results in NullPointerException

前提是你 提交于 2019-12-23 03:39:13
问题 I want to create dynamic dialog windows by using <ui:repeat> and <p:dialog> with <ui:include> . But there's an exception when I tried like below. main.xhtml <p:outputPanel id="windowsPanel" layout="block" style="width:100%;"> <p:outputPanel rendered="#{mainView.dynamicWindows ne null}"> <ui:repeat var="item" value="#{mainView.dynamicWindows}"> <p:dialog binding="#{item.dialog}"> <ui:include src="#{item.includedWindowPath}" /> </p:dialog> </ui:repeat> </p:outputPanel> </p:outputPanel> MainView

JSF & ui:repeat - issue with adding an object to cart

我怕爱的太早我们不能终老 提交于 2019-12-23 01:06:15
问题 Once again I need some help with my pizza-search-programm I have written with Java Server Faces. The program: A user can search for pizzas by entering a form. A filtered search is possible as the user can decide whether he searches for a pizza name, a pizza id or other specified criteria. The program will generate a SQL query which returns pizza objects and stores it into a list of objects. A JSF page displays the list of pizza objects by iterating them through a ui:repeat tag. Pizza name,

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

爷,独闯天下 提交于 2019-12-20 09:47:09
问题 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="#

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

扶醉桌前 提交于 2019-12-20 01:41:39
问题 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

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

♀尐吖头ヾ 提交于 2019-12-20 01:41:39
问题 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

Dynamically added input field in ui:repeat is not processed during form submit

ε祈祈猫儿з 提交于 2019-12-18 09:08:37
问题 I am trying to make a input form for answers in my application and I start with four "empty" answers which the view loops over and make input fields for. I have an add answer button which I add one question to the array of answers and then the view render the answers again, but now with an additional input field. The backing bean is viewscoped. However if I submit the form without pressing the add answer button it all works. The data is saved in the database. But if I add an answer after the

How to iterate a HashMap with primefaces selectable datatable

拜拜、爱过 提交于 2019-12-18 08:57:00
问题 I have tried different solutions but none is working in my case. I want all the rows in this datatable to be selectable. The problem seems to be the <ui:repeat that is probably overriding the objects... My bean: @ManagedBean @ViewScoped public class Chat { private static Map<String, List<ChatObject>> chat = new LinkedHashMap<String, List<ChatObject>>(); private ChatObject selectedChatObject; public void onChatRowSelection(){ if(getSelectedChatObject() != null){ System.out.println("test"); } }

How to address a component inside a looping naming container

。_饼干妹妹 提交于 2019-12-18 07:06:12
问题 I have the following structure (contents and attributes omitted): <ui:repeat id="outerlist"> <my:compositeComponent id="myCC"> <h:panelgroup id="container"> Some content here (outputText, etc.) <ui:repeat id="innerlist"> <h:commandButton> <f:ajax render=":#{cc.clientId}:container" /> <!-- all closing tags accordingly --> As the content inside the container depends on the action of the innerlist's button, I need to update it. The approach as shown above works, when there is no outer ui:repeat

How to show hashmap values in jsf?

最后都变了- 提交于 2019-12-18 02:47:48
问题 I have bean "MyBean", which has property HashMap - "map" which values type is MyClass. I want to show some properties of map in jsf using ui:repeat. But these code: <ui:repeat var="var" value="#{mybean.map}" > <tr> <td> <h:outputText value="#{var.value.property1}"></h:outputText> </td> <td><h:outputText value="#{var.value.property2}"></h:outputText></td> </tr> </ui:repeat> But this code didn't show anything. Though when I try to show hashmap values in jsp this way, it was succesfull. Where I