FAQ Database Discussion Community


WildFly 8.2 does not start project while Jboss 7.1 do

jsf,jsf-2,jboss,wildfly-8
My project originally developed under Jboss but if start it on WildFly there is only message in browser: "Not Found" and any errors. Is there something what I missed? web.xml mapping <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> index.jsp <jsp:forward page="./faces/index.xhtml" /> So it works on Jboss but does't on WildFly....

Inject Spring managed SessionFactory bean in a JSF managed bean

spring,jsf-2,dependency-injection
If I have configured Spring+Hibernate as below, <!-- Hibernate session factory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQL82Dialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">true</prop> <prop...

Is it possible to make JSF FacesServlet work with AspectJ?

maven,jsf,tomcat,jsf-2,aspectj
I'm trying to write sample application showing the intergration between JSF's FacesServlet running on tomcat and AspectJ. I've created two projects: 1) JSF project: pom.xml: <dependencies> <!-- JSF 2.0 dependencies --> <dependency> <groupId>com.pac</groupId> <artifactId>aspectj-lib</artifactId> <version>1.0-SNAPSHOT</version> </dependency> </dependencies> <build> <finalName>JavaServerFaces</finalName> <plugins> <plugin>...

Where does onPaste attribute of a textarea goes when JSF generates HTML code?

html,jsf-2
I have this inside a JSF page, <textarea id="textarea" rows="4" cols="50" onKeyPress="validate(event)" onPaste="validatepaste(event)"></textarea> The reason I am not using <h:inputTextarea> is because onPaste attribute seems to be missing with this JSF tag. When I debug my code in Google Chrome, I am surprised to find onPaste attribute is not there,...

Output data from database in JSF page

database,jsf,jsf-2
I am making a project using JSF, and I know how to get data from my view. I also know how to get data with the JDBC connector. And also how to put data in the view, from some objects, but my question is: How to put data directly from...

Putting inside a causes “weird” display

jsf-2,primefaces,panelgrid
I want to create dynamic forms with ajax update on event. Therefore dynamic-id is important. However, binding the id attribute to a bean value causes Empty Id exception. I saw one of the stackoverflow questions that suggests use html. So I used span. The xhtml code is as follows: <?xml...

Reusing ViewState value in other session (CSRF)

jsf-2,viewstate,jsf-2.2,myfaces
I'm using a *myfaces-api-2.2.3 with javax.faces.STATE_SAVING_METHOD set to client , I got the following scenario, 1) User X logs into the system and adds user XXX (using jsf f:ajax action) , while inspecting the chorme dev tools you can see the form that being submitted along with the ViewState value....

Navigating to another page JSF

jsf,jsf-2
I wrote a jsf application, this app inserts the data into mysql database and shows some of the inserted details in another page. I am successful in inserting the values into database, but unable to redirect to the other page even after writing the navigation rule. My action code <div...

What URL to use to link other JSF pages in a JSF project

