jsf-2

Multiple PrimeFaces dialogs on one page

我的未来我决定 提交于 2019-12-22 01:39:55
问题 I am facing problems with dialog windows validation. On home.xhtml I have a tabview with 3 nested dataTables and CRUD buttons (see screenshot). Every button is supposed to call a dialog window with a form to add/edit entity. But whenever I fail to validate some field in any form - all other forms are displayed too: I would like to validate and display only one dialog at a time and keep it displayed untill user presses "Cancel" button or inputs valid values and presses submit button. No other

Several PrimeFaces dialogs show up on validation error instead of single

一曲冷凌霜 提交于 2019-12-22 01:37:02
问题 I have JSF and PrimeFaces 3.5 web application. Page home.xhtml contains a tabView component with 3 nested dataTables and buttons that perform add/edit/delete operations. Every button calls a p:dialog with different form. Whenever one of the dialogs get validation error, all other dialogs are displayed too because their attribute is visible="#{facesContext.validationFailed}" (IMHO) I need to display only one dialog which failed to validate untill user enters valid values or presses Cancel

What is the difference between class and styleClass attributes in JSF?

久未见 提交于 2019-12-22 01:33:55
问题 I see, that in JSF most of the standard components that mapped to HTML tags, e.g. <h:commandButton/> , have attributes class and styleClass . But no matter, which one I use, both is rendered as class attributes in markup. So why there are two attributes with the same purpose? 回答1: There is simply no class attribute in JSF components. From the doc, attribute styleClass : Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through

Primefaces <p:ajax update=“@all” /> doesn't work

流过昼夜 提交于 2019-12-22 01:32:03
问题 I've got a problem with using p:ajax update atribute element. When I use in my code <p:ajax update="@all" /> then I am getting javax.el.PropertyNotFoundException . When I use <f:ajax render="@all" /> I don't get any. I though that thouse tags are nearly same. Can anyone explain whats happening? I am using mojjara implementation, primefaces 3.5 and Liferay jsf portlet bridge. Example of stacktrace: Caused by: javax.el.PropertyNotFoundException: /pages/views/personForm.xhtml @95,99 value="#

How to override primefaces component api class with custom class

浪子不回头ぞ 提交于 2019-12-22 01:06:03
问题 I am facing the duplicate ids for columns issue in p:treeTable i.e. same problem as described in the below link http://forum.primefaces.org/viewtopic.php?f=3&t=31158&p=99463#p99463 So I would like to implement the solution as suggested in the above solution. So I thought of changing the source code and recompile and use the jar but I haven't got permission to do the same. I was asked to customise the class by extending the org.primefaces.component.api.UITree class or somehow without changing

JSF request-scoped managed bean http-session causes in-instantiation

你离开我真会死。 提交于 2019-12-21 23:45:58
问题 I'm using a SessionFilter servlet for validating users and then giving access of the system to them. My restricted files are in a folder named "com.shadibandhan.Restricted". Session filter is working fine. here's the relevant code of the sessionfilter servlet @Override public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse)

disabling second text field after data validation through ajax of first text field

独自空忆成欢 提交于 2019-12-21 23:26:24
问题 As I was experimenting with JSF 2.0 , i came across a scenario like this . I have two text fields - based on input of first field an ajax call is fired using <f:ajax ... /> After the response is back I am re rendering the second text field ..but i want to disable the second text field based on some server side validation of first field value. I don't want to set the disabled using style based on a third property which is being set in the bean after validation. Is there any alternative ways..

Non-lazy instantiation of CDI SessionScoped beans

↘锁芯ラ 提交于 2019-12-21 23:01:06
问题 CDI newbie question. Simple test scenario: JSF + CDI SessionScoped beans. I need an elegant way to instantiate a known set of session scoped CDI beans without mentioning them on a JSF page or calling their methods from other beans. As a test case - a simple logging bean, which simply logs start and end time of an http session. Sure, I could create an empty JSF component, place it inside of a site-wide template and make it trigger dummy methods of the required session beans, but it's kinda

How to trigger destruction of viewscoped bean?

天涯浪子 提交于 2019-12-21 22:20:30
问题 I have a @ViewScoped -annotated managedbean whose @PostContruct -method fetches a list from database to be displayed in a table in the view. Now when I delete an item I want the changes to be seen in the view. To keep this dynamic and reusable I only want to delete from database (not manually from list). So I need to destroy/recreate the bean I suppose. Now I do this by navigating to the same view. But the way I do is not reusable. Can I just destroy the bean manually or navigate to the same

Server-initiated Rendering: EJB -> FacesContext?

梦想的初衷 提交于 2019-12-21 21:50:11
问题 I've already asked this question on the Icefaces forum, but meanwhile I realized that this is a more generic problem. I'd like to update parts of a JSF page when I get a message in my MDB. The problem is, how do I get the FacesContext from the EJB container? In the message processing function FacesContext.getCurrentInstance() returns null. I've also tried to make a JSF managed bean be a MDB, but I couldn't (it seems you can't have both in the same class?). Since I'm a beginner in the JSF