managed-bean

using templates in primefaces JSF

耗尽温柔 提交于 2019-12-25 02:06:05
问题 I have main page index.xhtml with declared place to put content dependent on page clicked. <br> <div id="centerContent"> <ui:insert name="centerContent" > <ui:param name="mainTag" value="" /> <ui:include src="/template/commonContent.xhtml" /> </ui:insert> <h4>#{mainTag}</h4> </div> </br><br></br> <p:panel id="content"> <h:form> <h:inputText id="namez" ></h:inputText> </h:form> </p:panel> </p:layoutUnit> my template commonContent is: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC

Accessing DAO Service methods from non managedbeans

一世执手 提交于 2019-12-24 20:56:03
问题 I am using Spring 3 and Hibernate 4 How can I use the following in a non ManagedBean @Inject EmployeeService employeeService Or if I would want to access DAO method I have to make that a ManagedBean as @Named("mymanagedbean") @ViewAccessScoped I have a few Converter class and in order to access DAO service methods I had to use that as ManagedBean even though they are not ManagedBeans. What is the best approach to call DAO service methods? Thanks 回答1: You will need to implement the Spring

Backing Bean not getting values sent by javascript

不打扰是莪最后的温柔 提交于 2019-12-24 16:13:10
问题 I have three drop down lists whose values are been copied to <h:inputHidden> components by the following JavaScript function: function getBirthDate() { var months = document.getElementById("months") var hidden1 = document.getElementById("formsignup:monthField"); hidden1.value = months.options[months.selectedIndex].text; var days = document.getElementById("days"); var hidden2 = document.getElementById("formsignup:dayField"); hidden2.value = days.options[days.selectedIndex].value; var years =

How to declare many JSF managed beans at once

拥有回忆 提交于 2019-12-24 10:44:38
问题 I'm developing a JSF 2.0 app that consumes a SOAP-based web service. I want to use in the JSFs pages most of the generated client classes for the Web Service - but the client classes are not managed beans (nor CDI beans)... and as there are a lot of client classes I don't think is feasible to add @ManagedBean or @Named annotations to all classes... Let me give you an example so things might get a bit clearer: The User class is a generated client class - this class has only two attributes

JSF/PrimeFaces: Issue in pages with a layout

青春壹個敷衍的年華 提交于 2019-12-24 09:26:35
问题 I have a problem with my JSF page which uses PrimeFaces components. As it may get long and boring quickly, I try to be as brief as possible. Consider this managed bean: @Named(value = "testBean") @RequestScoped public class TestBean implements Serializable { private String test; public String update() { test = "Updated."; return "test"; } // Getters and Setters... } Here's the body of test.xhtml , with irrelevant content and styles removed: <h:body> <p:layout id="layout" fullPage="true"> <p

Creating a ToolTip Managed bean

蹲街弑〆低调 提交于 2019-12-24 08:29:12
问题 This is a followup to my previous post at ToolTip Performance in XPages I have got the code to do it written (not tested) so I can't seem to get my Managed Bean to get called properly. My config contians the following: <managed-bean id="ToolTip"> <managed-bean-name>WFSToolTip</managed-bean-name> <managed-bean-class>ca.workflo.wfsToolTip.ToolTipText</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean> and I have stripped my code down to the bare minimum:

jsf dynamic change of managedbean

限于喜欢 提交于 2019-12-24 05:04:14
问题 How can I dynamically change managed bean of "value" attribute? For example, I have h:inputText and, depending on typed-in text, managed bean must be #{studentBean.login} or #{lecturerBean.login}. In a simplified form: <h:inputText id="loginField" value="#{'nameofbean'.login}" /> I tried to embed another el-expression instead of 'nameofbean': value="#{{userBean.specifyLogin()}.login}" but it doesn't worked out. 回答1: Polymorphism should rather be done in the model, not in the view. E.g. <h

Form submit does not trigger action method on managedBean on a JSF 1.2 page with request parameters

岁酱吖の 提交于 2019-12-24 00:07:08
问题 I have a quite complicated request scoped JSF 1.2 managed bean with various methods and properties. Some of the properties are mapped to URL request parameters so that it can populate an entity object according to the id attribute in the URL. I use the same managed bean both to create a new record for that entity using one jsf page, and another one for updating a couple of fields. In create mode, there are no url parameters, and submitting the form using an specifying an action method just

CDI ambiguous dependency when adding @Named qualifier to existing bean via @Produces

冷暖自知 提交于 2019-12-23 23:07:04
问题 I have a CDI bean implementation in a dependency jar file: @ApplicationScoped public class MyService { public String doSomething() {...} } In my webapp, I want to access that service via EL Expression, therefore I have to give it a @Named annotation. But I cannot add the annotation on the MyService implementation because I don't have the rights to change that code. Therefore I tried creating a producer like public class MyServiceProducer { @Inject MyService myService; @Produces @Named(

At which phase is managed bean constructed and which constructor is used

两盒软妹~` 提交于 2019-12-23 19:14:06
问题 Consider example of JSF based web-app hello1 from official tutorial with addition constructor in managed bean. The follow index.xhtml facelet <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"> <h:head> <title>Facelets Hello Greeting</title> </h:head> <h:body> <h:form> <h:graphicImage url="#{resource['images:duke.waving.gif']}" alt="Duke waving his hand"/> <h2>Hello hui, my name is Duke. What's yours?</h2> <h:inputText id="username" title="My name is: