1

I want to migrate a project which is in icefaces 1.7.2 to icefaces 2.0.0. But i am facing problems with binding. Because the entire project uses binding for each and every UI component and it uses request scope in older version. If i want to migrate it, i need to convert the request scope bean to view scope bean. if i do so, binding is not working and it results in unwanted output.

So kindly suggest me a solution to migrate the icefaces 1.7.2 project to icefaces 2.0.0 without using binding or any other ways to migrate the project.

And also window or session scopes are not useful because it consumes more amount of memory space for each user while more number of users access the webpages concurrently.

  • Why exactly do you need binding? In JSF 2.x there are several new ways go without the need to bind components to the bean. Related: [`@ViewScoped` fails in tag handlers](http://balusc.blogspot.com/2011/09/communication-in-jsf-20.html#ViewScopedFailsInTagHandlers). – BalusC Mar 01 '12 at 19:32
  • All the components which were used in older version of icefaces uses binding attribute to do everything related to that component.... Ya it is easy to create icefaces2.0 and jsf2.0 web project without binding. But I am in the situation to migrate the icefaces1.7.2 project to icefaces 2.0.0 project. It is possible to make the entire project in jsf2.0 and icefaces 2.0.0. But it takes more time than migration. – tgsankarbabu Mar 02 '12 at 04:14

2 Answers2

2

In JSF 2.0 and 2.1, component bindings can't be used with the view scope because of a timing issue.

Bindings are resolved when the component tree is build, but the view scope doesn't become active until view state is applied which happens after the build.

This is fixed in JSF 2.2, but that one hasn't been released yet. If you're feeling adventurous you could try a nightly build.

Mike Braun
  • 3,729
  • 17
  • 15
  • i cant get ur point.. Do i need to wait until jsf2.2 release ? is there any other way to do the migration ?? – tgsankarbabu Mar 02 '12 at 04:16
  • What are all the other ways to create view scoped bean without using binding attribute like using id to find the component(findComponent(FacesContext.getCurrentInstance().getViewRoot(), "componentID");) ?? – tgsankarbabu Mar 02 '12 at 05:03
  • If you want to use the view scope AND access components, look up by Id or bind the components to a seperate request scoped bean. Obtain that bean in the view scoped one via programmaticly resolving EL or via the request attributes. – Mike Braun Mar 02 '12 at 09:53
  • can u give me an example to access request bean via view scope bean. i dont know about it. At the same time, my project contains more than 60 pages. Is it possbile to do for 60 pages If i want to do binding as u said ? – tgsankarbabu Mar 02 '12 at 11:12
0

Or you can use SessionBean... until jsf 2.2 is released