jsf

MethodExpression not firing in HtmlCommandLink

一个人想着一个人 提交于 2021-02-16 22:41:36
问题 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

how to validate string input field for pattern on JSF form

Deadly 提交于 2021-02-16 13:54:49
问题 i have a requirement where a input field which takes strings can have only one of these formats, what is the best way to implement this using javascript or jsf validator: N/A-N-N-N or N/A-N-N-N-N There can be any alphabet in pattern above in place of A. there can be any numeric in pattern above in place of N other than 0. 回答1: First of all, there is no "best" way. There's just the "right" way which depends on the concrete functional requirements. The normal approach to validate in JSF is to

how to validate string input field for pattern on JSF form

℡╲_俬逩灬. 提交于 2021-02-16 13:54:01
问题 i have a requirement where a input field which takes strings can have only one of these formats, what is the best way to implement this using javascript or jsf validator: N/A-N-N-N or N/A-N-N-N-N There can be any alphabet in pattern above in place of A. there can be any numeric in pattern above in place of N other than 0. 回答1: First of all, there is no "best" way. There's just the "right" way which depends on the concrete functional requirements. The normal approach to validate in JSF is to

Adding action methods to a composite component

无人久伴 提交于 2021-02-16 05:11:58
问题 I am learning about composite components with JSF 2.0 and i want my component to be able to trigger methods from backing beans, so i created a simple example, but something is wrong. This is the component i created: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:composite="http://java.sun.com/jsf/composite"> <composite:interface> <composite:attribute name="attribute1"/> <composite:attribute name="attribute2"/> <composite:attribute name="actionBtnText"/

Adding action methods to a composite component

让人想犯罪 __ 提交于 2021-02-16 05:10:13
问题 I am learning about composite components with JSF 2.0 and i want my component to be able to trigger methods from backing beans, so i created a simple example, but something is wrong. This is the component i created: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:composite="http://java.sun.com/jsf/composite"> <composite:interface> <composite:attribute name="attribute1"/> <composite:attribute name="attribute2"/> <composite:attribute name="actionBtnText"/

How to change locale in JSF 2.0?

半世苍凉 提交于 2021-02-15 11:46:08
问题 In my app, user should be able to switch the locale (the language used to render text on pages). Tons of tutorials are using FacesContext.getCurrentInstance().getViewRoot().setLocale(). For example: http://www.mkyong.com/jsf2/jsf-2-internationalization-example/. But, that simply doesn't work in JSF 2.0 (it did work in 1.2). The language never switches. No errors or anything. The same code worked fine in JSF 1.2. What is the correct and definitive approach? I have cobbled together a solution,

How to change locale in JSF 2.0?

ⅰ亾dé卋堺 提交于 2021-02-15 11:45:25
问题 In my app, user should be able to switch the locale (the language used to render text on pages). Tons of tutorials are using FacesContext.getCurrentInstance().getViewRoot().setLocale(). For example: http://www.mkyong.com/jsf2/jsf-2-internationalization-example/. But, that simply doesn't work in JSF 2.0 (it did work in 1.2). The language never switches. No errors or anything. The same code worked fine in JSF 1.2. What is the correct and definitive approach? I have cobbled together a solution,

Download pdf file from Java web app made in JSF

和自甴很熟 提交于 2021-02-11 17:51:36
问题 Hello I have a Java web app made in JSF...when you press a button it should write a string in a pdf file and download it. Here is the code: String cont = "DATA CREARE: " + data_creare3 + "\n" + "CIF: " + cif3 + "\n" + "ID SOLICITARE: " + id_solicitare3 + "\n" + "DETALII" + detalii3 + "\n" + "TIP: " + tip3 + "\n" + "ID: " + id3; startDownload(cont.getBytes(), "id.pdf"); This is the String and the method being called and here is the function that makes the download.. private void startDownload

p:panelGrid Layout Issue

一曲冷凌霜 提交于 2021-02-11 15:31:17
问题 How can I achieve the layout as shown below? First Name [_________] Last Name [_________] Street [_________] I tried some from https://www.primefaces.org/showcase/ui/panel/panelGrid.xhtml But ended up as below, First Name[_______]Last Name[_________] Street[_________] Below is the code that I have tried <p:panelGrid columns="4" layout="flex" columnClasses="p-col-12 p-md-3 p-xl-2, p-col-12 p-md-9 p-xl-4, p-col-12 p-md-3 p-xl-2, p-col-12 p-md-9 p-xl-4" contentStyleClass="p-align-baseline ui

Duplicate headers in primefaces data table

不羁岁月 提交于 2021-02-11 14:34:26
问题 When I use stickyHeader=true on primefaces data table I see two headers generated. Second is 5 rows below the actual header and it is happening on all my pages. Anybody had this issue and got it resolved? <p:dataTable var="product" value="#{productBean.products}" stickyHeader="true"> <p:column headerText="Name"> <h:outputText value="#{product.name}" /> </p:column> <p:column headerText="Year"> <h:outputText value="#{product.year}" /> </p:column> <p:column headerText="Active"> <h:outputText