Exceptions, errors, problems and issues encountered during java ee development. Of course, the same exception stack trace can often be caused by many problems. I want to keep track of at least some of the possible solutions.

Wednesday, May 7, 2008

ICEfaces 1.7 ice:outputConnectionStatus causes problems

I don't want to go too deep into describing the problem, so in short: the new ICEfaces release (1.7 DR1) managed to introduce a problem for this tiny component. If you use it on multiple pages you will have js errors and unexpected problems.

Scenario: you have a link on the first page that calls an action which returns a navigation case that points to a second page. The second page also has links (or buttons) that call actions. Both pages have the connection status component.
Exceptions: the errors will be seen in icefaces debug window (call from browser by pressing Ctrl+Shift+T) when you click on link on the first page, and will look similar to this:


[window.Idx0#1.sync-connection] : receive broadcast failed
TypeError: this.elementID.asElement() has no properties
[window.Idx0#1.sync-connection] : [3990373] : connection closed
[window] : Cannot set focus, no element for id [_MyPortlet_WAR_MyPortlet_INSTANCE_plaa_:j_id10:searchpage_results:0:j_id35]
cannot find element with id: '_MyPortlet_WAR_MyPortlet_INSTANCE_plaa_:j_id10:searchpage_results:0:j_id35'


The second page will be shown, but none of the links will work.

Solution: The solutions is to use the component in one facelet template and build all pages using that template. Then you can have multiple compositions that all use the same connection status component (sort of).
References: JIRA http://jira.icefaces.org/browse/ICE-2973
Forum http://www.icefaces.org/JForum/posts/list/7899.page

No comments: