voyent
Dynamically building components in Java Code  XML
Forum Index -> Components
Author Message
thorne

Joined: 10/Jun/2008 00:00:00
Messages: 12
Offline


Hi,

I'm struggling with a little issue. I am trying to build a form dynamically through a backing bean. The elements that are going to get displayed are read from a webservice that interacts with a processor utility we wrote.

Now what I try to do is when a user clicks a link the processor fires up and generates the form. My jspx code is as follows:

Code:
 <ice:panelPopup id="formLoader" draggable="true" 
                          modal="true" rendered="#{formLoader.visible}" 
                          visible="#{formLoader.visible}" autoCentre="true">
   <f:facet name="header">
     <ice:panelGrid columns="2" columnClasses="formLoaderTitle,formLoaderCloseButton">
       <ice:outputText value="Form Loader v0.2"/>
       <ice:commandButton actionListener="#{formLoader.closeForm}" 
                            image="/xmlhttp/css/xp/css-images/popupclose.gif"/>
     </ice:panelGrid>
   </f:facet>
 
   <f:facet name="body">
     <ice:panelCollapsible binding="#{formLoader.panel}"/>
   </f:facet>
 </ice:panelPopup>
 


The panel property is a PanelCollapsible object in my bean that is populated by the processor as follows:

Code:
 private PanelCollapsible panel;
 public PanelCollapsible getPanel() {
   panel = new PanelCollapsible();
   HtmlOutputText text = new HtmlOutputText();
   text.setValue("hello");
   panel.getChildren().add(text);
   panel.encodeAll();
   return panel;
 }
 


Then what happens is a HTTP 500 error pops up with huge stack traces and at the top of the stack trace:
Code:
 org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
 at org.apache.xerces.dom.CoreDocumentImpl.insertBefore(Unknown Source)
 at org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source)
 at com.icesoft.faces.context.DOMContext.setRootNode(DOMContext.java:261)
 ...
 


Does anyone have any advice?

All good things lead to more good things
[Email]
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team