jsf

How to get the context root directory in Java EE6 application from a POJO?

Hi, I have a JEE 6 application with JSF 2 and Tomcat 7. Now I have a POJO. This POJO should read a properties file. The properties file is is located in WEB-INF/classes. The current directory is the users home directory /home/myUser. How does the POJO get the context's root directory or some similar path, so that it can read the prop...

How to do filter in jsf datatable ?

I need to do the filter in the datatable. I have two dropdown and first is just static values..like filter by name,dob,age.Based on that open second dropdown and do the filter display the values. <ice:selectOneMenu size="12" onchange="this.form.submit()" partialSubmit="true" id="filterByPastDue" ...

Date error when converting time with f:convertDateTime

Hi, I have problem with f:convertDateTime, that it seems to use the error message *javax.faces.converter.DateTimeConverter.DATE_detail* when I convert time (i.e. it should use *javax.faces.converter.DateTimeConverter.TIME_detail*). The issue, I'm guessing, is that I use a pattern, and thus it does not know if it's a date or a time that...

Parse xml when required in JSf

hello all, We are using webservices everywhere in our apps(JSF-SPRING based) for accessing the data.So in all cases we will be getting data in the form of xml. We can expect the xml to be very large containing number of nodes.Now the requirement is that if hundereds of nodes are coming in the request xml and I only want to parse the one...

how to set the default in dropdown ?

Hi, I have dropdown with dynamic values.for example in dropdown have 1,5,10,20. when page loading need to display the 5 only.How to do in the jsf ? ...

No component found to process as 'ajaxSingle'

Hi! Found strange problem, possibly bug. I have 2 identical web-pages with Richfaces:suggestionbox. On the first one my suggestionBox is doing well, everything works fine, but on another one i have some problems. SuggestionBox doesn't show my suggestions. In logs i have something like this: WARNING: No component found to process as '...

Using depending selection lists in request scope

A question we keep getting from users is to have selections (drop-down lists or multi-selects) with dependent values. For instance, a user would pick a country, then the system populates a city dropdown with the cities in that country. I've made this work often enough in session (or conversation scope) but now, for a real lightweight s...

What's the recommended JSF 2.0 scope for a CRUD application?

Hi, I was wondering which scope to use for a CRUD Application. Using @ReqeustScoped causes an access to the database for every request. With @SessionScoped, data can be cached in the managed bean, but can cause the so called session-bloat. Moreover, it is more difficult to keep the data up to date. What would you recommend? Is there a b...

Refresh table on render

I have a rich:extendedDataTable inside a rich:tab. I want to refresh the table dataSource everytime that the table is rendered. It is rendered everytime that the tab is selected. In a nut: View: <rich:tab> <rich:extendedDataTable data="#{myData.data}"/> </rich:tab> Bean: public class MyData{ List data; public MyData(){ data = t...

java.lang.NullPointerException, when i am inside the constructor of a managed bean invoking methods from other beans

When I am inside the constructor of a managed and trying to reach out to other methods from other beans, I got java.lang.NullPointerException. Is there some kind of specification that not allow managed bean to do that? @ManagedProperty(value="#{document}") private DisplayListController document; @EJB DocumentSBean sBean; public NewUse...

How to write a custom converter when working with Primefaces' components that contain POJO

My particular problem is with picklist <p:pickList converter="????" value="#{bean.projects}" var="project" itemLabel="#{project.name}" itemValue="#{project}"> ...

What are the main disadvantages of Java Server Faces 2.0?

Hi, Yesterday I have seen a presentation on Java Server Faces 2.0 which looked truly impressive, even though I am currently a happy ASP.NET MVC / jQuery developer. What I liked most about JSF is the huge amount of AJAX-Enabled UI components which do seem to make development much faster than with ASP.NET MVC, especially on AJAX-heavy sit...

how to clear form elements inside table based on some conditions

I am having rich:dataTable inside that many div elements are defined. Each div element is having h:selectBooleanCheckbox and some number of input boxes. How to clear those input boxes only if checkbox is not checked. My sample code snippet <rich:dataTable> <div id="#1"> <h:selectBooleanCheckbox value=""/> <h:inputText value=""/> ...

How to open new browser window using icefaces ?

How to open new browser window using icefaces JavascriptContext.addJavascriptCall(FacesContext.getCurrentInstance(), "window.open('printerFriendly.html','Print','width=300','height=200','menubar=yes','status=yes','location=yes','toolbar=yes','scrollbars=yes')"); but not able to open the page, please help me ...

How to get radio button group functionality for each row in a table using jsf

How to get layout like the following using h:selectOneRadio encapsulated within a rich:dataTable row1 col1 col2 col3 row2 radio1 radio1 radio1 row3 radio2 radio2 radio2 ...

Javascript self contained sandbox events and client side stack

Hi , I'm in the process of moving a JSF heavy web application to a REST and mainly JS module application . I've watched "scalable javascript application architecture" by Nicholas Zakas on yui theater (excellent video) and implemented much of the talk with good success but i have some questions : I found the lecture a little confus...

How to refresh entire JSF page from the backing bean

We have a rich:comboBox on a JSF page which has a valueChangeListener that calls a backing bean function: <rich:comboBox id="cbmodel" defaultLabel="${accessUtils.activeRole}" value="${accessUtils.activeRole}" style="float: right;" valueChangeListener="${accessUtils.valueChangeListener}" > <c:forEach var="role" items="${accessUtils....

Why shouldn't I use a JSF SessionScoped bean for logic?

Hi I'm developing a java EE web app using JSF with a shopping cart style process, so I want to collect user input over a number of pages and then do something with it. I was thinking to use an EJB 3 stateful session bean for this, but my research leads me to believe that a SFSB is not tied to a client's http session, so I would have to...

JSF template not applied

Hey, I created template (template.xhtml) which resides in root context of application. I wanted to apply it to page (newTemplateClient.xhtml) which resides in the folder 'public'. So newTemplateClient.xhtml looks like this: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "ht...

How do I access EJB bean when inside a custom Converter

This converter is called from my JSF. I already register it inside faces-config.xml public class ProjectConverter implements Converter{ @EJB DocumentSBean sBean; @ManagedProperty(value="#{logging}") private Logging log; public ProjectConverter(){ } public Object getAsObject(FacesContext context, UICom...