primefaces

How to align JSF components to center

霸气de小男生 提交于 2020-01-10 08:28:09
问题 In my JSF 2 - Primefaces 3 web application, I am using <p:panelGrid> and <p:panel> . I have multiple components inside them which are left justified. I need to all to be center align. How can we do this I tried to use div but it does not work. 回答1: Look at the generated HTML output and alter CSS accordingly. If the HTML element which you'd like to center is a block element ( <div> , <p> , <form> , <table> , etc, or forced by display: block; ), then you first need to give it a known width and

How to preset the value of p:fileUpload

非 Y 不嫁゛ 提交于 2020-01-10 05:46:09
问题 I am using <p:fileUpload> component. Is it possible to preselect and show the selected file in field before the browse button? I am using Mojarra 2.0.3, PrimeFaces 2.2 RC2, GlassFish 3. 回答1: No, if this was possible, this would have been a huge security hole. You would then in theory be able to let the selected file point to C:/path/to/passwords.txt and then use JavaScript to submit the form and so silently get a file with sensitive data from the client without its permission. See also: How

How to ajax-update the p:dataTable from inside the p:dataTable itself?

廉价感情. 提交于 2020-01-10 04:04:45
问题 <h:form id="formId"> <p:wizard id="wizardId"> <p:tab id="tabId"> <p:dataTable id="tableId"> <p:column> <h:commandLink value="remove" update=""/> </p:column> </p:dataTable> </p:tab> </p:wizard> </h:form> I need to update only the <p:dataTable> without the entire form. I tried using @form , @parent , :formId:wizardId:tabId:tableId , but none of them are working as I want. When I use @form , it is checking for validation which I don't need to do. How can I achieve this? 回答1: First of all, this

PrimeFaces TypeError: PF(…) is undefined

半世苍凉 提交于 2020-01-10 03:47:04
问题 I followed the DataTable Filter showcase from PrimeFaces on my own DataTable. Every time the "onkeyup" event occurs I get a TypeError: PF(...) is undefined error in Firebug and a "Uncaught TypeError: Cannot read property 'filter' of undefined in Chrome Console. The filtering does not work. Here is my XHTML page: <?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http:/

Disable row selection for a few rows only - Primefaces

偶尔善良 提交于 2020-01-10 03:46:06
问题 I would like to know if there is a way of disabling the radio-based row selection for a given set of rows in Primefaces, based on a bean property. Example: <p:dataTable var="foo" value="#{bean.foos}" selection="#{bean.selectedFoo}">` <p:column selectionMode="single" /> <p:column> <h:outputText value="#{foo.bar}" /> </p:column> <p:dataTable> In this case, imagine I would like to disable the rows where foo.bar == 1,5,10 , by disabling the rows I mean disable the radio button associated with the

Downloading files from outside of the application [duplicate]

不问归期 提交于 2020-01-07 09:24:42
问题 This question already has answers here : how to download image from any web page in java (6 answers) Closed 2 years ago . I'm using jsf 2.2 Primefaces 6.0 and i already implemented a solution to download an images from the ressources file inside the application and it works fine but when i try to download from the outside an error message will appear.I need help to can download from the outside of the application: Here the error message : Context Path:/gestion-remboursement-web Servlet Path:

primefaces close dialog on init don't work

风格不统一 提交于 2020-01-07 08:07:31
问题 Im'using Primefaces 5.0 and I tried to use PF Dialog Framework features, but with some problems. I open a dialog using openDialog() method. In the dialog bean I managed an init() method annotated with @PostConstruct. In that method I read parameters and load a list of records (to bind with a dataTable). All seems work fine... dialog opens, I choose a record , close with closeReturn and so on. But I want that in init(), if a single record was found, I could close immediately the dialog. So I

p:blockui disable ajax

拜拜、爱过 提交于 2020-01-07 06:24:32
问题 I have a problem, I'm using p:blockUi to block the full body of my page. The problem is that the AJAX events stopped to work, actually they only work once and then never again. ¿Does anybody now how I can fix it? Here is my code: <h:form id="formMenu"> <ul class="menu"> <li><p:commandLink action="alta" value="Alta" id="btn_alta"/></li> <li><p:commandLink value="Tramitación" id="btn_tramitacion"/></li> <li><p:commandLink value="Bajas" id="btn_baja"/></li> <li><p:commandLink action="salir"

selectOneMenu Converter [duplicate]

时间秒杀一切 提交于 2020-01-07 05:44:09
问题 This question already has answers here : Validation Error: Value is not valid (3 answers) Closed 4 years ago . Hi every body I'm working on Primfaces pages and I have to make a selectOneMenu wich get items from dataBase so I tried to make it this way but I still have problem's with the converter so my source Codes are the folowing : selectOneMenu : <p:selectOneMenu id="devises" required="true" value="#{pret.devise}" effect="fade" converter="devise"> <f:selectItem itemLabel="Select One"

PrimeFaces restore colomn visibility

北慕城南 提交于 2020-01-07 05:30:54
问题 I have a <p:datatable> in which there is some p:column and particularly one <p:columns> . I'm also using one <p:columnToggler> to let user to display or hide column. Memorize his choices is not difficult, it's to restore dynamically his choice which is a problem, especially for <p:columns> because there is no get/set for column inside <p:columns> . I'm also using a pagination and columntoggler+pagination are not friends. What is the best way to restore users choices for a <p:dataTable>