jsf-2

@ManagedProperty equivalent in Spring

左心房为你撑大大i 提交于 2021-02-10 18:56:48
问题 I am using Spring for my DI. Is there an equivalent of @ManagedProperty? I want to inject the value from one view scoped bean into another one on the next page. e.g @Component @Scope("view") public class Page1Bean(){ private String value; } @Component @Scope("view") public class Page2Bean(){ @ManagedProperty(value = #{page1Bean}") //doesnt work in Spring private Page1Bean bean; } 回答1: @Resource or @Autowired should work. @Resource is the Java EE implementation, @Autowired is the spring

@ManagedProperty equivalent in Spring

旧时模样 提交于 2021-02-10 18:56:38
问题 I am using Spring for my DI. Is there an equivalent of @ManagedProperty? I want to inject the value from one view scoped bean into another one on the next page. e.g @Component @Scope("view") public class Page1Bean(){ private String value; } @Component @Scope("view") public class Page2Bean(){ @ManagedProperty(value = #{page1Bean}") //doesnt work in Spring private Page1Bean bean; } 回答1: @Resource or @Autowired should work. @Resource is the Java EE implementation, @Autowired is the spring

p:dialog not hidden on validation failure

拈花ヽ惹草 提交于 2021-02-08 06:34:24
问题 I am having a problem with not closing a PrimeFaces dialog. The input field 'username' is required: <p:outputLabel for="username" value="Username: "/> <p:inputText id="username" value="#{employeeController.employee.username}" required="true"/> I used the following code to prevent the dialog from closing if the field is empty: <p:commandButton value="Save" action="{employeeController.doSaveEmployee()}" oncomplete="if (args && !args.validationFailed) PF('employeeAddDialog').hide()" update="

JSF / primefaces eventing in diagram elements

允我心安 提交于 2021-02-08 06:15:07
问题 i need to access the data object of an org.primefaces.model.diagram.Element in a managedBean on click of this very element. I am using primefaces 5.2. I tried multiple ways to establish this, but none did work so far. Here is one approach: xhtml: the idea is, to pass the element through a commandLink action attribute (which works fine for e.g. data tables): <fl:composition template="/WEB-INF/template.xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:fl=

JSF / primefaces eventing in diagram elements

孤街醉人 提交于 2021-02-08 06:14:15
问题 i need to access the data object of an org.primefaces.model.diagram.Element in a managedBean on click of this very element. I am using primefaces 5.2. I tried multiple ways to establish this, but none did work so far. Here is one approach: xhtml: the idea is, to pass the element through a commandLink action attribute (which works fine for e.g. data tables): <fl:composition template="/WEB-INF/template.xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:fl=

Ajax-render a table which is inside a different form

心不动则不痛 提交于 2021-02-07 19:50:05
问题 I am facing a problem rendering a data table when selecting a date from <rich:calendar> . I use <a4j:ajax> for the rendering but with no effect. Here is the code sample: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:rich="http://richfaces

Ajax-render a table which is inside a different form

99封情书 提交于 2021-02-07 19:48:37
问题 I am facing a problem rendering a data table when selecting a date from <rich:calendar> . I use <a4j:ajax> for the rendering but with no effect. Here is the code sample: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:rich="http://richfaces

how to iterate Map<String,Collection> in datatable in primefaces

回眸只為那壹抹淺笑 提交于 2021-02-07 19:14:20
问题 Using JSF 2.1 with primefaces class FOO{ String name; String value; public void setName(String name){ this.name=name; } public String getName(){ return this.name; } public void setValue(String value){ this.value=value; } public String getValue(){ return this.value; } } I have an Map<String, List<FOO>> Header name should be Key of the Map. I need to create multiple columns (i.e. size of Map) and each column should have the list of FOO to display FOO.Name in rows. For Example : if size of map

how to iterate Map<String,Collection> in datatable in primefaces

醉酒当歌 提交于 2021-02-07 19:14:06
问题 Using JSF 2.1 with primefaces class FOO{ String name; String value; public void setName(String name){ this.name=name; } public String getName(){ return this.name; } public void setValue(String value){ this.value=value; } public String getValue(){ return this.value; } } I have an Map<String, List<FOO>> Header name should be Key of the Map. I need to create multiple columns (i.e. size of Map) and each column should have the list of FOO to display FOO.Name in rows. For Example : if size of map

JSF2: How are the *.taglib.xml files discovered in jsf-impl.jar?

泪湿孤枕 提交于 2021-02-07 09:17:57
问题 In jsf-impl.jar (which can be found on mvnrepository.com), the *.taglib.xml files are located in directory com/sun/faces/metadata/taglib/ . I don't understand how they're discovered in this case, because chapter 10.3.2 of the JSF 2 specification says: 10.3.2 Facelet Tag Library mechanism ... The run time must support two modes of discovery for Facelet tag library descriptors Via declaration in the web.xml, as specified in Section 11.1.3 “Application Configuration Parameters” Via auto