jsf,url,jsf-2,hyperlink
I am confused about how to link between files in a Java Server Faces project, when some of the files are in sub-folders. (I was going to attach screenshots so you can see the Nebeans project view, and files view of the example I am trying.... but I'm not allowed...

Change default color of a popupPanel?

jsf-2,richfaces
I have a popupPanel: <rich:popupPanel id="popup" modal="false" autosized="true" resizeable="false"> <f:facet name="header"> <h:outputText value="Simple popup panel" /> </f:facet> <f:facet name="controls"> <h:outputLink value="#" onclick="#{rich:component('popup')}.hide(); return false;"> X </h:outputLink> </f:facet> <p>Any content might be inside this panel.</p> <p> The popup panel is open and closed from the javascript function of component client side...

Arguments against a generic JSF object converter with a static WeakHashMap

jsf,jsf-2,converter
I want to avoid boiler plate code for creating a list of SelectItems to map my entities/dtos between view and model, so I used this snippet of a generic object converter: @FacesConverter(value = "objectConverter") public class ObjectConverter implements Converter { private static Map<Object, String> entities = new WeakHashMap<Object, String>(); @Override...

Using ui:repeat to iterate over columns

jsf,jsf-2
I'm in Mojarra 2.1.29. I tried to iterate over the collection to produce amount of rows equals to the size of the collection. Here what I've tried: <rich:dataTable id="table" var="partner" rows="10" value="#{testBean.k}"> <ui:repeat var="name" value="#{testBean.cols}"> <rich:column> <f:facet name="header"> <h:outputText value="#{name}"/> </f:facet> <h:outputText value="#{m.get(partner)}"/> <f:facet name="footer"> <h:outputText value="#{name}}"/> </f:facet> </rich:column>...

In Primefaces picklist, how to find that an item is moved from TARGET to SOURCE, Using Omnifaces Converter

jsf,jsf-2,primefaces,omnifaces
I have looked around and could not find a solution. I am using Omnifaces listConverter in the PickList component of Primefaces. When I move an item from SOURCE to TARGET. In the backing bean i get the new item ONLY on dualList.getTarget(). However when I move an item from TARGET...

Update component in a different window/tab without manually refreshing it

forms,jsf-2,primefaces,commandbutton
I have different pages with different layouts, for example index.xhtml and user.xhtml, each page has it's own template. If I make a change in user.xhtml I want to update a datatable in index.xhtml. index.xhtml: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:p="http://primefaces.org/ui"> <ui:composition template="/template.xhtml"> <ui:define name="body"> <h:form id="indexFormId">...

Unable to locate plain HTML element from

html,ajax,jsf,jsf-2
I have table that display equipments. There is a button below to enter page number for pagination. when click on that button ajax call updates the tableId table. But I have an error <f:ajax> contains an unknown id 'tableId' Can't I refer table ID from ajax update? if not what...

Progress bar image without ajax

jsf-2
I want to show a progress bar when a button is clicked, and remove it when the page is refreshed. So I have a h:pannelGroup: <h:panelGroup id="progbarb"> some progress bar image </h:panelGroup> My h:commandButton is inside a h:form: <h:commandButton id="nextButton" value="Next" action="#{searchResults.searchForProducts()}" render="progbarb" /> My searchForProducts method simply updates a...

How to generate a component multiple times in JSF?

google-maps,jsf-2,gmaps4jsf
I need to highlight the boundary of a country, for which I am using GMaps4JSF aimed at integrating Google maps with JSF. To draw polygon and polylines, the library provides polygonComponent polylineComponent components. I have loaded the data points from the fusion tables into our own DB. <m:map width="1000px" height="500px">...

h:inputText allow only numbers during input [duplicate]

jsf-2,numbers,richfaces
This question already has an answer here: HTML Text Input allow only Numeric input 43 answers I have a field in JSF2, I tried execute a validation in this way: <h:inputText value="#{manutencaoContratoBean.contrato.nuContrato}" style="text-align: left; width: 90%; "> <f:convertNumber pattern="#######" maxFractionDigits="0" maxIntegerDigits="16"/> And thus: <h:inputText value="#{manutencaoContratoBean.contrato.nuContrato}" style="text-align: left; width: 90%;...

Access particular row of p:datatable in Backing Bean on click of h:CommandLink without binding attribute

jsf,jsf-2,primefaces,datatable
Please find my code below for p:datatable having h:commandlink as one of its column: <p:dataTable id="listTable" value="#{listBean.lazyDatalist}" var="list" paginator="true" paginatorPosition="top" rows="10" rowIndexVar="rowIndex" rowStyleClass="#{(rowIndex mod 2) eq 0 ? 'rowStyleOdd' : 'rowStyleEven'}" lazy="true"> <p:ajax event="page" listener="#{listBean.searchLazyData}"/> <p:column style="width:3%;" headerText="#{msg['userlist.dt.srNo']}"> <h:outputText value="#{list.orderCount}"></h:outputText>...

Tel Number visualization patern - space after each 2 number

validation,jsf-2,primefaces,data-visualization
I have an Editabe Datatable. After user inserts the tel number in tel column which is an input textbox, and the ok is clicked, I need to visualize it as the following: INPUT 390239266655 OUTPUT +39 02 39 26 66 55 so i need to put a space after each...

How do UISelectOne and UISelectMany components preselect defaults in f:selectItems

jsf,jsf-2,primefaces,selectonemenu,selectmanymenu
I know how to preselect <p:selectOneMenu>, in selected value should be one of the objects from <f:selectItems>, but how does this component work under the hood and can I change this behavior? In my case I've a duplicate object, actually this is two objects with the same values but created...

/ UI Layout Initialization Error The center-pane element does not exist. The center-pane is a required element

jsf-2,primefaces
I am new to stackoverflow and also this my very first question to this forum so if i am doing something wrong when i am posting here please let me know. my question related to primefaces i tried with lot of solution but nothing work for me. i am using......

CDI Bean member loses value during request

jsf-2,primefaces,cdi
I have years of experience developing JSF applications, but this is a confusing bug, which is driving me insane. I think I need a fresh pair of eyes to find the possible error. First off, the details about the environment: JDK: 8u40 Server: WildFly 8.2.0.Final Libs: CDI 1.2, JSF 2.2,...

JQuery , On Enter key code 13 (a button is triggered ), this works only the first time but not afterwards

jquery,jsf-2
I have a modal which has a text box and a commandButton. Once I enter the value into the text and press Enter commandButton is triggerd. This functionality works the first time i.e. when i enter text and press enter, button is triggered and modal stays Now when i enter...

JSF rendering popup frow a manegbean condition?

jsf,jsf-2,popup,richfaces
I´m using this for show a message in login when a error happens: <a4j:region rendered="#{usuario.fail == 1}"> <div class="alert alert-danger alert-dismissable" style="width: 470px; margin: 10px auto;"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> Invalid user or password. </div> </a4j:region> But, I want to show a popup, however, this is not working, i'm...

Setting f:setPropertyActionListener value with a f:param value

jsf,jsf-2,param,setpropertyactionlistener
I'm trying to use the setPropertyActionListener tag to set a value in my backing bean. However, it doesn't work as I expected. Context: userService is an instance of my backing bean, which contains an int member, reqID. This, in turn, is the key to a map of objects that belong...

Re-create session scoped JSF managed bean programmatically

jsf,jsf-2,managed-bean,session-scope,recreate
I'm using Mojarra 2.1.29 and have a session scoped JSF managed bean @ManagedBean @SessionScoped public class UserContext{ //staff } and a spring bean: public class UserReproducer{ private User user; public void reporoduce(){ if(user == null){ //Here I need to recreate the userContext managed bean //do some other staff } }...

How to pass a method name to actionListner

jsf,jsf-2
I need your help in passing the proper method to the button actionListner. I am having a button in a datatable. The button code is below: <h:commandButton id="submitButton" value="View" actionListener="#{bcd.showDatailDialog}" > <f:setPropertyActionListener value="#{c}" target="#{bcd.selectedRequest}"/> </h:commandButton> Based on the value of the #{c.documentType} which is displayed in the datatable, it will...

javax.el.MethodNotFoundException: /home.xhtml @36,93 action=“#{booksBean.search}”

jsf,jsf-2,methodnotfound
I am going to create a search field in JSF page: <h:form id="searchForm"> <p:inputText id="srchF" value="#{booksBean.searchKeyword}"/> <p:watermark for="srchF" value="Enter Book title..." /> <h:commandButton value="search" action="#{booksBean.search}" /> </h:form> (I have another form tag on this page for other components) And Here is the booksBean.search() method: private String searchKeyword; private List<Book> searchBookList;...

Omit validation for p:selectOneMenu, for Ajax requests

jsf,jsf-2,primefaces
I have a Jsf page with a fragment with <p:selectOneMenu/> (Prime faces) and an Ajax associated with it. It have the default select item "--- Select One ---" and others items that were created dynamically. This field is required, so if users submit the form without select, the page show...

unable to download mojarra for jsf

jsf-2,mojarra
Earlier I was also getting an empty library Eclipse Download library is empty I got the library after making the Network mode as "Manual" and setting the proxy but I am unable to Download it, after Accepting the License it gives Transfer Failed: java.net Please help...

Component rendering problems with primefaces in eclipse for JSF [duplicate]

jsf,jsf-2,primefaces
This question already has an answer here: JSF returns blank/unparsed page with plain/raw XHTML/XML/EL source instead of rendered HTML output 1 answer I'm trying to work on primefaces. when i am trying to run a xhtml page individually in my eclipse IDE, All the primeface elements included in my...

findComponent by id in PrimeFaces 3.4 JSF 2.0

jsf,jsf-2,primefaces
I want a method which finds a UIComponent by id in PrimeFaces 3.4. I already found a method to do this but it has a method visitTree(available in PrimeFaces 5.2) which is not available for PrimeFaces 3.4. Please can someone help me find panel object in below XHTML. <html xmlns="http://www.w3.org/1999/xhtml"...

Avoid datatable update in case of error during record edition (JSF + Primefaces)

jsf,jsf-2,primefaces,datatable
I have a web-app in JSF 2.1 + Primefaces 5.1. I have a datatable with selectable rows. When I select a row and press the Edit button, a dialog opens to allow the user to edit the values of that record. When the user presses the dialog's Save button, a...

Call specific JavaScript function when specific item of h:selectOneMenu is selected

javascript,ajax,jsf-2
I have with ajax <h:selectOneMenu> <f:selectItem itemLabel="please click"/> <f:selectItem itemLabel="1"/> <f:selectItem itemLabel="2"/> <f:ajax onevent="click()" /> </h:selectOneMenu> I have with onChange <h:selectOneMenu onChange="click()> <f:selectItem itemLabel="please click"/> <f:selectItem itemLabel="1"/> <f:selectItem itemLabel="2"/> </h:selectOneMenu> if I try the same attributes to selectItem, it doesnt work. I think they dont exist. I used ajax, onChange...

Render Panel on ajax start - JSF

ajax,jsf,jsf-2,richfaces
After processing I can render a panel in JSF like <a4j:commandButton id="myButton" render="panelId" .... ></a4j:commandButton> But what if I want to render a panel before sending the request, something like <a4j:commandButton id="myButton" onbegin="panelId" .... ></a4j:commandButton> Is there any way to do this?...

Primefaces push

jsf-2,primefaces
I would like to use 'primefaces push' in my web application to receive notifications. I would like that a user could receive notifications depending on the groups he belongs to. Every user can belong to several groups, for example: User X belongs to Group A and B. User Y begong...

Replace spaces with nonbreakable spaces in JSF [duplicate]

html,css,jsf,jsf-2
This question already has an answer here: JSF 2.0 component to interpret String with HTML code 1 answer I need some JSF 2.1.29 advise. I have the following using of the bean's property: #{someBean.someProperty} Where #{someBean.someProperty} returns 7 8 (note the number of spaces between the digits). And in...

Primefaces's dialog 'appendTo' property, what it useful for?

jsf-2,primefaces
Maybe it's a dumb question, but in Primefaces's <p:dialog> there's property which called appendTo which described in manual as: Appends the dialog to the element defined by the given search expression. I can't realize what it useful for? ...

binding on p:dataTable which is included multiple times causes ID unqiueness exceptions

jsf-2,primefaces,binding,datatable,facelets
I'm attempting to use a special PrimeFaces data exporter implementation as being used in this answer: http://stackoverflow.com/a/14413932/396732 Our use case however is a little more complex, e.g. using Facelets to show the respective datatable for export, which has row expansions with sub tables in them. insiderListManagerDialogs.xhtml: <ui:include src="insiderListManagerListDialog.xhtml"> <ui:param name="idPrefix"...

Get p:dataTable row data via p:selectOneMenu

jsf-2,primefaces,datatable,row,selectonemenu
I have a dataTable which one of the columns contains a selectOneMenu (a.k.a dropDownList). Basically each row has a selectOneMenu which has a list of values. Is there a posibility to pass the row data or key whenever the selectOneMenu value has been selected? This way I can loop through...

Trying to call ajax listener method via onevent=“#{checkIfUsernameAvailable}”

ajax,jsf,jsf-2
I have a jsf page and an input field. When the event of this input field being blurred, I would like the method checkIfUsernameAvailable() of my ManagedBean to be called. Then the image should be rendered. The problem is that that method is either never called or just not found,...

Hide primefaces overlaypanel from managed bean failed

jsf,jsf-2,primefaces
I have a primefaces overlay panel in my form and intention is to control the overlay panel visibility from managed bean, so i have set widgetVar to overlay and when try to hide the overlay panel from managed bean its throwing error <p:overlayPanel id="imagePanel" for="input_ac" widgetVar="overlaypanel" showEvent="keypress" hideEffect="fade" > <p:outputLabel...

primefaces treetable expand not working if jsf page location is changed

spring,jsf,spring-mvc,jsf-2,primefaces
Primefaces treetable expands if my xhtml webpage is in WebContent Folder but it doesn't expand if I move the same webpage to WEB-INF/views/jsf folder. I'm very new to JSF and I don't know where and what to change. If my webpage is in WEB-INF/views/jsf folder only the root node is...

Path to a file up in the hierarchy

jsf,jsf-2,navigation
Here is file structure of my JSF application. User directory is secured & one needs to authenticate to see user/success.xhtml. user/success.xhtml has a button which is used to logout. That button submits form to following method. public String logout(){ HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false); session.invalidate(); return "index"; } Last line of...

disable/ enable primefaces components

jsf-2,primefaces
I want to disable some primefaces components after a selection from p:selectOneMenu but when I choose no selection option it still disabled <p:outputLabel value="Manager" style="color:white;font-weight: bold;" /> <p:selectOneMenu id="manager" value="#{employeeMB.selectedManager}" immediate="true"> <f:selectItem itemLabel="Selectionner..." noSelectionOption="true"/> <f:selectItems value="#{employeeMB.managers}" /> <p:ajax update="managerSelect role" /> </p:selectOneMenu> <p:outputLabel value="Est un...

Dynamic rendering - unable to find component with clientId

jsf-2,primefaces
I am rendering a xhtml to a dialog whose components are added dynamically from server side using Dynamic example. Using PrimeFaces 5.1, JSF 2.1 Mojarra and tomcat 7. When i click the close button of the pop up a large number to of unable to find the component is being...

how to select a all the checkboxes by a single checkbox in jsf

jsf-2
I am trying to check all the checkboxes using Jsf but it is not able to checking.I have written code like this....If i select a checkbox in the header section all the checkboxes need to be selected. <h:selectBooleanCheckbox id="c1" value="#{user.check}"></h:selectBooleanCheckbox> <h:outputText value="name">name</h:outputText> <h:outputText value="age">Age</h:outputText> <h:selectBooleanCheckbox id="c2"></h:selectBooleanCheckbox> <h:outputText value="A">A</h:outputText>...

Prevent home (welcome file) URL from changing to full URL when submitting a JSF form

jsf,jsf-2,friendly-url
I've a welcome file <welcome-file-list> <welcome-file>configurationClass.xhtml</welcome-file> </welcome-file-list> It is opening properly on start with url "http://127.0.0.1:8080/fav/". Then in my page, i am having a sortable table which is calling to a method sortFavs() present in my class. And i am returning null from server method. So url is changing to...

Error Omnifaces 2.0 o:massAttribute with o:validateOrder

jsf-2,richfaces,omnifaces
Hi Im having this error when i try to combine o:massAttribute with o:validateOrder, i saw that o:validateOrder had the attribute disabled, any ideas what is causing this issue. I have this code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:f="http://java.sun.com/jsf/core"...

Preprocess/postprocess a bean action method from p:remoteCommand inside composite

jsf,jsf-2,primefaces,action,composite-component
I have the following scenario: JSF composite component with complex JavaScript, which I'd like to refresh partially by JavaScript with a new values from a backing bean (backing bean of a page which uses this composite component, not backing component @FacesComponent). I don't want to make full update because it's...

jsf: redirecting from bean on primefaces ajax event

ajax,jsf-2,primefaces,url-redirection
I have this selectable PrimeFaces Tree with an Ajax listener on selection in my index.xhtml: <p:tree value="#{seccionesArbolView.root}" var="node" selectionMode="single" > <p:treeNode> <h:outputText value="#{node.nombre}" /> </p:treeNode> <p:ajax event="select" listener="#{seccionesArbolView.onNodeSelect}"></p:ajax> </p:tree> The listener method is on a session scoped named bean, and should redirect to another page (grupal.xhtml) with some GET parameters....

Primefaces validation not working

jsf,jsf-2,primefaces
I am working on a form, where i am using primefaces. When i validate an inputtext, then ajax message is working for only for field and not for the others, please, check my code below. <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"...

How to disable all components for the same type in a JSF page

jsf,jsf-2,disabled-control
I have let's said 4 pages who are dynamically included by a for like this: <c:forEach items="#{tareaController.mfuncionesAsociadas}" var="mFuncion" varStatus="loop1"> <p:tab id="t_funcion_#{loop1.index}" title="#{mFuncion.nombre}" > <f:subview id="tab_#{loop1.index}"> <p:panelGrid id="pg_funcion_#{loop1.index}"> <ui:include src="#{mFuncion.paginaFuncion}"></ui:include> </p:panelGrid> </f:subview> </p:tab> </c:forEach> I want to do the following: on every page I generate could be...

Can I pass a custom parameter based on JSF event, as parameter to oncomplete function in p:ajax?

jsf,jsf-2,primefaces
I will try to explain myself: This is code: <p:ajax event="eventResized" process="@this calendar" listener="#{bean.eventResized}" oncomplete="resizeComplete()"/> eventReized invoked by EventResizeBehavior which extended from AjaxBehaviorEvent and it contains some property. Can I check inside <p:ajax....> call its value and pass result to oncomplete="resizeComplete(result)" Something like that <p:ajax event="eventResized" process="@this calendar" listener="#{bean.eventResized}" oncomplete="resizeComplete(#{eventResized.id...

JSF tag not rendering my form after submitting

ajax,jsf,jsf-2
I am trying to render my list of elements after invoking my Managed Bean action which is deleting one of those elements. Here is my jsf page code: <div class="container"> <div class="starter-template"> <h:form id="productslist"> <div class="row"> <ui:repeat value="#{listProductsManagedBean.products}" var="product"> <div class="col-md-4"> <h1> <h:outputText id="outputname" value="#{product.name}"/> </h1> <p> <h:outputText id="outputprice" value="#{product.price}...

JSF 2 - Independent locale settings for different pages

java,jsf-2,locale
I've followed this tutorial to support internationalization in my JSF web application. I have now a page that should have its own language, independent from the other pages language. The problem is that changing the locale from this page changes also the locale of the others pages (and the other...

Show global faces message only in first h:messages component

jsf,jsf-2,messages
I have two global message components in one JSF page: This <h:messages id="msg1" layout="table" globalOnly="true" showDetail="true" showSummary="false"/> And this: <h:messages id="msg2" layout="table" globalOnly="true" showSummary="true" showDetail="true"/> The first one is initiate here: FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "", "No result")); And second message initiated here: FacesContext.getCurrentInstance().addMessage(null, new...

Primefaces: Dialog with inputTextarea not updating controller's variable

jsf,jsf-2,primefaces
I have this Dialog: <p:dialog header="Ingrese Comentario" widgetVar="dlg1" appendTo="@(body)" modal="true" position="top" hideEffect="fold" showEffect="fold" closable="true" draggable="true" > <h:form id="d_ingresarComentario"> <h:panelGrid columns="2"> <p:inputTextarea value="#{tareaController.comentarioNuevo.comentario}" rows="7" cols="60" placeholder="Ingrese su comentario aquí" counter="display1" maxlength="200" counterTemplate="{0} Caracteres faltantes." > </p:inputTextarea> <br/>...

Every include should refer to other instance

jsf,jsf-2,reference,uiinclude
I include a part of the XHTML page to my Web Application. This part can be included multiple times. And that's the problem! Because every include refers to the same java object. That means that every element has the same value. But I want for each include a new Java...

Primefaces keyboard component doesn't set value in backend

java,jsf-2,primefaces
i am using the primefaces keyboard to search for some articles in the application. My problem is that i have a commandButton that goes to a method in the managed bean which does the search. When arriving in the managed bean the string assigned to the keyboard component is empty....

Get to specific book using hyperlink in JSF [duplicate]

jsf,jsf-2
This question already has an answer here: Creating master-detail pages for entities, how to link them and which bean scope to choose 1 answer I have a very strange situation here. I have made my application in JSF and it looks just great, however I am not quite sure...

Primefaces datatable get selected row as type arrayList [duplicate]

jsf,jsf-2,primefaces,datatable
This question already has an answer here: toString java of arrays 4 answers Here is my table in primefaces datatable: (I'm using hibernate to get table rows) code: <f:event type="preRenderView" listener="#{myCardBean.userCard(userBean.currentUser.id)}"/> ... <p:dataTable id="books" value="#{myCardBean.booksList}" var="book" selectionMode="single" selection="#{myCardBean.selectedOrder}" rowKey="#{book[0]}"> <p:ajax event="rowSelect" listener="#{myCardBean.onRowSelect}"/> <p:ajax event="rowUnselect"...

disable two controls using one radio box in JSF Primefaces

jsf,jsf-2
I have to disable two controls on the page using one pair of radio buttons I have the following code: <p:selectOneRadio id="console" binding="#{yesOrNo}" required="true">}"> <f:selectItem itemValue="Yes" itemLabel="UPLOAD CLR" /> <f:selectItem itemValue="No" itemLabel="ORDER NUMBER" /> <p:ajax update="yesdata" /> </p:selectOneRadio> <p:fileUpload id="yesdata" fileUploadListener="#cBean.handleFileUpload}" label="Upload NC CLR" mode="advanced" multiple="false" update="createConfigPanel" auto="true"...

PanelGrid column classes

jsf,jsf-2
I have problem in columnClasses tag of h:panelGrid I have a panel grid with two columns: <h:panelGrid columns="2" columnClasses="rp1,rp2"> <h:message id="pass1Msg" for="pass1"/> <h:inputSecret id="pass1" value="#{accountBean.pass1}" required="true"> <f:validateLength maximum="20" minimum="4"/> <f:ajax event="blur" render="passwordMsg"/> </h:inputSecret> <p:watermark for="pass1" value="Enter new password..."/> <h:message id="pass2Msg" for="pass2"/> <h:inputSecret id="pass2"...

Perhaps your web.xml contains a typo? omnifaces 1.8.1

jsf-2,web.xml,omnifaces
I am using Omnifaces 1.8.1 and I got this error while starting Tomcat 7 WebXml failed to initialize. Perhaps your web.xml contains a typo? java.lang.ClassNotFoundException: at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.omnifaces.config.WebXml.parseErrorPageLocations(WebXml.java:434) at org.omnifaces.config.WebXml.init(WebXml.java:147) at org.omnifaces.facesviews.FacesViewsInitializerListener.contextInitialized(FacesViewsInitializerListener.java:63) at...

How to display PDF in JSF, with content from ServletResponse

jsf,pdf,jsf-2,richfaces
In my application, I use jsf & richfaces, I want to display a generated pdf in web browser , I have generated this PDF in serverside and it is available in ServletResponse, but I am unable to display it in my web page. I have tried this question but, it...

index.html change to index.xhtml

jsf-2,url-rewriting
When trying to logout my application I'm having the following error message : com.sun.faces.context.FacesFileNotFoundException: /index.xhtml Not Found in ExternalContext as a Resource To logout I'm going though the following steps inside PhaseListener.beforePhase(PhaseEvent phaseEvent) : // Redirect to index.html NavigationHandler nh = fctx.getApplication().getNavigationHandler(); String action_outcome = "/index.html"; nh.handleNavigation(fctx, null, action_outcome); My...

How to get value from Map in item label

jsf,dictionary,jsf-2,selectonemenu
Below is the jsf code <h:selectOneMenu> <f:selectItems value="#{bean.mapObject}"var="entity" itemValue="#{entity.key}" itemLabel="#{entity.value.code}"/> </h:selectOneMenu> Backing bean has map defined as private Map<TestClass, Object> mapObject; TestClass has two variables and getters/setters String code; String name; Issue I am having is : On JSF, on Selectonemenu, for itemLabel i would like to display the TestClass...

Execute a script on f:ajax “success” event only when validation has not failed

javascript,ajax,jsf-2,event-handling,composite-component
I have created a composite component that extends the command button and add some ajax functions (onBegin, onComplete and onSuccess), but I have some problems that I couldnt solve: When I click on the button and a validation error occur, in success event function is passed #{facesContext.validationFailed} = false instead...

Primefaces datatable duplicate “No records found” while doing column freeze for empty records

jsf,jsf-2,primefaces,datatable
I am using primefaces <p:datatable> to freeze some of my columns.Everything is fine but when there are no records in then it gives two "No records found" message.This is weird situation.Do anyone have come across this problem? Suggestions are welcome.I want only one "No records found " message. <p:dataTable var="car"...

@ManagedBean(name=“foo”) not available by its name in EL #{foo}

jsf,jsf-2,managed-bean
I'm trying to use an application scoped bean in JSF2, but for some reason it is always null in my request scoped bean. Here's the code I'm using: The application scoped bean: @ManagedBean(eager=true, name="applicationTracking") @ApplicationScoped public class ApplicationTracking implements Serializable { private static final long serialVersionUID = 4536466449079922778L; public ApplicationTracking()...

OmniFaces UnmappedResourceHandler seems to leak resources when composite components are used

jsf-2,memory-leaks,composite-component,omnifaces,unmappedresourcehandler
It seems UnmappedResourceHandler is loading composite components xhtml files within the resources folder. The result seems a gradually increasing memory leak. The leak can be found within FaceletViewHandlingStrategy.metadataCache. It relies on a hashmap and when above handler is used UnmappedResources are used as the key for CompositeComponentBeanInfo instances. If the...

Stuck thread at UIComponent.popComponentFromEL

multithreading,jsf,jsf-2,primefaces,components
My application uses JSF 2.1 with PrimeFaces. Recently, very high CPU Utilization was observed because of some stuck threads. The stuck thread dump for all stuck threads pointed to javax.faces.component.UIComponent.popComponentFromEL like below: javax.faces.component.UIComponent.popComponentFromEL(UIComponent.java:1934) javax.faces.component.UIComponent.visitTree(UIComponent.java:1633) javax.faces.component.UIComponent.visitTree(UIComponent.java:1623) org.primefaces.component.api.UIData.visitRows(UIData.java:741)...

f:convertNumber unexpectedly increments/decrements float value

jsf,jsf-2,floating-point,converter
I have a float property bound to <h:inputText>. For long values, it was automatically converting the values to exponential notation. I tried to use <f:convertNumber> to avoid the exponential value presentation. The value can be of two given below. Format 1: <18 digits> Format 2: <14 optional digits>.<3 option decimals>...

Using in center facet of

jsf,jsf-2,facelets,oracle-adf
I moved from JSF 1.2 using JSP to JSF 2.1 using Facelets. I use oracle ADF Faces as component library. The layout of my main page doesn't work anymore with Facelets. Here is my layout : <af:form id="mainForm"> <af:decorativeBox theme="medium" styleClass="AFVisualRoot"> <f:facet name="center"> <!-- Main page --> <af:panelStretchLayout topHeight="35" bottomHeight="20"...

ajax validation error message [duplicate]

ajax,jsf,jsf-2,primefaces
This question already has an answer here: Custom JSF validator message for a single input field 1 answer how to add my own message for the client side validation in JSF. <div class="ui-grid-row"> <div class="ui-grid-col-3" align="left"> <h:outputLabel for="cmpny" value="Company Name:" style="font-weight:bold" /> </div> <div class="ui-grid-col-2"> <p:inputText id="cmpny" value="#{userData.cmpny}"> <f:validateLength...

How to specify styles for h:panelgrid in jsf

css,jsf,jsf-2
I using a simple h:panelGrid for displaying the table how could i specify styles for the table to make it better. i am a bit confused with all the stuff i looked online This is what the code that i have been using <h:panelGrid id="panel" columns="2" cellpadding="10" cellspacing="1" style="align:center;"> <f:facet...

Select a row in jsf datatable

jsf,jsf-2,datatable
Here is my table: <h:dataTable var="book" value="#{ordersBean.userOrders}" binding="#{ordersBean.htmlDataTable}"> <h:column> <f:facet name="header">order ID</f:facet> <h:outputText value="#{book[0]}"/> </h:column> <h:column> <f:facet name="header">Book Title</f:facet> <h:outputText value="#{book[1]}"/> </h:column> <h:column> <f:facet name="header">Cost</f:facet> <h:outputText value="#{book[2]}"/> </h:column> <h:column>...

h:selectmanyListbox make “choose” option unselectable when at least one option is selected

jsf,jsf-2,selectmanylistbox
Is it possible to have in <h:selectManyListbox> a default option like "--choose--" which can be selected when no option is selected. When the some value is chosen, then it must be unselectable. <h:selectManyListbox value="#{bean.value}" class="form-control"> <f:selectItems value="#{bean.dropdownValues}" var="value" itemLabel="#{value}" itemValue="#{value}"/> </h:selectManyListbox> ...

Parameters from f:param not submitted with AJAX request when form enctype is multipart/form-data

ajax,jsf,jsf-2,jsf-2.2,wildfly
I'm running Wildfly 8.2 and I'm using the JSF version bundled with it, 2.2.8-jbossorg-1. I have the following facelet: <h:form enctype="multipart/form-data"> <h:commandButton value="Submit"> <f:param name="myparam" value="true"/> <f:ajax execute="@this" render="@this"/> </h:commandButton> </h:form> When I press the submit button, several parameters are submitted, but not myparam. If I remove enctype="multipart/form-data" from the...

Display bean value in jsf page

java,jsf-2
Here is my LoginBean: @ManagedBean @ViewScoped public class LoginBean implements Serializable { private String email; private String password; private LoginBean currentUser; CustomerService customerService = new CustomerService(); public String login() { currentUser = customerService.findCustomerByUserPass(email, password); if (getCurrentUser() != null) { username = customerService.getCustomerUsername(email);// i want to display this in xhtml page...

JSF 2: Stop rendering if validation fails [duplicate]

ajax,jsf-2,primefaces
This question already has an answer here: Can I update a JSF component from a JSF backing bean method? 1 answer JSF validate on submit form 1 answer I'm using primefaces. I have a form and a dataTable with a lazyModel, in the dataTable I show the results found...

How to access column values in datatable by using ajax? [duplicate]

ajax,jsf,jsf-2
This question already has an answer here: How can I pass parameter of current row to commandLink inside dataTable? 4 answers I need your help in getting the column values by using the onclick event of the selected row through ajax listener. The datatable code is: <p:dataTable id="availableCars" var="car"...

javax.faces.FacesException: Expression Error: Named Object: myConverter not found

jsf-2,primefaces
I believe I'm wiring all things correctly, but the converter still won't be recognized in my xhtml where I have this following code: <p:selectOneMenu ... value="#{myBean.myObject}" converter="myConverter"> ... </p:selectOneMenu> where myConverter is the converter I'm using to perform the Object - String and String - Object conversions on myObject object...

How to pass a value on selected row change?

jsf-2,richfaces
I have this permanent problem, I have a Datatable with value="#{myBean.Items}" var="itms", and I want to pass the selected item to my bean class. In columns, we use <f:setPropertyActionListener value="#{itms}" target="#{myBean.selectedrow}" /> to pass the value, but I want it for Rows. How to do that?, and where to put...

Reference a PrimeFaces image resource as CSS background image url

css,jsf-2,primefaces
A bit new to the JSF and PrimeFaces and here I am, trying to load a resource (an image to be specific) and use it as a button's background, like this: .greenButton { background: url(#{resource['images:ui-bg_gloss-wave_50_6eac2c_500x100.png']}); } and <h:outputStyleSheet library="css" name="customStyles.css" />, but it always resolved to: .greenbutton { background: url("")...

primefaces qr code not shown?

java,maven,jsf,jsf-2,primefaces
I am using primefaces to develop a web app.I am trying to show the bar code on mhe webpage.All coders are shown except the QR code.I have read that two jar files are required for this barcode4j: 2.1 qrgen: 1.4 I have added these jar files in the lib folder...

How to put data in view scope via EL in JSF page

jsf,jsf-2,el,facelets,view-scope
In my JSF page this works: ${requestScope.put('test', 'data')} ${requestScope.get('test')} This causes exception: ${viewScope.put('test', 'data')} ${viewScope.get('test')} Exception: java.lang.NullPointerException javax.el.BeanELResolver.invoke(BeanELResolver.java:159) javax.el.CompositeELResolver.invoke(CompositeELResolver.java:84) org.apache.el.parser.AstValue.getValue(AstValue.java:157) org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)...

Double dispatching in jsf

jsf,jsf-2
Is it possible in Mojarra-2.1. If I do dispatching to another view from the action method by clicking action buttons: <h:commandButton value="dispatch" action="#{myBean.action()}" /> The bean: @ManagedBean @RequestScoped public class MyBean{ public String action(){ //do some return "view"; } } my browser then recieve the content of the view view....

Why are fields reset after ajax update with Primefaces

ajax,jsf-2,primefaces
On a form I have some personal information (name, address etc.) and a changeListener which updates the salutation and letter salutation according to the gender and last name. If the underlying entity was already stored in the database it works fine. If I'm entering data for a new (not saved)...

How to do ThemeSwitcher using Primefaces

jsf,jsf-2,primefaces
This is the demo that i'm trying to do. http://www.primefaces.org/showcase/ui/misc/themeSwitcher.xhtml My HTML code: <h:form > <h:panelGrid columns="2" cellpadding="10"> <h:outputText value="Basic:"></h:outputText> <p:themeSwitcher effectSpeed="normal" effect="fade" style="width:165px" id="defaultSwitcher" value="#{themeSwitcherBean.theme}"> <f:selectItem itemLabel="Choose Theme" itemValue="" /> <f:selectItems value="#{themeSwitcherBean.themes}" /> <p:ajax global="false"...

Unable to load class javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects

eclipse,jsf-2,tomcat7
when i run my project an error occurs this is the stack : mai 05, 2015 4:39:22 PM org.apache.catalina.startup.ContextConfig checkHandlesTypes WARNING: Unable to load class [javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects$6] to check against the @HandlesTypes annotation of one or more ServletContentInitializers. java.lang.ClassNotFoundException: javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects$6 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678) at...

Liferay Inter Portlet Communication in JSF 2.0

jsf,jsf-2,liferay,communication,portlet
I'm developing liferay jsf portlet application and using liferay plugin sdk 6.2.0 and primefaces. I have two portlets in same portlet plugin project. I can do IPC with public render parameters but they should be same portal page. I tried to event mechanism but I couldn't succeed. Receiver event didn't...

How to avoid displaying of FacesMessage multiple times?

jsf-2
I need to display a FacesMessage for this component as shown below, The issue is that it is displayed on the UI multiple times as shown below, Secondly, the date entered was 40.06.2015 which is invalid, hence the FacesMessage, but it got converted into 10.07.2015. I have no idea how...

How to Trigger an AJAX call in JSF from Javascript and avoid using global functions as callback handlers?

ajax,jsf,jsf-2,myfaces,ajax4jsf
I want to move the JSF AJAX triggering code written with f:ajax, f:event and the h:commandLink (with its action attribute) to Javascript by using the jsf.util.ajax. - Why ? Because to avoid globally written handler functions to handle call backs. We are migrating the JS code to AMD Require JS...

Hide all primefaces blockui elements

jsf,jsf-2,primefaces,blockui
I have a lot of .xhtml views. Many of them have blockui elements, for example: <p:blockUI block="tab" widgetVar="subscriberSelectBlocker"> </p:blockUI> Sometimes there are more then 1 of them per view. To hide the blockUI above I have a method in the according bean SubscriberFilterBean.java: public void hideSubscriberSelectBlockUi() { RequestContext.getCurrentInstance().execute("subscriberSelectBlocker.hide()"); } Now...

How to disable JSF components programmatically

jsf-2,richfaces
We have a JSF application with <rich:tab> which shows fields depending of some configuration stored in a database, so the components are not defined in the .xhtml page but have to be generated programmatically such in this example: Components are generated in a panel: <rich:tab id="someTab" header="#{msg['someHeader']}" immediate="true"> <rich:messages/> <h:panelGrid...

Is there a way to get the Base URL from an Application-scoped bean in JSF?

jsf,servlets,jsf-2
In my JSF Facelets pages I know I can just use #{request.requestURL} To get the full URL to build exportable links and the like. However I have an @ApplicationScoped bean where I need the base URL (i.e. "http://dnsname/app") for the purposes of reports and other data. Is there a standard...

Can @ManagedBean and @XxxScope be placed in a base class?

jsf,jsf-2,subclass,managed-bean
I have two @ManagedBean (javax.faces.bean.ManagedBean), parent and child. The parent managed bean is not abstract because we have to give liberty to the developer to use the parent if enough or inherit it with a child that holds specifically funcionality. I have problems with the injections bean and the @PostConstruct...