jsf-2.0

javax.faces.application.ViewExpiredException: View could not be restored.

I have written simple application with container-managed security. The problem is when I log in and open another page on which I logout, then I come back to first page and I click on any link etc or refresh page I get this exception. I guess it's normal (or maybe not:)) because I logged out and session is destroyed. What should I do to r...

Strange problem with session.invalidate()

I have strange issue with logging in and out. I've implemented container-based security. I have Login/Logout links on all my pages (through template.xhtml) that are rendered or not based on backing bean boolean property (it's actually method isLoggedIn()). Also in backing bean I have method logout which is the action for Logout link (it'...

i18n with UTF-8 encoded properties files in JSF 2.0 appliaction

Hi, I am using jsf-ri 2.0.3 where Hebrew and Russian support is needed. The problem is that I see gibberish on the screen instead of the correct text. First of all I have defined bundles (*_locale.properties) for each language. The files is in UTF-8 encoding. Secondly, I've defined the default and supported locales in faces-config.xml ...

Problem initializing backing bean property in constructor

Hello, I have managed bean/backing bean and I inject there (with @EJB) session bean. Now in constructor I want to use it to initialize property in backing bean with value from database. But injected session bean is null. What are the other ways to initialize? As far as I know I can't use @PostConstruct because fetching data from databas...

JSF2 DataBinding Problem

I have a little issue regarding submit of forms in jsf 2: In my webapp I got a function that updates entities in my db. This function gets the relative data out of a managed bean. So, my issue is that changes in my view are not passed to the managedBean. To make that clear for you, here an example: public String updateProject() { ...

iframe containing querystring causes problems in JSF

I am trying to insert a Yahoo weather widget in a JSF page. The code generated by Yahoo is: <!-- Yahoo! Weather Badge --><iframe allowtransparency="true" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="http://weather.yahoo.com/badge/?id=12753136&amp;u=c&amp;t=trans&amp;l=vertical" height="255px...

EntityManager not fetching from database?

Hello, I have entities: Post, User, Comment with bidirectional relationships: --------- 1 * --------- | Post | <--------> |Comment| --------- --------- --------- 1 * --------- | User | <--------> |Comment| --------- --------- I have simple page which displays single post and all its comments and...

JSF Ajax updates makes commandLink fails at the first click

In my JSF page I have a combobox that updates a table when an item of the combobox is selected. The table contains items with an edit link. The problem is when the table is changed by the combobox you need to click twice on the link to go to the page. The first click just refresh the page. Here is the xhtml: <?xml version="1.0" enco...

Jsf 2.0 Populate h:selectOneMenu to acces page

I am newbie in JSF 2.0, I worked in JSF 1.1 and 1.2 and I populate selectOneMenu in constructor of Managed bean's page. For when users to acces to page the List is populate. example below. I put the same in JSF 2.0 but is not work, the selectOneMenu appears empty. <h:selectOneMenu id="cboStatus" value="#{PersonBean.idStatus}"> <f:sele...

how can I dynamically create html components in Jsf2

how can I dynamically create html components in Jsf2. I have to make a dynamic form which is to be filled by user, so I am not getting how can I manage, I have to use JavaScript or what?? I am using richfaces too. ...

delete HtmlColumn on clicking HtmlCommandButton which is in the column itself.

I have generating a HtmlCommandButton in backing bean. By clicking that button I want to delete a HtmlColumn from a HtmlDataTable which was also generated in the baking bean. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"&gt; <head> <meta http-equiv="Content-Type" content="text/html;...

JSF 2.0 Annotation does not work

;Hi, I am using JSF 2.0 Mojarra ver. 2.0.2-SNAPSHOT (obtain using maven). I am trying to use Annotation to setup JSF bean, as such: @ManagedBean @RequestScoped public class HelloBean { @ManagedProperty(value="test") private String name; public String getName() { return name; } public void setName(String na...

Show/hide JSF2 form using selectBooleanCheckbox

Hi guys, I am using JSF2 and Java to build a web application. I want to build a form like the one at the picture below: When somebody unchecks the checkbox the form should disappear: Here is an example with gwt. So far, I tried some stuff with the <f:ajax> tag and an PropertyActionListener in the managedBean but it didn't work. ...

JSF 2.0 Saving dynamic form to a database

Hi, I'm writing an application that serves as an admin panel using JSF 2.0 and Hibernate. I have a JSP page with a JSF form which elements are added dynamically using javascript (jQuery to be specific). So I cannot make any assumption on how much data do I have to process. I have a managed bean but I don't know how to put the getters and...

How to define & implement custom event listeners in JSF 2.0

I have developed a custom JSF component and looking for ways to implement custom event listeners for it in following way <custom:comp attr1="abc" attr2="xyz" onEvent1="${bean.processEvent1}" /> Here custom is my custom component namespace & comp is custom component tag name So far I have found following information regarding events i...

Are there any complete examples on how to use ClientBehavior/ClientBehaviorHolder API in JSF 2.0?

I'm looking for a complete and working example for ClientBehavior/ClientBehaviorHolder usage. Most example I have found online such as this talks about the API but I am having trouble wrapping my head around the exact sequence/steps on adding a custom behavior to my custom JSF component. ...

By deleting the column of h:datatable the values entered in other column got refereshed.

Possible Duplicate: delete HtmlColumn on clicking HtmlCommandButton which is in the column itself. By deleting the column of h:datatable the values entered in other column got refereshed. I am generating whole datatable from back bean. ...

JSF: value bindings inside nested ui:repeat

Hi, I have a strange problem with the <ui:repeat> tag. Even for my very simple example, value bindings inside nested repeat components do not work as expected. I have a simple facelet like so: <h:body> <h:form> <ui:repeat value="#{sandbox.rows}" var="row"> <ui:repeat value="#{row.columns}" var="column"> <h:outputText value...

Options for navigating outside of JSF site via buttons.

On my JSF website, I've got a couple elements that I'd like to use to cause navigation to our old classic ASP site (no data needs survive, just simple navigation). What's the best way to do this? Thoughts so far: - Using the outcome/navigation rules implies that you're staying within the same site. Can it be used to navigate outside?...

Whats the correct way to create multiple instances of managed beans in JSF 2.0

If I want to create more than one instance of managed bean in JSF 2.0, under different names in the same scope, how should I proceed? Ideally, I want the equivilant to (for example): @ManagedBeans({name="myManagedBean1",name="myManagedBean2"}) @RequestScoped public class MyManagedBean { } Thanks .. ...