voyent
Upgrade to Icefaces 3.3.0 from Icefaces 1.8.2  XML
Forum Index -> General Help
Author Message
PreetDholabhai

Joined: 25/Feb/2014 08:55:52
Messages: 1
Offline



I have an application built on Icefaces 1.8.2, and we are planning to upgrade it to Icefaces 3.3.0.
I have below queries for the same:

1. Is it advisable to do so ?
2. Is it feasible ?
3. Is it a quick process ? If yes, what changes should be made for that ?
4. If no, what changes should be necessary to upgrade it and approx. how much time it would take ?
judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1396
Offline


Please see the following tutorial:-
http://www.icesoft.org/wiki/display/ICE/Converting+ICEfaces+1.8+Applications+to+ICEfaces+3

1. is it advisable? Well, if you want to upgrade to many of the new features in JSF 2, then yes, you will want to do this.

2. The compat library in ICEfaces-3.3.0.GA_P01 (latest bundle) makes it fairly easy as the components in 1.8 (with the exception of fileInput which has been replaced by ace:fileEntry) have all been migrated to make your job easier.

3. Quick? Depends on you. See the article/tutorial link above and how well you are able to grasp the steps.

4. Again, depends on you and please see the article/tutorial link above.

krokodylowy3

Joined: 01/Feb/2008 00:00:00
Messages: 42
Offline


MIgration to 3.3 is possilble. Only fileUpload should be changed.
If you use renderdOnUserRole then forget aboud ace: components or patch youe jsf impl

Krashan Brahmanjara
RClements83

Joined: 10/Jan/2014 03:45:23
Messages: 8
Offline


I did this recently and the tutorial Judy linked to was very useful. However a few things I feel are worth mentioning:

- Note how in the tutorial steps 4b and 4c are quick because they only do it on 3 files? You will have to do this for every single xhtml file in your product.

- Anything that involves a mixture of icefaces and plain html (particularly html tags in an ice:panelGrid) will have to be rewritten without the html (unless you have the enterprise edition with the patch for this).

- All ice:inputFile components must be replaced with ace:fileEntry components. These work quite differently, e.g. you have to add your own submit buttons and the methods in the baking beans need to be altered to take in a FileEntryEvent instead of an ActionEvent and deal with the possibility of multiple file selection (even if you have restricted the component to only one file) so it's not entirely straightforward.

- The jsf core namespace must be changed from
xmlns:c="http://java.sun.com/jstl/core"
to
xmlns:c="http://java.sun.com/jsp/jstl/core"
in all files that use it. This is easy to do but it took me ages to work out why none of the c:set components were working.

- If you have any pages with duplicate component id problems, those must be fixed now. The page will not display at all otherwise. Removing any obsolete stuff from faces-config.xml also can't be left for later.

- Some random other bits and pieces might change, e.g. I found that commandLinks in the ice:tree didn't work properly when they had ids. Why? No idea, but we don't really need the ids at the moment so I left them out.

So it can take quite a while but I think it will be worth it in the long run. Sooner or later you are going to want window scope or multiselect in the tree or file uploads or one of the other ace component, and it's not good to realise you need one of these things and your icefaces version is several years out of date in the middle of another project.
faber

Joined: 25/Jun/2010 02:55:11
Messages: 14
Offline


Interesting notes here.

I add another one for which I haven't found the solution yet. It concerns a JavaScript Call and worked in Icefaces 1.8.2, now with Icefaces 3.3.0/JSF 2.2 it does not work anymore:

Code:
JavascriptContext.addJavascriptCall(FacesContext.getCurrentInstance(),
                               "window.open('Eingabe_Form_Structure.iface','Eingabe_Form','dependent=yes, scrollbars=yes, width= 1270, left=0, top=0, toolbar=no');");


Is there any reason why this does not work any more (the new window does not get opened) and which workaround I should use?
ken.fyten

Joined: 26/Oct/2004 00:00:00
Messages: 1338
Offline


Hi,

As noted in the ICEfaces 1.8 Compatibility wiki topic, the old ICEfaces 1.8 JavaScriptContext API has been replaced with the new (since ICEfaces 2.0) JavaScriptRunner API (since there is no JavaScript Context anymore in ICEfaces 2+).

Regards,
Ken


Ken Fyten
VP Product Development
ICEsoft Technologies, Inc.
faber

Joined: 25/Jun/2010 02:55:11
Messages: 14
Offline


Hi Ken,
thx for this information.
What could be the reason if

Code:
JavaScriptRunner.runScript(FacesContext.getCurrentInstance(),
                               "window.open('Eingabe_Form_Structure.iface','Eingabe_Form','dependent=yes, scrollbars=yes, width= 1270, left=0, top=0, toolbar=no');");


does not work?

OK, some more detail information:
Just tried an easy call

Code:
JavaScriptRunner.runScript( FacesContext.getCurrentInstance(), "alert('Panel Reloaded');" );


which didn't work either. But if I use this code within the BeanClass Constructor, the alert is displayed.
What I have that does not work is an ActionListener on the site (ice:commandButton) which handles a button click:
Code:
public String bt_OpenWindowActionPerformed() throws Exception{
 // ...
 // code which is working without errors and exceptions
 // ...
 JavaScriptRunner.runScript( FacesContext.getCurrentInstance(), "alert('Panel Reloaded');" );


I cannot see a reason why this code should not work within the ActionListener. Any idea?
mircea.toma

Joined: 10/Feb/2005 00:00:00
Messages: 323
Offline


I checked the use case you are describing and things are working as expected. More precisely the JS code passed to JavaScriptRunner.runScript method gets executed when the method call is placed within actionListener's method.

I would recommend to verify if the "bt_OpenWindowActionPerformed" method does indeed get called when the button is clicked.
[Email]
faber

Joined: 25/Jun/2010 02:55:11
Messages: 14
Offline


Yes it does and also Debugger runs over the JavaScriptRunner, but for any reason, the alert gets consumed by whatsoever.
mircea.toma

Joined: 10/Feb/2005 00:00:00
Messages: 323
Offline


That "whatsoever" could it be an add blocker you have installed into the browser?!
[Email]
faber

Joined: 25/Jun/2010 02:55:11
Messages: 14
Offline


No, there is no adblocker or s.th. like that. IMO such adblocker or script disabler should also refuse the first JavaScript Call in the Constructor. That is what puzzles me. The JavaScriptRunner works in the constructor but not in the action method.
mircea.toma

Joined: 10/Feb/2005 00:00:00
Messages: 323
Offline


In that case it would be useful to create a small test case that I can use to replicate the problem.
[Email]
faber

Joined: 25/Jun/2010 02:55:11
Messages: 14
Offline


OK, in this case I did setup a new project with almost no functionality, but still no alert. :(
Here it is (Netbeans 7 project):http://www36.zippyshare.com/v/52822131/file.html
faber

Joined: 25/Jun/2010 02:55:11
Messages: 14
Offline


Time to solve - a bit awkward. I used the wrong Netbeans project properties and overlooked the hint in the guide to use JSF 2.1.21 while I had 2.2.
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team