JSF2 Composite component tag incompatibility problem?

This code, a test case for a custom component using JSF2 Just for the record, the file: panel.xhtml , located at /resources/panels/panel.xhtml test.xhtml: <head> </head> <body> <panels:panel/> </body> </html> Returns the following html: <!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:panels="http://java.sun.com/j

Jsf Alternative to t:selectOneRadio layout="spread"

I don't often have need for tomahawk components anymore since jsf 2.0 provides great selectOneMenu support and most of other functionality I used to use them for, but when it comes to a selectOneRadio component I don't know of another provider with a layout="spread" option. This is essential from time to time to achieve a certain layout I'm asked for. I'm using Tomahawk for exactly this purpose but recently discovered some serialization issues caused by this component during failover. I was wo

Jsf java.lang.UnsupportedOperationException at <rich:fileUpload>

im trying to upload a file with like this: <h:form> <rich:fileUpload fileUploadListener="#{bean.test}" id="upload" acceptedTypes="jpeg, jpg, gif, png, bmp"> <a4j:ajax event="uploadcomplete" render="preview" /> </rich:fileUpload> </h:form> But I always get the Error: Servlet.service() for servlet [Faces Servlet] in context with path [/project] threw exception java.lang.UnsupportedOperation

jsf - el escape dot

I have following audio tag in my markup: <audio id="audio" preload="auto" hidden="true"> <source src="#{resource['sounds:filename.mp3']}" type="audio/mpeg" /> <source src="#{resource['sounds:filename.ogg']}" type="audio/ogg" /> <embed src="#{resource['sounds:filename.mp3']}" hidden="true"/> </audio> I want to wrap this inside a custom composite component which gets the filename as an attribute. <source src="#{resource['sounds:cc.attrs.filename.mp3

Jsf automatically expand a tree on loading the body

Hi all Iam new to JSF technology how to automatically expand the tree on loading the page in by using rich:tree tag. <rich:tree switchType="client" value="#{Bean.deviceServiceTreeRoot}" var="item"> <rich:treeNode> <h:commandLink value="#{item.name}" action="#{Bean.getLink()}" style="color:blue;text-decoration:none;" title="#{item.Description}"> <f:param name="productIDs" value="#{item.ID}"></f:param> </h:commandLink> </rich:treeNode> </rich:tree>

Jsf How to implement custom navigation handling with pretty faces - unable to pass in required params

using PF 3.3.1, PrettyFaces 3.3.3 and JSF/Mojarra2.1. I have a custom navigation handler to handle "cancel" button on my application pages - the cancel button needs to return to the previous (referring) page. I have implemented a stack-based solution that holds the trail of the user's navigation and almost finished implementing the navigationHandler - but now I've hit a snag. I can't seem to get the cancel action to navigate back to the page I want. I've tried the following: FacesContext.ge

JSF Backing Bean method not called

When i click the command button which triggers the editUser(User) method or the one that triggers the editClient(User) method in my backing bean, the methods ain't called anymore. It worked before, but now just nothing is called. The page is reloaded. What could be wrong here ??? Here is my view: <p:accordionPanel activeIndex="#{userManagement.activeOverviewTab}" id="overview" rendered="#{loginControl.isAllowedForClientUserCreation()}"> <p:tab title="#{text.tabClients}" rendered="#{l

Jsf PrimeFaces: UTF-8 bug related to file upload

My web applications is currently using: JBoss AS7 JSF2 PrimeFaces Due to this bug UTF-8 form submit in JSF is corrupting data I setup a @WebFilter doing public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); chain.doFilter(request, response); } as suggested by BalusC (thank you). In a simple it always works right. I come to another problem when I need to

Jsf Primefaces & IE9 rendering issue

We have some annoying rendering issue with Primefaces 2.2.1 & IE9. There seems to be some kind of "two step rendering" after certain ajax updates. In the first step, the ajax-updated code is rendered without the proper css applied to it - this looks messy, like so: In the second step, the proper css is applied and everything looks as expected, like so: Not all ajax updates have this rendering issue, but we have a hard time sorting out what triggers this behaviour. If you have any id

