jsf

How to access component value programmatically

拜拜、爱过 提交于 2021-02-19 07:52:29
问题 Lets assume I want to access the value of a sibling component in an ActionListener. The following fragment is not working as expected, resulting in a ClassCastException: java.util.HashSet cannot be cast to java.lang.String public void processAction(final ActionEvent event) { FacesContext ctx = FacesContext.getCurrentInstance(); UIComponent sibling = event.getComponent().findComponent("inputText"); String value = (String) sibling.getValue(); ... } If I change the essential part to the

JSF best Way to pass parameters

女生的网名这么多〃 提交于 2021-02-19 05:23:41
问题 i'm currently working with JSF, but since i'm a old and grouchy php-dev i always mess up with the GET-Parameters of an request. (In PHP you can access the request Paramerts whenever you want, using the $_GET["paramname"] Array. Now, i'm working on an User Managment System. (CRUD) Usually i go with a list of all available users, having options like edit / delete. The edit link is then pointing to http:\\localhost\editUser.xhtml?userId=5 for example. I have also an Controller called

JSF best Way to pass parameters

可紊 提交于 2021-02-19 05:22:31
问题 i'm currently working with JSF, but since i'm a old and grouchy php-dev i always mess up with the GET-Parameters of an request. (In PHP you can access the request Paramerts whenever you want, using the $_GET["paramname"] Array. Now, i'm working on an User Managment System. (CRUD) Usually i go with a list of all available users, having options like edit / delete. The edit link is then pointing to http:\\localhost\editUser.xhtml?userId=5 for example. I have also an Controller called

JSF ValueChangeListener not working

余生颓废 提交于 2021-02-19 03:32:30
问题 I am learning how to use events with JSF. For some reason, the program is not changing the value in the text field when I change the value of the dropdown menu. The page loads and shows "Germany", but does not change the text field to "DE". Any suggestions? Index.xhtml: <?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:f="http://java

JSF ValueChangeListener not working

爷,独闯天下 提交于 2021-02-19 03:32:04
问题 I am learning how to use events with JSF. For some reason, the program is not changing the value in the text field when I change the value of the dropdown menu. The page loads and shows "Germany", but does not change the text field to "DE". Any suggestions? Index.xhtml: <?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:f="http://java

Why can't I see HTML 5 <dialog>?

寵の児 提交于 2021-02-18 08:01:12
问题 Here is my Facelets file: <!DOCTYPE html> <html lang="en" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <title>Simple JSF Facelets page</title> </h:head> <h:body> Place your content here! <dialog> <dt>Sam</dt> <dd>Knock, Knock.</dd> <dt>Eric</dt> <dd>Who's there?</dd> <dt>Sam</dt> <dd>Justin.</dd> <dt>Eric</dt> <dd>Justin who?</dd> <dt>Sam</dt> <dd>Justin time for dinner!</dd> </dialog> </h:body> </html> What I see in the browser is only Place your

JSF: initial request and postback request?

こ雲淡風輕ζ 提交于 2021-02-17 09:38:12
问题 Please take a look at this below line of code in JSF <h:inputText id="name" value="#{customer.name}" /> Quote from java.sun.com: For an initial request of the page containing this tag, the JavaServer Faces implementation evaluates the #{customer.name} expression during the render response phase of the lifecycle. During this phase, the expression merely accesses the value of name from the customer bean, as is done in immediate evaluation. For a postback request, the JavaServer Faces

JSF: initial request and postback request?

扶醉桌前 提交于 2021-02-17 09:38:01
问题 Please take a look at this below line of code in JSF <h:inputText id="name" value="#{customer.name}" /> Quote from java.sun.com: For an initial request of the page containing this tag, the JavaServer Faces implementation evaluates the #{customer.name} expression during the render response phase of the lifecycle. During this phase, the expression merely accesses the value of name from the customer bean, as is done in immediate evaluation. For a postback request, the JavaServer Faces

Error Rendering View: java.lang.IllegalStateException: getOutputStream() has already been called for this response

元气小坏坏 提交于 2021-02-17 05:02:34
问题 I am creating a project in JSF and spring whose main only purpose is to generate PDF file in the browser. Everything seems fine and pdf generated too but on console i am getting this exception.Anyone have idea about this? I have searched and found that many peoples had that problem but i didn't find any solution for mine one. SEVERE: Error Rendering View[/WebPages/SearchPages/index.xhtml] java.lang.IllegalStateException: PWC3991: getOutputStream() has already been called for this response I

MethodExpression not firing in HtmlCommandLink

岁酱吖の 提交于 2021-02-16 22:43:25
问题 I have a dynamically generated Datatable, like this DataTable dataTable = new DataTable(); dataTable.setValue(relatorioVOList); dataTable.setVar("rVO"); Column checkBoxColumn = new Column(); checkBoxColumn.getChildren().add(this.viewComponentBuilder.createExpressionTextWithLink("#{rVO.iRelatorio}","#{rVO.nNome}")); dataTable.getColumns().add(checkBoxColumn); public HtmlForm createExpressionTextWithLink(String iRelatorioExpressionValue, String valueExpressionValue) { HtmlForm form = new