uirepeat

PrimeFaces p:accordionPanel inside ui:repeat or c:forEach

浪子不回头ぞ 提交于 2019-12-08 09:39:12
问题 I'm trying to create multiple accordionPanel s. I tried to include this tag inside repeat elements (e.g. c:forEach ). The accordionPanel is well rendered, but I'm unable to switch from one tab to another. These are some codes I tried: <ui:repeat value="#{myBackingBean.myList}" var="o"> <p:accordionPanel dynamic="true" cache="true" multiple="true" widgetVar="accordion"> <p:tab title="Title 1"> #{o.data_one} </p:tab> <p:tab title="Title 2"> #{o.data_two} </p:tab> </p:accordionPanel> </ui:repeat

ui:repeat - adding / removing elements from list does not work properly

拈花ヽ惹草 提交于 2019-12-08 09:00:30
问题 I have following code in my .xhtml file <h:form id="registration3Form"> <h:panelGroup id="terms_outer_panel"> <h:commandLink styleClass="item-7" action="#{registerBusinessWizardController.addCourse}" value="#{msgBundle['registerThirdPage.panel.addSchedule']}"> </h:commandLink> <ui:repeat value="#{registerBusinessWizardController.courses}" var="course"> <h:panelGroup id="terms_inner_panel"> <div class="term"> <h:inputText id="price" styleClass="item-2" value="#{course.price}" /> <h:inputText

Validate if list in <ui:repeat><h:inputText> has at least one non-empty/null value

一曲冷凌霜 提交于 2019-12-08 06:13:58
问题 I've a List<String> in my model: private List<String> list; // Add to list: "d","e","f","a","u","l","t" // Getter. I'm presenting it in the view as below: <ui:repeat value="#{bean.list}" varStatus="loop"> <h:inputText value="#{bean.list[loop.index]}"/> </ui:repeat> This works fine. Now I'd like to validate if the list contains at least one non-empty/null item. How can I create a custom validator for this? 回答1: This isn't easily possible with a custom validator. There's namely physically only

Checkbox inside ui:repeat not refreshed by Ajax

雨燕双飞 提交于 2019-12-08 01:26:17
问题 I work with Mojarra 2.1.3. When the user click on button "refresh don't work", it refresh the content of the ui:repeat.I expect the checkbox to be checked, just as at the initialization. What I've found: If I remove h:head in the facelet "refresh don't work" works... Any idea ? The facelet: <h:head></h:head> <h:body> <h:form id="myForm" > <h:panelGroup id="panelToRefreshOutsideRepeat"> <ui:repeat value="#{sandbox.columns}" var="column"> <h:panelGroup id="panelToRefreshInsideRepeat"> <h2

f:ajax in ui:repeat renders h:outputText but fails to render/update h:inputText

风格不统一 提交于 2019-12-07 12:57:40
问题 I have a problem with <f:ajax> on a <h:inputText> inside <ui:repeat> . It successfully renders a <h:outputText> with the new value, but not a <h:inputText> (both are bound to the same property). However, if I change the <f:ajax> to render @form or @all , it works. But I obviously don't want/need to render the whole form. I'm using Mojarra 2.2.4. Here's the index.xhtml <h:form> <table> <ui:repeat var="line" value="#{myBean.lines}"> <tr> <td> <h:inputText value="#{line.number}"> <f:ajax event=

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

限于喜欢 提交于 2019-12-06 21:01:28
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, pizza ID, available sizes (displayed as radio buttons) and a list of possible quantities are displayed.

Validate if list in <ui:repeat><h:inputText> has at least one non-empty/null value

蓝咒 提交于 2019-12-06 15:05:29
I've a List<String> in my model: private List<String> list; // Add to list: "d","e","f","a","u","l","t" // Getter. I'm presenting it in the view as below: <ui:repeat value="#{bean.list}" varStatus="loop"> <h:inputText value="#{bean.list[loop.index]}"/> </ui:repeat> This works fine. Now I'd like to validate if the list contains at least one non-empty/null item. How can I create a custom validator for this? BalusC This isn't easily possible with a custom validator. There's namely physically only one input component whose state changes with every iteration round. Your best bet is to hook on

h:inputText inside ui:repeater displays wrong value after an ajax update

你离开我真会死。 提交于 2019-12-06 11:07:45
问题 I've got a JSF page with a ui:repeater tag that simply displays a list of strings and some controls to add a string to a list. When adding a string I use ajax to update the repeater tag and have the new string be shown immediately without the page refresh. Here's how my page looks like: <h:body> <h:form> <p:inputText id="name" value="#{testController.newString}"/> <p:commandButton value="Add" actionListener="#{testController.addString}" update="strings" /> </h:form> <h:panelGroup id="strings"

UISelectMany in ui:repeat causes java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.util.List

萝らか妹 提交于 2019-12-05 18:50:11
I have used the HashMap method for binding a list of checkboxes to a Map<String, Boolean> with success. This is nice since it allows you to have a dynamic number of checkboxes. I'm trying to extend that to a variable length list of selectManyMenu . Being that they are selectMany, I'd like to be able to bind to a Map<String, List<MyObject>> . I have a single example working where I can bind a single selectManyMenu to a List<MyObject> and everything works fine, but whey I put a dynamic number of selectManyMenus inside a ui:repeat and attempt to bind to the map, I end up with weird results. The

h:inputText inside ui:repeater displays wrong value after an ajax update

二次信任 提交于 2019-12-04 15:23:42
I've got a JSF page with a ui:repeater tag that simply displays a list of strings and some controls to add a string to a list. When adding a string I use ajax to update the repeater tag and have the new string be shown immediately without the page refresh. Here's how my page looks like: <h:body> <h:form> <p:inputText id="name" value="#{testController.newString}"/> <p:commandButton value="Add" actionListener="#{testController.addString}" update="strings" /> </h:form> <h:panelGroup id="strings"> <ui:repeat var="str" value="#{stringModel.strings}" varStatus="stringData"> <div> <h:outputText value