voyent
weird behaviour in dynamically generated panels  XML
Forum Index -> Woodstock to ICEfaces Migration
Author Message
autozoom

Joined: 28/Dec/2007 00:00:00
Messages: 80
Offline


look at this very simple page:

Code:
<?xml version="1.0" encoding="UTF-8"?>
 <jsp:root version="2.0" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ice="http://www.icesoft.com/icefaces/component" xmlns:jsp="http://java.sun.com/JSP/Page">
     <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
     <f:view>
         <html id="outputHtml1">
             <head id="outputHead1">
                 <ice:outputStyle href="./resources/stylesheet.css" id="outputStyle1"/>
                 <ice:outputStyle href="./xmlhttp/css/xp/xp.css" id="outputStyle2"/>
             </head>
             <body id="outputBody1" style="-rave-layout: grid">
                 <ice:form id="form1">
                     <ice:panelTabSet binding="#{Page1.panelTabSet1}" id="panelTabSet1" style="left: 36px; top: 72px; position: absolute" tabPlacement="Top"/>
                 </ice:form>
             </body>
         </html>
     </f:view>
 </jsp:root>
 


and its backing bean:

Code:
[...]
 private PanelTabSet panelTabSet1 = new PanelTabSet();
 
     public PanelTabSet getPanelTabSet1() {
         addTabs();
         return panelTabSet1;
     }
 
     public void setPanelTabSet1(PanelTabSet pts) {
         this.panelTabSet1 = pts;
     }
 private void addTabs() {
         for (int i = 0; i < 4; i++) {
             PanelTab tab = new PanelTab();
             tab.setLabel("label " + i);
 
             HtmlPanelGrid pg = new HtmlPanelGrid();
             pg.setColumns(1);
 
             PanelCollapsible pc1 = new PanelCollapsible();
             pg.getChildren().add(pc1);
 
             pc1.setStyle("height:100px;width:300px;");
             pc1.setExpanded(true);
             HtmlOutputText ht = new HtmlOutputText();
             ht.setValue("header " + i);
             pc1.getFacets().put("header", ht);
             
             tab.getChildren().add(pg);
 
             for (int j = 0; j < 5; j++) {
                 HtmlOutputText ot = new HtmlOutputText();
                 //ot.setId("ot" + i);
                 ot.setValue("string  " + i + "_" + j);
 
                 pc1.getChildren().add(ot);
             }
             PanelCollapsible pc2 = new PanelCollapsible();
             pg.getChildren().add(pc2);
 
             pc2.setStyle("height:100px;width:200px;");
             pc2.setExpanded(true);
             HtmlOutputText ht2 = new HtmlOutputText();
             ht2.setValue("footer " + i);
             pc2.getFacets().put("header", ht2);
 
             tab.getChildren().add(pg);
 
             for (int j = 0; j < 3; j++) {
                 HtmlOutputText ot = new HtmlOutputText();
                 //ot.setId("ot" + i);
                 ot.setValue("string  " + i + "_" + j);
 
                 pc2.getChildren().add(ot);
             }
 
             this.panelTabSet1.getChildren().add(tab);
 
         }
 
     }
 [...]
 


It creates some tabs, with some collapsible panels in them
The behaviour is strange: when you click on a collapsible panel, both panels in the tab close and not only the one you clicked on.
And if you navigate back and forth across the tabs, the panels close even if you don't click on them.

I am trying to migrate from woodstock to icefaces, and I really need dynamically generated components.

thanks
frank.ye

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


Please clean project directory and attach the application, the Application might not need to dynamically generate all the components.
[Email]
autozoom

Joined: 28/Dec/2007 00:00:00
Messages: 80
Offline


Here you go.
I do need this because this is the first step of a much more complex problem.
In the global pictures I need to add different input components to the collapsible panels based on some database configuration data.

These kind of components will be of different type (text, calendar, trees, drop downs and so on) so in the final code the

Code:
for (int j = 0; j < 3; j++) {
                 HtmlOutputText ot = new HtmlOutputText();
                 //ot.setId("ot" + i);
                 ot.setValue("string  " + i + "_" + j + "   " + (new Date()).getTime());
 
                 pc2.getChildren().add(ot);
             }


section will be much more elaborated.

thanks
 Filename WebApplication1.zip [Disk] Download
 Description
 Filesize 33 Kbytes
 Downloaded:  270 time(s)

frank.ye

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


tried on my user_agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20, it seems fine. What is your environment?

From your post, the components inside PanelCollapsible needs to be dynamic? ie, depends on a certain condition? however, the set of components are known as a fix set of components (.different type (text, calendar, trees, drop downs )




[Email]
autozoom

Joined: 28/Dec/2007 00:00:00
Messages: 80
Offline


yes the components at the last level are of different type so I cannot iterate simply in the JSP page.

With both FF2 and FF3 I get the same wrong behaviour.
Referring to the attached screenshots:
- the first one is the page just loaded,
- the second one is when I click on "header_0" (you see that both collapse)

The same happens when I click in "label_1" and back on "label_0"

doesn't this happen to you as well?
 Filename cp.zip [Disk] Download
 Description
 Filesize 197 Kbytes
 Downloaded:  293 time(s)

frank.ye

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


So there is a known set of components need to be generated dynamically?

no, it works fine using jboss-4.2.3.GA.
[Email]
autozoom

Joined: 28/Dec/2007 00:00:00
Messages: 80
Offline


no I want to be able to add any kind of components (label, input text, calendar, trees, dropdown, checkboxes and so on)

do you have any idea?

and could you please post the war you have generated from my project on your computer? I want to try it on mine, because it sounds very strange to me it's now working in the same way.

I am using JBoss 4.2.1 with JDK 1.6 update 12 on Windows XP
autozoom

Joined: 28/Dec/2007 00:00:00
Messages: 80
Offline


just found out that the version of JSF I use is not compatible

upgrading to JSF 1.2_12-b01 solves the issue

maybe the compatibility matrix needs to be updated?
frank.ye

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


ICEfaces binrary 1.8.0 is shipped with 1.2_12. but not sure about details why it is failing in that particular minor version.

enjoy,
Frank
[Email]
 
Forum Index -> Woodstock to ICEfaces Migration
Go to:   
Powered by JForum 2.1.7ice © JForum Team