Why are you using a TreeMap to store themes and list them? As in the example you linked, you MUST use a List instead of a Map in the <f:select> tag In your themeSwithcherBean.java private List<Theme> themes; @PostConstruct public void init() { themes = new ArrayList<Theme>(); themes.add(new Theme(0, "Afterdark", "afterdark"));...

Ok so I found the answer thanks to useful link on PF client side API: http://blog.hatemalimam.com/intro-to-primefaces-widgetvar/ So the short answer is, you need to assagin a widgetVar atrribute and then using PrimeFaces object get instance of jqplot like this: <p:chart id="chart" type="line" widgetVar="chart" model="#{resultsViewController.areaModel}" style="height:600px"/> Like this: var jqplot =...

I use the customExport, doing the steps on the link Steps to Custom Exporter When I debug the code, I see the mode to create the footers on the document exporter, which it's not consist the tag exportable (isExportable()). Into the method "tableColumnGroup(Sheet sheet, DataTable table, String facetType){", of the...

The problem was glassfish still used primefaces 5.1 even if I put primefaces 5.2 in my pom.xml. So I had to remove all the primefaces folder in the maven repository in my home : .m2/repository/org/primefaces except 5.2. Then Glassfish used 5.2 and pagination worked !

The action method is not called because of the type="button" attribute - there is no submit to the server. Remove type, then the action will be triggered (the button will assume the default submit type).

As you can see on the TagDecorator page you linked to, the 'html5 friendly' markup is only relevant to 'basic' inputs, buttons and links. PrimeFaces has some counterparts of these to, but if you take a closer look at the real advantage of this 'html5 friendly' notation, it mainly on...

The <p:commandButton> basically submits a POST request to the URL as specified by its parent <h:form>, which defaults indeed to the current request URL (you know, "postback"). The action attribute basically invokes a bean method and uses the returned value as navigation case outcome. An URL does not necessarily represent...

With the hint of BalusC I tracked down the error. Somehow a PrimeFaces Datatable way up on the page triggered its selection with null in the same request, overriding the entity. I don't know why it would be doing that without an actual selection, but with adding explicit processing of...

Dialogs have a special treatment in HTML DOM and JavaScript. You should never be ajax-updating any of the dialog's parents while still in the same view. Otherwise you potentially end up with duplicate dialogs and conflicts in JS. Moreover, the strong recommendation is to give each dialog its own form...

Ok so i found out that filteredValue was reseted on each ajax call because of the @RequestScoped. I think i was kind of mixing up things. So i switched all @ManagedBeans to @Named then i created a new @SessionScoped Bean with most of the attributes and i @inject a @RequestScoped...

Ok. Excuse me I'm a completly stupid. I tried doing something I haven't done before: downloading the PrimeFaces manual. On the AjaxBehavior section there's the "process" one which process a component in partial request. I fixed it just by doing: <p:ajax event="rowSelect" process=":f_tarea:r_list:pg_documento" update=":f_tarea:pg_doc" listener="#{tareaController.controlador.reemplazarLista(tareaController.documentoSeleccionado)}"/> I won't delete the question...

When you try to update a component from ManagedBean using RequestContext.update() you should not use the relative component id, because you'd have nothing to relate to. To fix your problem remove : before Requests in your listener. RequestContext.getCurrentInstance().update("Requests"); If you feel updating a component from managed bean, increases cohesion. You...

Basically, behind the scenes, JSF creates the component and sets attributes as below: MyPanel myPanel = new MyPanel(); myPanel.getAttributes().put("panelName", "TEST123"); It should speak for itself that it's not possible to set a component attribute before it's constructed. However, you're attempting to access it in the constructor! You should access it...

When using a selection component (such as p:selectCheckboxMenu or p:pickList), you need a converter to handle complex (= not a simple String) Java objects as values of f:selectItems. A converter will serialize and deserialize your entity Demonstrator. Therefore you need to add the converter attribute for your p:selectCheckboxMenu and reference...

You can use all the jQuery/JS you want over the JSF views. The main problem is that model doesn't keep updated, as long as you don't sync the state. To see that hiding/showing a column isn't that complex, here you've got a basic full-working example of it using jQuery and...

Got solution to this issue...To fix "Unable to find component with clientId 'tab:j_id16:sec_4', no need to remove it.", the we have to update the jsf jars to from 2.1.7 to 2.1.9 or to 2.1.29. In the below links, this is reported as an issue of Mojarra. See the links http://forum.primefaces.org/viewtopic.php?f=3&t=22880...

As per Mojarra issue 2722 this will happen when you incorrectly bind component instances to a bean property of a managed bean which is not request scoped, but in a broader scope. <x:someComponent binding="#{viewOrSessionOrApplicationScopedBean.component}" /> Fix the code accordingly that this never happens. Components are inherently request scoped and may...

You've set immediate=true on a UICommandComponent, so the "Update model values" phase is skipped. Remove the attribute and it should work. BalusC offers this advice, "If set in UICommand only, the apply request values phase until with update model values phases will be skipped for any of the UIInput component(s)....

There's no such thing in standard JSF/PrimeFaces API. Quick'n'dirty workaround would be overriding the component registration in webapp's faces-config.xml whereby you set the component class to a non-UIComponent class (it will ultimately throw ClassCastException on usage), or to a custom UIComponent which throws e.g. IllegalArgumentException in its constructor. E.g. if...

It's not be able to understand "p:" components, only simple html. Of course it is not! The h:outputText value is evaluated at view render time, so if you render JSF tags, they won't be evaluated again since rendering is done. In principle, it could have been possible to add...

Assuming they are not subsets of one another, you cannot use one generic socket (one channel). Depending on the number of logged in users and/or the number of groups and/or the number of groups a user is a member of, I can see an additional possible solution (besides creating a...

It was my mistake to mention the id in place of the widgetVar. This: oncomplete="PF('myTableWidget').filter()" would work fine if the dataTable in question looks like: <p:dataTable id="myTable" widgetVar="myTableWidget"... I was wrongly trying it this way: oncomplete="PF('myTable').filter()" ...

Don't fiddle around with style attribute. Just give it a class which you declare in a CSS file. <p:layout styleClass="backgroundless"> .ui-layout-container.backgroundless .ui-widget-content { background: none; } See also: How do I override default PrimeFaces CSS with custom styles? CSS beginner tutorial ...

You have to use it like PrimeFaces User Guide tells you. The first p:password component must have the match attribute, not the second. If the second p:password component has match defined then the following happens. When validating the first p:password its submitted value is deemed valid (which is already wrong...

The reason why method is not called is, that conversion of values fails. Country field CountriesConverter method getAsObject should have return type Object, I expect it's not called at all now. Country class must implement the equals and hashCode methods. Timezone field The timezoneOffset property of the User class must...

There are few issues with your code. You should use converter="myConverter" on your <p:orderList> component. Expression bean is of SessionScoped. But you are getting it from ApplicationScope. Change it to Expression service = (Expression) fc.getExternalContext().getSessionMap().get("expression"); After making these changes its working....

Is there a way to do this with JSF 2.0 navigation (the first approach, that I cannot get to work)? You can programmatically perform navigation using NavigationHandler#handleNavigation(). public void onNodeSelect(NodeSelectEvent event) { // ... String outcome = "grupal.xhtml?faces-redirect=true&id=" + sec.getId() + "&nombre=" + sec.getNombre(); FacesContext context = FacesContext.getCurrentInstance(); context.getApplication().getNavigationHandler().handleNavigation(context,...

This problem occurred due to a missing configuration the web.xml. On analysing tomcat's log (catalina.out), found an error when Safari was trying to connnect to tomcat, ERROR org.atmosphere.cpr.AsynchronousProcessor - Invalid request state. AsyncContext#startAsync not supported. On searching with this error, found a solution from https://groups.google.com/forum/#!topic/atmosphere-framework/D5-yrW6NzLU Added <async-supported>true</async-supported> to shiroFilter in...

The error is self-explanatory, and confirmed in the Primefaces manual: For pdf exporting itext and for xls exporting poi libraries are required in the classpath. So here you go: https://poi.apache.org/download.html...

"But is there a similar Schedule Component in primefaces mobile ?" No, as can be seen by just examining the showcases "Can this calendar component show events over it, like how a schedule component shows. ?" No, as can be seen by lack of examples in the showcase of...

The input component's value must be bound to a writable value expression. What you've there is a direct getter method invocation and thus essentially read-only. This is indeed not going to work. You need to specify a property name of the #{entity}. You can use the brace notation to specify...

I found a way to solve it: whatever is passed to "filterBy" attribute is in EL(Expression Language), so I can write my filter like this: in xhtml: ... filterBy="#{item.property1};#{item.property2}" ... and in filter function: public boolean filter(Object value, Object filter, Locale locale){ ... String[] properties = value.toString().split(";"); ... ...

You can use the :hover pseudo-selector. If .ui-selectcheckboxmenu-item select the elements that you want to highlight, then with this code should work: .ui-selectcheckboxmenu-item:hover{ background-color: blue; } ...

You should now set your extender from your model in your chartViewLine bean. LineChartModel model = new LineChartModel(); model.setExtender("chartExtender"); Attribute extender has been removed in PrimeFaces 5.0 (see also list of p:chart attributes from PrimeFaces 5.0 Documentation)...

From the PrimeFaces User Guide (currently p. 185): Do not place dialog inside tables, containers likes divs with relative positioning or with nonvisible overflow defined, in cases like these functionality might be broken. This is not a limitation but a result of DOM model. For example dialog inside a layout...

You're basically binding physically different <p:dataTable> components to one and same EL variable. If this EL variable is not null (i.e. already set by a previous component in the same view), then JSF will reuse it instead of creating a new one, and override all of its attributes during view...

because you have a table it means you have different objects each has their own intervals so It's better not to use a single value #{newsManagementBean.intervals} for all of them. try defining intervals as your object's property and use it in that way. I mean news.intervals

This is how I got it worked for me. In the implementation of the Omnifaces ListConverter, the getAsObject method is using the list to find the value and update the target and source of dualList. NOTE: you will get either a new value added in target (List=".getSource") or a new...

When you are specifying widgetVar in a PrimeFaces element, JavaScript widget object is instantiated and assigned to a global variable with the specified name in the window scope. This means that this objects could be found and manipulated. I suggest finding them by blockui ids. Widget object contains it's id,...

Fixed this issues by surrounding the p:dataTable with h:form. Not sure why that fixed it... The JSF view state is maintained by javax.faces.ViewState hidden input field of the <h:form>. If you don't use a <h:form>, then PrimeFaces won't be able to find that hidden input field in order to...

I finally found the solution. They had extended PrimeFaces implemenation and incompletely implemented some methods. The following thread helped me in solving the problem: p:dataTable selections are lost after paginating a LazyDataModel

The root of the problem is value="#{instance.columnsData}" of p:columns. Using #{instance} variable of the p:dataTable in this case is a mistake. It works fine when page is loaded for a first time and when #{model.rows} is not empty. When the #{model.rows} is not empty and when we type a value...

As explained here: god bless stackoverflow My backing bean for login page initially had been managed by JSF. JSF had been initializing UIcomponent property. When I added a new managed property and configured its injection in spring security config I actually made my bean managed by Spring. Thus properties previously...

I'm guessing you need to bind the value of the checkbox by setting the value-attribute of the p:selectManyCheckbox tag. That way it has somewhere to store which of the possible items have been selected. See also http://www.tutorialspoint.com/jsf/jsf_selectmanycheckbox_tag.htm...

The action attribute is intented to execute a backing bean action method on click, not to print some JavaScript code (which of course get executed immediately You perhaps meant to use onclick or oncomplete instead. Like as in basic HTML, those on* attributes are intented to execute some JavaScript code...

<facet name="last"/> for stylesheets should only be used in <h:head/> that is where your stylesheets should end up anyway. If you load them last in your body, you can get weird manifestations in the look and feel of your ui. While loading and building the page and having some slower...

You use a managed bean with SessionScoped ? This keep the value unchange. I Recommand to you to read this : How to choose the right bean scope? If you want to keep using SessionScope and reset the selected rows you have to clean the selectedtype inside your bean ...

If you look at the documentation for this tag (here), you'll see that: url => Url to be navigated when menuitem is clicked. That's why your page reloads when you click an item. Probably removing this attribute will stop the reload action from happening. Then you'll probably want to use...

As stated by the Primefaces Extensions Showcase, something like this will do the trick: List<FilledMessageField> fields = new ArrayList<FilledMessageField>(); for (DynaFormControl dynaFormControl : model.getControls()) if (dynaFormControl.getData() instanceof FilledMessageField) fields.add((FilledMessageField) dynaFormControl.getData()); But just out of curiosity, why do you iterate over FilledMessageField f:allfieldMessageList, if you don't use f? You may aswell...

Converters basically serve to transform values in 2 directions: Server to client, when the value is rendered. Client to server, when the value is submitted. In your getAsString you established, that the string representation, the one which client uses, is exampleEntity's number. So that's what gets rendered to client as...

For that there is the PrimeFaces OutputPanel component, which basically acts as placeholder. Either you use autoUpdate true, or you update it on select. The following snippet solves your problem: <h:panelGroup id="name"> <p:outputPanel autoUpdate="true"> <p:inputText value="" rendered="#{user1.renderText}" /> </p:outputPanel> </h:panelGroup> ...

Actually I found a way to achieve this functionality. <h:form id="frmHierachiManage" styleClass="treeForm"> -- tree inside this form </h:form> then in the backing bean, RequestContext.getCurrentInstance().update("frmHierachiManage"); this updated the tree view....

You basically want to perform update=":search_users_form_id:users_table_id" only when the business service call has succeeded. You could achieve that by removing that attribute from the <p:commandButton> and performing it programmatically in the action method with help of RequestContext#update(). try { // ... RequestContext.getCurrentInstance().update("search_users_form_id:users_table_id"); } catch (Exception e) { // ... }...

1.Define two JSF inputHidden Fields say screenHeight, and screenWidth in your xhtml files 2.Calculate the computedHeight and computedWidth using javascript when page loads and store it into the hidden fields. 3.Automatically the value will be binded to the managedbean varaibles. 4.Write a method to return no of rows based on...

The outline is added to the li element because it picks up the .ui-tabs-outline class after being clicked on. You can override the outline property in the class instead: li.ui-tabs-outline { outline: none; } ...

Remove the trigger and add widgetVar to the p:blockUI component to be able to trigger it directly. <p:blockUI block=":Requests" widgetVar="blockUIVar"> Have your print button set a global js variable. <p:commandButton value="Print" id="Print" actionListener="#{hrd.updatePrint}" onclick="window.printClicked = true;"/> Check the variable state and trigger UI block if necessary at the start of...

The <p:dialog> supports the ajax close event. This only requires it being placed inside a <h:form> (on contrary to the general recommendation), so you need to make sure that it's already manually poisitioned to the very end of the <h:body> and that you don't make use of appendToBody. <h:body> <h:panelGroup...

I would rather go with the built-in Primefaces way of doing this. There is an ajax event called dateSelect which will fire when the date has changed: Calendar provides a dateSelect ajax behavior event to execute an instant ajax selection whenever a date is selected. If you define a method...

Never do business/controller logic in a getter method. Also not if that getter represents EL 2.2 direct method invocation. It's after all still a value expression which is only evaluated during generating the HTML output and writing the response body during render response phase. That moment is clearly too late...

This is indeed a little overcomplicated. In total 3 ajax requests to just perform an action and a backing component passing data forth and back via the view state. Your primary goal appears to be able to declare a bean action method as composite component attribute which should then be...

You're using the dataTable component in a wrong way. It just displays data in a tabular view and the only thing you're supposed to do, is to supply it with a Collection of model objects and explicitly tell which property from a model instance should be displayed under a certain...

It will be null in the action method when the browser is unable to send the file contents along with the request body, or when the server is unable to grab the file contents from the request body. In order to let the broswer send the file contents (and thus...

PrimeFaces doesn't support it. Any EL expressions in oncomplete attribute are immediately evaluated during render response of that HTML document, not during oncomplete of the associated ajax call. Your best bet is using RequestContext#addCallbackParam() to add a property to the PrimeFaces-specific args object which is available in oncomplete scope. RequestContext.getCurrentInstance().addCallbackParam("result",...

Ok, I was actually able to achieve the desired behavior but in a very unpleasant way. First of all, it seems that p:printer just takes a DOM element by an id from a xhtml page and passes it to a printer. So, to be able to print a full table...

Why are fields reset after ajax update with Primefaces This problem has 2 possible causes depending on the concrete functional requirement: It's because you didn't tell JSF to process the desired input values. Or, it's because you told JSF to also update the non-desired input values. The solution depends...

You need to fetch it while inside a transaction (thus, inside the service method), and not while outside a transaction (thus, inside e.g. JSF managed bean init/action method), that would thus throw a LazyInitializationException. So, your attempt hardware.getConnectivities().size(); has to take place inside a transaction. Create if necessary a new...

Which PrimeFaces version are you using? It's important because the way to pass parameters from a JavaScript function to a p:remoteCommand has changed in PrimeFaces 3.3. You will see the correct syntax in the following post: http://stackoverflow.com/a/18510102/2118909 but for your convenience here is the summary. From PrimeFaces 3.3 Passing Parameters...

That can happen when the updated model value is not null, but an empty string. You'd need to reconfigure JSF to interpret empty string submitted values as null to avoid the model being polluted with empty strings via below entry in web.xml. <context-param> <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name> <param-value>true</param-value> </context-param> Nonetheless, better use #{not...

This way I can loop through my list of objects, allocate that specific object of the row and change the value That effort is unnecessary. Just bind input component's value directly to the desired property. <p:selectOneMenu value="#{car.selectedValue}"> This way JSF will transparently do all that effort for you. If...

WAS ships with MyFaces out the box, yet you're attempting to override it altogether by providing Mojarra via the webapp, apparently without instructing WAS that it should load WAR-bundled JSF instead of WAS-bundled JSF. Get rid of javax.faces-2.1.9.jar (that's Mojarra). WAS as being a full fledged Java EE container already...