| Author |
Message |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 01/27/2009 03:05:56
|
Jbaas
Joined: 01/27/2009 03:02:24
Messages: 2
Offline
|
Hi,
Im trying to integrate eCruiser LayoutPane with my existing RichFaces components. I want to put components on my LayoutPane, but when I do this, a classCastException occurs:
java.lang.ClassCastException:
org.ajax4jsf.component.html.HtmlAjaxOutputPanel cannot be cast to ecruiser.component.ECComponent
Is there any way to put a4j or richfaces components on a LayoutPane dynamically with Java?
Thx in advance
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 01/27/2009 07:35:37
|
adina_mihai
Simplica Team
Joined: 04/01/2007 00:00:00
Messages: 189
Offline
|
Hi,
Please give me a simple demonstrative example so I could help you properly. BTW: one approach is to use only ECruiser components inside layoutPane, because they all are AJAX enabled... unless you don't have any special reasons..
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 01/27/2009 07:55:24
|
Jbaas
Joined: 01/27/2009 03:02:24
Messages: 2
Offline
|
It is not possible for me to use only eCruiser components. We need those richfaces components. We spent much time on implementing them, and it's too much work to build new ones.
Attached is a Java file with the implementation:
Notes....
Its a bit wacky code, the TSFGrid isnt used in this example, nor is the TSFForm.
We have 2 layoutpanes, each containing a HtmlAjaxOutputPanel, which is an ajax4jsf component and extends UIComponent in a way.
the exception still occurs. Cannot cast HtmlAjaxOutputPanel to ECComponent
| Filename |
Processcherm.java |
Download
|
| Description |
Java file with layoutpanes |
| Filesize |
4 Kbytes
|
| Downloaded: |
945 time(s) |
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 01/27/2009 10:43:34
|
adina_mihai
Simplica Team
Joined: 04/01/2007 00:00:00
Messages: 189
Offline
|
Hi!
I succeeded to reproduce your problem. To avoid that exception you have to use something like:
topPane.getChildren().add(index,panel1);
instead of using topPane.addChild(panel1), where index is the the zero-based index where to add the child.
|
|
|
 |
|
|