Jsf Primefaces: required field message overrides <p:dialog/> message

I have a field that has a required attribute. When I press the Accept button to save some data without entering any value in the field, an error message is displayed. So far so good. But, if right after that I decide to click on the Cancel button, that error message overrides the confirmation message that is supposed to be displayed inside a <p:dialog/> element. NOTE: If instead I use the <p:confirmDialog/> component, there seems to be no problem because, I guess, it uses a messag

Jsf How to load a nested List with PrimeFaces

I want to show a list of items with single select. Up on selecting an item, a dialog should appear showing details of that item. So far the list and selecting and even some details are showing, but a nested list is emtpy. JSF source: <f:view> <h:form id="studyListForm"> <!-- Main list with selectable Items --> <h:outputText value="Study List"/> <p:dataTable id="studyList" selection="#{studyRepositoryController.selectedStudy}" selectionM

Jsf How to use CDI qualifiers with multiple class implementations?

I'm new in Java EE/JSF and now read about CDI qualifiers - the possibility to change class implementation. This is great but I have got one question. As far as I understand I can change class implementation using qualifier but I need to change it everywhere I use this implementation. What is the best solution to do it in one place? With my small knowledge about Java EE I figured out this one. Lets imagine that we are creating simple Calculator application. We need to create few classes: Calcu

Jsf How to update a particular row DataTable

In data table i want to update each row dynamically. I am using p:poll here for auto updating (For keeping dataTable uptodate). My main aim is to update the data (records) dynamically as it changes I have tried this. <p:column headerText="Vehicle Info" width="65" id="vehicleInfo"> <h:outputText id="txt_count" value="count #{vehicleController.count}"/> </p:column> How can i achieve it?

Jsf Dynamically Disable/Enable of p:tab in p:accordionPanel

I want only single Tab(not entire accordion panel) to be enabled or disabled dynamically. I tried following approach, here is my code: index.xhtml <p:accordionPanel id="accordionPanelId" widgetVar="accordionPanelWidget"> <p:tab id="tab1" title="First Tab"> <h:outputText value="Contents of Tab1"/> <h:form> <p:commandButton value="Enable Tab2" action="#{tabBean.buttonAction}" update=":accordionPanelId:tab2"/> </h:form> </

Jsf Issue with rowSelector in ice faces

I have a ice faces jspx page with the following structure <ice:dataTable..> <ice:columns> <ice:rowSelector .../> <f:facet name="header"> <ice:outputText ..../> </f:facet> <ice:outputText ...../> </ice:columns> </ice:dataTable..> On load of the page the following exception is thrown saying dataTable is not parent of rowSelector . But i have verified that the data table is the parent component of rowSelecto

Jsf java.io.NotSerializableException: sessions.SessionLoader

I created a java class to handle sessions the was created in the class annotated @WebFilter public class SessionLoader { public HttpSession session; public void pushSession(String tag, Object o) { if (session == null) { session = currentContext(); } session.setAttribute(tag, o); } public Object pullSession(String tag) { if (session == null) { session = currentContext(); } return session.getAttribute(tag);

Jsf Mojarra 2.2.3 encoding request parameters

Problems started when I upgraded Mojarra from 2.2.1 to 2.2.3 (JBoss Wildfly Alpha to Beta). When I try to submit a form (POST) with special characters (polish letters) they aren't properly UTF-8 encoded. What I have done? Wrote a filter @WebFilter(urlPatterns = "/*", initParams = { @WebInitParam(name = "ignore", value = "true" ), @WebInitParam(name = "encoding", value = "UTF-8") }) public class CharacterEncodingFilter implements Filter { private String encoding = null; private Filt

Jsf Bean validation and 2 form in facelet

I have 2 forms in facelet, 1.xhtml <h:form> <h:inputText id="id1" value="#{mBean.pr}"/> <h:commandButton value="Submit" action="response"/> </h:form> <h:form> <h:commandButton value="myCB" action="response"/> <h:inputText id="id2" value="#{mBean.pr}"/> </h:form> pr field annotated by @DecimalMin("5.00"). In this case its sufficient that id1 or id2 contains value greater or equal to 5.00. But consider the following facelet 2.xhtml

Disable and empty an input field after an AJAX call using JSF and Richfaces

I am using richfaces 4.2.0.Final and have the following situation: within a rich:dataTable, in which each row describes an article in a shopping cart, I have an input field in which the user can input the quantity she wants to order. As soon as the user focuses on this input field, I have to perform some controls on the server (using Ajax) and if the controls fail, I must empty the field and disable it. My solution: <rich:dataTable var="article" value="#{cart.articles} > ... <rich:c

Jsf FacesContext resolves to null in ApplicationScoped bean

I have a filter: UserSessionFilter.java, that I use to handle user sessions and a ApplicationScoped bean: Config.java that primarily gives me access to a DAO factory. Config.java @ManagedBean (eager = true) @ApplicationScoped public class Config implements Serializable {... The filter calls a method in Config to get a DAOFactory object: Filter method @Override public void init(FilterConfig filterConfig) { daoFactory = Config.getInstance().getDAOFactory(); } Config method public sta

Jsf p:selectBooleanButton primefaces-mobile doesn't change

My p:selectBooleanButton doesn't respond on any click and has this check box at the corner that does respond when I click on it but the label on the button doesn't change at all! maybe someone had this problem and can help me. I'm using primefaces 3.5 and primefaces-mobile 0.9.5 with glassfish 3.1.2.2 server. <f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xm

JSF commandlink , onclick action not working?

i have many command links within an accordian panel . one such link calls the dialog during the onclick event . Below is the xhtml snippet . <p:accordionPanel id="accordion" activeIndex="#{activeIndex.store}"> <p:tab> <p:commandLink value="LRU Status Summary" action="LRUStatusSummary.xhtml?faces-redirect=true" style="#{menuBean.getMenuItemCss('LRUStatus')}" onclick="PF('progress').show()" actionListener="#

Finish uploading files and then execute the jsf:action of the button

The fileupload, as seen in the code, call a method, which saves files in a List <>. The upload files from the button with the ruling PF ('fileupload') upload ().; What I need here is that when you upload the "n" preloaded, recently at the end of the upload, execute the action method of the button. <p:fileUpload id="fileupload" widgetVar="fileupload" fileUploadListener="#{incidentBean.handleAttachment}" mode="advanced" label="Adjunta

Java EE + JSF url mappings

I can't find in Internet any good explanation of mapping URLs in Java EE with JSF + managed bean (Yes - I know, that there are ten million of tutorials, but after reviewing first million with HelloWorld page I resigned of reading rest of them..). Before reading about Java EE + JSF I was working with Spring + JSP project, where URL mapping was made with annotations @GET/@POST etc in controllers, with url as attribute - very easy solution with one method per one URL with putting resources to resp

navigation rule causes JSF1064: Unable to find or serve resource

I've the following xhtml page, that is wrapped in the major part of the other pages in my project: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:head> <title></title> </h:head> <h:form> <p:menubar> <p:menuitem valu

Jsf How to inject a http session attribute to a bean using CDI

I have some legacy code that put objects as http session attributes using code like this: MyObject object = new MyObject(); Map<String, Object> sessionMap = FacesContext.getCurrentInstance().getExternalContext().getSessionMap(); sessionMap.put("attrname", object); The old facelets accessed the code using @ManagedProperty("#{attrname}") private MyObject object; Is there any way using CDI (@Inject) to inject this session attribute to a Bean? In new code that uses CDI what's the bett

Jsf Request scoped Bean is lost when including pages

In this main page, I included another, which contains a table with a list of clients. listinit.jspx: .... <rich:tabPanel id="paneltab" style="width:800px;"> <rich:tab label="Clients"> <ui:include src="/listes/listeClients.jspx" /> </rich:tab> .. </rich:tabPanel> .... listeClients.jspx: .... <rich:dataTable id="tblclient" value="#{ListeBean.clientItems}" var="clnts"> <

Jsf Changes in ui:include page are only refreshed after a couple of minutes

I have a page with a kind of "pop-up" in the bottom: <p:outputPanel id="updatePanel" styleClass="updatePanel bordered"> <ui:include src="file:///C:/.DS/include/update.xhtml" /> </p:outputPanel> but when the contents of that file are changed, the page does not, even when I refresh it like 10 times. In a couple of minutes though, I refresh the page and it works nicely. Is that some kind of cache problem or something? Update I un-accepted the answer, since apparentl

Jsf PrettyFaces 404 page without URL redirect

In our app with PrettyFaces 2.0.12.Final, we have our redirects set up in pretty-config.xml. <url-mapping id="foo"> <pattern value="/foo/#{alias}" /> <view-id value="/foo.xhtml" /> </url-mapping> We have a custom 404 page set up in our web.xml. <error-page> <error-code>404</error-code> <location>/404.xhtml</location> </error-page> When a user receives a 404 Not Found error, for a foo "alias" that doesn't exist, th

Jsf @SessionScoped cannot be resolved to a type

I am using @SessionScoped in my managed bean and it gives me the error. @SessionScoped cannot be resolved to a type What am I missing? Relevant code: package javaeetutorial.guessnumber; import java.io.Serializable; import java.util.Random; @Named @SessionScoped public class UserNumberBean implements Serializable { // Do stuff. }

Jsf ace datatable groupBy column breaks when using pagination

Hope someone can help me out with this. The issue is as follows: I have a datatable that displays user variables. One of the columns on the table is grouped to show the variable type in one cell for all the variables that share the same type, which can be many, and since there could be so many I enabled datatable pagination. However, the issue comes when the variables of a said type exceed the rows per page number and are splitted among various pages. In that case, when I navigate to the next

Display a List of entities in JSF page

I am trying to display a List<Student> using JSF. public List<Student> retrieveStudent() { Sdao sdao=new Sdao(); List<Student> stud=new ArrayList(); List sname1=new ArrayList(); List sdept1=new ArrayList(); for(Student show1:sdao.retrieveStudent()) { sname1.add(show1.getSname()); sdept1.add(show1.getSdept()); } stud.addAll(sname1); stud.addAll(sdept1); return stud; } JSF Page: <h:form> <h:outputText value="#{student.retrieveStudent()}"/>

JSF viewParam not set

xhtml file I use a viewParam: <?xml version="1.0" encoding="UTF-8"?> <!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:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"> <f:metadata> <f:viewParam name="actionId" value="#{editAct

Jsf Get bean class from composite component

I have composite component: <my:component value="#{bean.property1.property2}/> From composite component I need to get class of bean.property1 to read its annotations. I do it by the following code: ValueExpression valueExpression = expressionFactory.createValueExpression(FacesContext.getCurrentInstance().getELContext(), "#{bean.property1}", Object.class); Object bean = valueExpression.getValue(FacesContext.getCurrentInstance().getELContext()); Class<?> be

Jsf Spurious PreDestroyViewMapEvent with includeViewParams="true" on h:link

I have 2 views (a.xhtml and b.xhtml) one of which contains a link to the other. The first view: uses the current view map by setting some value to it; points to b.xhtml with h:link using includeViewParams="true" in order to automatically include view parameters in the link's query string. a.xhtml: <f:view > <f:metadata> <f:viewAction> <!-- just set any value to force view map creation... --> <f:setP

Jsf Change PrimeFaces DataGrid (responsive mode) behaviour

It seems that DataGrid PrimeFaces component (responsive mode) starts out stacked on small devices and becomes horizontal when resolution grows beyond 640 px. I want to be able to choose the width from which DataGrid columns stop being stacked and start positioning one beside the other. That is, change the 640 px default value to any other value of my choice. Thanks.

JSF Primefaces outputLabel get value is null

I have button on my view. When I click it there is an action handler where I'm getting view root from faces context and then I get form. Then I loop through facets and children of the form and I look for OutputLabel instances. When I get it I'm trying to getValue from it. But it's always null, but on rendered page there is value. OutputLabel (p:outputLabel) is placed in composite component... What do I wrong? Some ideas? // EDIT public void buttonHandler(){ FacesContext facesContext = Faces

Jsf JBOSS EAP German Umlaut Encoding broken

I am working on JBoss EAP 6.4.4.GA (AS 7.5.4.Final-redhat-4) with JSF 2.1 and primefaces 5.3.8. Since the deployment of the lates version of my application there has been a problem with umlaut encoding in my forms. Entering german umlauts in inputText field: After submitting the form: <p:inputText widgetVar="vornameVar" id="vornameInput" value="#{empfaengerBean.vorname}"> </p:inputText> My first thought was, that there is an error in the new version. But unf

Jsf Where FacesMessage FacesContext in Thorntail 2.3?

I'm developing test task, with stack: thorntail 2.3.0.Final, PrimeFaces 6.2. There is example: public void onRowEdit(RowEditEvent event) { FacesMessage msg = new FacesMessage("Car Edited", ((Car) event.getObject()).getId()); FacesContext.getCurrentInstance().addMessage(null, msg); } But I can't import FacesMessage and FacesContext, my IDE can't find them in all dependencies A bit of my pom.xml thorntail with bom: … <dependency> <groupId>io.thorntail</grou

Jsf how to prevent form to reset other form when it's submitted in the same html page

I have two different forms and if i apply action on one form the fields values in the second form is resetting(cleared or backed to default values ), i have not know idea what's going on ? i am using Primefaces 7 with JSF (jsf-api 2.2.11, jsf-impl 2.2.11 and javax.servlet-api 3.0.1). i have tried to override Sammy function from below post https://stackoverflow.com/questions/10652881/how-to-prevent-form-submit#I%20also%20had%20this%20problem%20and%20I%20found%20a%20solution%20in also i tried

Jsf How to merge cells in a primefaces datatable row?

Is this possible with datatable tags or CSS ? Any solution is helpful. If possible, search fileds for date can be in a same column. Primefaces datatable: datatable Code for datatable: <p:dataTable> <p:column filterBy="#{log.mbr}" sortBy="#{log.mbr}" headerText="mbr"> <h:outputText value="#{log.mbr}" /> </p:column> <p:column id="dateFrom" headerText="datum od" filterBy="#{log.datumOd}" sortBy="#{log.datumUpisa}">

Jsf Primefaces ToolTip Sticks in the page without hiding

I am using jsf 1.2 and primefaces 5.2.5 , I have added tooltips in my XHTML page and when I do some operations between some ajax listener events the tootip sticks to the page and by scrolling the entire page the sticked tool tip gets replicated. How to autohide the tooltip when the focus of the mouse goes out. XHTML <p:tooltip for="zScoreMaxOn" value="Display Std Dev Z-Score Max Results" trackMouse="true"> </p:tooltip> Screenshot :

Can't get current index on open tab with AccordionPanel PrimeFaces(JSF)

I need to get the intex of an oppened tab. I'm using this ajax on the accordionPanel: <p:ajax event="tabChange" listener="#{ambienteController.onAccordionTabChange}" /> And this is the bean: public void onAccordionTabChange(final TabChangeEvent event) { AccordionPanel view = (AccordionPanel) event.getComponent(); this.accordionTabIndex = view.getActiveIndex(); System.out.println(this.accordionTabIndex); } The sysout is always printing 0 as the index of the current active

How can I turn to false the onsubmit attribute from JSF form

Hello I have a form and I would like to have a function in the onsubmit attribute of the form the can be true or false depending on some conditions. This is the form code: <b:form id="form1" onsubmit="return xxx()"> The function xxx() returns false but the form is still submited. If I write <b:form id="form1" onsubmit="return false"> it works. Can someone show me how to do it ? Thanks in advance

Jsf java.lang.ClassCastException: org.primefaces.component.column.Column cannot be cast to org.primefaces.component.row.Row

I am trying to make a data search on a table. I have tried to follow the example in the showcase primefaces for the DataTable filter. However, strangely when I enter the value that I want to find, the contents of the table will immediately empty. For example I want to find the username 'A', then when I type 'A' the contents of the table will disappear. Here is my table: <h:form id="dataTable"> <p:dataTable var="users" rows="10" value="#{listUserAccountBean.users}" style="w

  1    2   3   4   5   6  ... 下一页 最后一页 共 81 页