backing-beans

Passing form input values as a List of objects from a JSP page to a Servlet

依然范特西╮ 提交于 2020-01-04 15:14:35
问题 Here is a simplified (NOT real world) example. Suppose there is a domain model - a class Movie , which has a List of actors. A class Actor has three fields ( name , birthDate , rolesNumber ). The following code is an illustration of this scenario: Movie.java public class Movie { // some fields private List<Actor> actors; // getters and setters } Actor.java public class Actor { private String name; private Date birthDate; private int rolesNumber; // getters and setters } There is also a JSP

JSF property transfer from backing bean A to backing bean B

只谈情不闲聊 提交于 2019-12-23 17:25:03
问题 I'm getting deeper into JSF 2.0 at the moment and lacking a bit of understanding about the "transport" of managed bean properties from one view to the other. I searched a bit but haven't found a really good example, so if anyone could point me to a tutorial or explain the things a little bit I'd really grateful. So here is my scenario: I'm developing a small playground calendar application. The first view select.xhtml contains the calendar selector, where the user can pick a specific date:

Passing value to the backing bean with PrimeFaces file upload

北慕城南 提交于 2019-12-23 03:29:34
问题 I am trying to upload the file and pass one parameter from select box with PrimeFaces 3.5. This is my form: <h:form id="idAssessmentsUploadForm" enctype="multipart/form-data"> <h:panelGrid cellspacing="10" styleClass="standard-panel" columns="2" id="idAssessmentsUploadPanelGrid"> <h:outputText value="#{msg['application.assessmentsUploadRequest.loader']}"/> <p:selectOneMenu id="idLoader" style="width: 230px;" required="true" value="#{configurationBean.loaderName}"> <f:selectItems 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

Making Distinctions Between Different Kinds of JSF Managed-Beans

我是研究僧i 提交于 2019-12-17 02:54:11
问题 I recently read this article from Neil Griffin Making Distinctions Between Different Kinds of JSF Managed-Beans and it got me thinking about the distinction between different beans in my own application. To quickly summarise the gist: Model Managed-Bean: This type of managed-bean participates in the "Model" concern of the MVC design pattern. When you see the word "model" -- think DATA. A JSF model-bean should be a POJO that follows the JavaBean design pattern with getters/setters

How to submit a serialised object from an Applet, via a servlet, to a backing bean then open a results JSF page

那年仲夏 提交于 2019-12-11 04:39:52
问题 I am an applications programmer doing my first JSF 2.0 web site and confess that I don't know as much as I should about JSF. I have been pooring over documents for months and, thanks to these forums in particular, have not gotten stuck up to this point. The bulk of the web site is finished and working and the backing bean used here is used elsewhere without problems. I have a serialised search criteria object that needs to be submitted from an applet to a backing bean, via a servlet. A

Calling a backing bean method from within jquery

夙愿已清 提交于 2019-12-11 00:22:20
问题 Im working on a JSF file where I have a javascript function, and some jquery involved in this. I have designed a dialog with two button: 1) Ok and 2) Cancel. I have designed it in such a way that the Cancel button will abort the process, and there is no problem with that. But, what I want to accomplish is that when the user presses Ok then the program should call a backing bean(java bean) method, Have anyone of you been able to manage this? Thankful for all your help & tip 回答1: To the point,

set itemDisabled from backing bean method for each item in list

雨燕双飞 提交于 2019-12-10 21:34:51
问题 I have a radiobutton list and would like to disable some items according to the outcome of a backing bean method. <h:selectOneRadio value="#{managedBean.selectedItem}"> <f:selectItems value="#{managedBean.selectItems}" var="x" itemDisabled="#{managedBean.checkIncompatible(x)}" /> </h:selectOneRadio> Is this the right way to do it? Meaning, will this code call checkIncompatible(x) for each x from the selectItems list and set that item as enabled/disabled or just once and that's that? I only

Passing value to the backing bean with PrimeFaces file upload

南笙酒味 提交于 2019-12-06 15:51:14
I am trying to upload the file and pass one parameter from select box with PrimeFaces 3.5. This is my form: <h:form id="idAssessmentsUploadForm" enctype="multipart/form-data"> <h:panelGrid cellspacing="10" styleClass="standard-panel" columns="2" id="idAssessmentsUploadPanelGrid"> <h:outputText value="#{msg['application.assessmentsUploadRequest.loader']}"/> <p:selectOneMenu id="idLoader" style="width: 230px;" required="true" value="#{configurationBean.loaderName}"> <f:selectItems value="#{configurationBean.loaders}"/> </p:selectOneMenu> </h:panelGrid> <p:fileUpload fileUploadListener="#