List of events

You might want to look at “JavaScript HTML DOM Events” for a general overview of events: http://www.w3schools.com/jsref/dom_obj_event.asp PrimeFaces is built on jQuery, so here’s jQuery’s “Events” documentation: http://api.jquery.com/category/events/ http://api.jquery.com/category/events/form-events/ http://api.jquery.com/category/events/keyboard-events/ http://api.jquery.com/category/events/mouse-events/ http://api.jquery.com/category/events/browser-events/ Below, I’ve listed some of the more common events, with comments about where they can be used (taken from jQuery documentation). Mouse Events … Read more

How to remove border from specific PrimeFaces p:panelGrid?

The border is been set on the generated tr and td elements, not on the table. So, this should do: .companyHeaderGrid.ui-panelgrid>*>tr, .companyHeaderGrid.ui-panelgrid .ui-panelgrid-cell { border: none; } How I found it? Just check the generated HTML output and all CSS style rules in the webdeveloper toolset of Chrome (rightclick, Inspect Element or press F12). Firebug … Read more

Keep p:dialog open when a validation error occurs after submit

The onsuccess runs if ajax request itself was successful (i.e. there’s no network error, uncaught exception, etc), not if action method was successfully invoked. Given a <p:dialog widgetVar=”yourWidgetVarName”>, you could remove the onsuccess and replace it by PrimeFaces RequestContext#execute() inside saveMethod(): if (success) { RequestContext.getCurrentInstance().execute(“PF(‘yourWidgetVarName’).hide()”); } Note: PF() was introduced in PrimeFaces 4.0. In older … Read more

How to use PrimeFaces p:fileUpload? Listener method is never invoked or UploadedFile is null / throws an error / not usable

How to configure and troubleshoot <p:fileUpload> depends on PrimeFaces and JSF version. All PrimeFaces versions The below requirements apply to all PrimeFaces versions: The enctype attribute of the <h:form> needs to be set to multipart/form-data. When this is absent, the ajax upload may just work, but the general browser behavior is unspecified and dependent on … Read more

Can I update a JSF component from a JSF backing bean method?

Using standard JSF API, add the client ID to PartialViewContext#getRenderIds(). FacesContext.getCurrentInstance().getPartialViewContext().getRenderIds().add(“foo:bar”); Using PrimeFaces specific API, use PrimeFaces.Ajax#update(). PrimeFaces.current().ajax().update(“foo:bar”); Or if you’re not on PrimeFaces 6.2+ yet, use RequestContext#update(). RequestContext.getCurrentInstance().update(“foo:bar”); If you happen to use JSF utility library OmniFaces, use Ajax#update(). Ajax.update(“foo:bar”); Regardless of the way, note that those client IDs should represent absolute client IDs … Read more

How to find out client ID of component for ajax update/render? Cannot find component with expression “foo” referenced from “bar”

Look in HTML output for actual client ID You need to look in the generated HTML output to find out the right client ID. Open the page in browser, do a rightclick and View Source. Locate the HTML representation of the JSF component of interest and take its id as client ID. You can use … Read more

Understanding PrimeFaces process/update and JSF f:ajax execute/render attributes

<p:commandXxx process> <p:ajax process> <f:ajax execute> The process attribute is server side and can only affect UIComponents implementing EditableValueHolder (input fields) or ActionSource (command fields). The process attribute tells JSF, using a space-separated list of client IDs, which components exactly must be processed through the entire JSF lifecycle upon (partial) form submit. JSF will then … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)