Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 22720 invoked from network); 22 Sep 2006 09:28:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Sep 2006 09:28:13 -0000 Received: (qmail 33530 invoked by uid 500); 22 Sep 2006 09:28:10 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 33120 invoked by uid 500); 22 Sep 2006 09:28:08 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 33109 invoked by uid 99); 22 Sep 2006 09:28:08 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Sep 2006 02:28:08 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=lists@nabble.com; spf=pass X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=HTML_MESSAGE Received-SPF: pass (idunn.apache.osuosl.org: domain nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] ([72.21.53.35:56108] helo=talk.nabble.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id F3/63-06791-3ACA3154 for ; Fri, 22 Sep 2006 02:28:04 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GQhKC-00065a-Bi for users@myfaces.apache.org; Fri, 22 Sep 2006 02:28:00 -0700 Message-ID: <6443898.post@talk.nabble.com> Date: Fri, 22 Sep 2006 02:28:00 -0700 (PDT) From: =?UTF-8?Q?Andr=C3=A1s_Piros?= To: users@myfaces.apache.org Subject: t:panelTabbedPane and t:dataScroller: links work only on the first page MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3016_4483700.1158917280347" X-Nabble-From: a.piros@avedas.com X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_3016_4483700.1158917280347 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi folks, I'm using MyFaces Tomahawk 1.1.3 and Sun's RI 1.2 together in an enterprise app under Sun's GlassFish appserver. If I have a t:dataTable, which has a t:dataScroller, my h:commandLinks inside t:dataTable work just fine, on the first page, and on every other page of the dataTable: http://www.nabble.com/file/113/1.PNG http://www.nabble.com/file/114/2.PNG So far, so good. But, if I generate a t:dataTable on every tab of a t:panelTabbedPane (I must generate them in the backing bean programmatically, because I don't even know in advance how much tabs I have...), and generate a t:dataScroller for every t:dataTable inside my panelTabbedPane, my h:commandLinks are working only on the first page of every table, they are actually not working on the subsequent pages: http://www.nabble.com/file/116/3.PNG http://www.nabble.com/file/117/4.PNG On the subsequent pages, nevertheless, a HTTP POST is done on the form (every component is inside a single form), but funnily, neither the commandLink's action, nor its actionListener methods are called. Instead of the link working, the dataScroller just jumps back to the first page on the actual tab. Any ideas? Your replies are highly appreciated! enjoy, :andras JSF code:                     <t:panelTabbedPane binding="#{infoobjecttabbedpanebean.tabbedPane}"                             bgcolor="#EBEEF8" width="90%" cellspacing="1"                             styleClass="tabbedPane" align="center"                             activeTabStyleClass="activeTab"                             inactiveTabStyleClass="inactiveTab"                             disabledTabStyleClass="disabledTab"                             activeSubStyleClass="activeSub"                             inactiveSubStyleClass="inactiveSub"                             tabContentStyleClass="tabContent" /> Java code: public class InfoObjectTabbedPaneBean {          ...     public HtmlPanelTabbedPane getTabbedPane() {         if (this.htmlPanelTabbedPane == null) {             Application app = FacesContext.getCurrentInstance().getApplication();             // tabbedpane             this.htmlPanelTabbedPane = (HtmlPanelTabbedPane)app.createComponent(HtmlPanelTabbedPane.COMPONENT_TYPE);         }         updateTabbedPane(this.htmlPanelTabbedPane);         return this.htmlPanelTabbedPane;     }      public void setTabbedPane(HtmlPanelTabbedPane tabbedPane){         updateTabbedPane(tabbedPane);         this.htmlPanelTabbedPane = tabbedPane;     }          public void updateTabbedPane(HtmlPanelTabbedPane hptp) {         Application app = FacesContext.getCurrentInstance().getApplication();         ValueExpression valueExpressionOfId;         ValueExpression valueExpressionOfType;         int cntTabs = 0;                  // Reset         hptp.getChildren().clear();         for (...) {                          // Get data from EJBs...                          // tab i             UIPanel tab = (HtmlPanelTab)app.createComponent(HtmlPanelTab.COMPONENT_TYPE);             tab.setId("panelTab" + cntTabs);             tab.getAttributes().put("label", actInfoObjectTypeName);             hptp.getChildren().add(tab);                          // datatable             HtmlDataTable myHdt = new HtmlDataTable();             myHdt.setId("hdtId" + cntTabs);             myHdt.setVar("hdtVar" + cntTabs);             myHdt.setRows(10);             myHdt.setBorder(0);             myHdt.setCellpadding("5");             myHdt.setCellspacing("0");             myHdt.setHeaderClass("columnheader");             myHdt.setRowClasses("oddrow, evenrow");             UIData hdt = myHdt;             tab.getChildren().add(hdt);                          // Data scroller for actual HtmlDataTable             HtmlDataScroller scroller = new HtmlDataScroller();             scroller.setPaginator(true);             scroller.setPaginatorActiveColumnClass("evenrow");             scroller.setPaginatorColumnClass("oddrow");             scroller.setPaginatorMaxPages(10);             scroller.setId("SCROLLER_" + "hdtId" + cntTabs);             scroller.setFor("hdtId" + cntTabs);             scroller.setFastStep(10);             scroller.setPageIndexVar("pageIndex");             scroller.setPageCountVar("pageCount");             // First             HtmlGraphicImage imageFirst = new HtmlGraphicImage();             imageFirst.setUrl("/images/first.gif");             imageFirst.setAlt("First");             imageFirst.setStyleClass("imagelink");             scroller.setFirst(imageFirst);             // Last             HtmlGraphicImage imageLast = new HtmlGraphicImage();             imageLast.setUrl("/images/last.gif");             imageLast.setAlt("First");             imageLast.setStyleClass("imagelink");             scroller.setLast(imageLast);             // Previous             HtmlGraphicImage imagePrevious = new HtmlGraphicImage();             imagePrevious.setUrl("/images/prev.gif");             imagePrevious.setAlt("Previous");             imagePrevious.setStyleClass("imagelink");             scroller.setPrevious(imagePrevious);             // Next             HtmlGraphicImage imageNext = new HtmlGraphicImage();             imageNext.setUrl("/images/next.gif");             imageNext.setAlt("Next");             imageNext.setStyleClass("imagelink");             scroller.setNext(imageNext);             tab.getChildren().add(scroller);                          // Setup data model...                          hdt.setValue(actTable);                              for (...) {                 // Create column                 UIColumn column = (UIColumn)app.createComponent(HtmlSimpleColumn.COMPONENT_TYPE);                 // Create and add header                 UIOutput header = (UIOutput)app.createComponent(HtmlOutputText.COMPONENT_TYPE);                 header.setValue(actName);                 column.setHeader(header);                 // Create and add content                 // First column: link to detail view, attach primary key of the                 // InfoObject which detail view has to be presented                 // Other columns: no link                 // add column                 hdt.getChildren().add(column);                                  cntCols++;             }                          // Add column for Delete and Edit buttons             // add column             hdt.getChildren().add(columnEditDelete);                          }     }     ... } -- View this message in context: http://www.nabble.com/t%3ApanelTabbedPane-and-t%3AdataScroller%3A-links-work-only-on-the-first-page-tf2316788.html#a6443898 Sent from the MyFaces - Users mailing list archive at Nabble.com. ------=_Part_3016_4483700.1158917280347 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi folks,

I'm using MyFaces Tomahawk 1.1.3 and Sun's RI 1.2 together in an enterprise app under Sun's GlassFish appserver.

If I have a t:dataTable, which has a t:dataScroller, my h:commandLinks inside t:dataTable work just fine, on the first page, and on every other page of the dataTable:

t:panelTabbedPane and t:dataScroller: links work only on the first page t:panelTabbedPane and t:dataScroller: links work only on the first page

So far, so good. But, if I generate a t:dataTable on every tab of a t:panelTabbedPane (I must generate them in the backing bean programmatically, because I don't even know in advance how much tabs I have...), and generate a t:dataScroller for every t:dataTable inside my panelTabbedPane, my h:commandLinks are working only on the first page of every table, they are actually not working on the subsequent pages:

t:panelTabbedPane and t:dataScroller: links work only on the first page t:panelTabbedPane and t:dataScroller: links work only on the first page

On the subsequent pages, nevertheless, a HTTP POST is done on the form (every component is inside a single form), but funnily, neither the commandLink's action, nor its actionListener methods are called. Instead of the link working, the dataScroller just jumps back to the first page on the actual tab.

Any ideas? Your replies are highly appreciated!

enjoy,

:andras

JSF code:

                    <t:panelTabbedPane binding="#{infoobjecttabbedpanebean.tabbedPane}"
                            bgcolor="#EBEEF8" width="90%" cellspacing="1"
                            styleClass="tabbedPane" align="center"
                            activeTabStyleClass="activeTab"
                            inactiveTabStyleClass="inactiveTab"
                            disabledTabStyleClass="disabledTab"
                            activeSubStyleClass="activeSub"
                            inactiveSubStyleClass="inactiveSub"
                            tabContentStyleClass="tabContent" />

Java code:

public class InfoObjectTabbedPaneBean {
    
    ...

    public HtmlPanelTabbedPane getTabbedPane() {
        if (this.htmlPanelTabbedPane == null) {
            Application app = FacesContext.getCurrentInstance().getApplication();

            // tabbedpane
            this.htmlPanelTabbedPane = (HtmlPanelTabbedPane)app.createComponent(HtmlPanelTabbedPane.COMPONENT_TYPE);
        }
        updateTabbedPane(this.htmlPanelTabbedPane);
        return this.htmlPanelTabbedPane;
    } 

    public void setTabbedPane(HtmlPanelTabbedPane tabbedPane){
        updateTabbedPane(tabbedPane);
        this.htmlPanelTabbedPane = tabbedPane;
    }
    
    public void updateTabbedPane(HtmlPanelTabbedPane hptp) {
        Application app = FacesContext.getCurrentInstance().getApplication();
        ValueExpression valueExpressionOfId;
        ValueExpression valueExpressionOfType;
        int cntTabs = 0;
        
        // Reset
        hptp.getChildren().clear();
        for (...) {
            
            // Get data from EJBs...
            
            // tab i
            UIPanel tab = (HtmlPanelTab)app.createComponent(HtmlPanelTab.COMPONENT_TYPE);
            tab.setId("panelTab" + cntTabs);
            tab.getAttributes().put("label", actInfoObjectTypeName);
            hptp.getChildren().add(tab);
            
            // datatable
            HtmlDataTable myHdt = new HtmlDataTable();
            myHdt.setId("hdtId" + cntTabs);
            myHdt.setVar("hdtVar" + cntTabs);
            myHdt.setRows(10);
            myHdt.setBorder(0);
            myHdt.setCellpadding("5");
            myHdt.setCellspacing("0");
            myHdt.setHeaderClass("columnheader");
            myHdt.setRowClasses("oddrow, evenrow");
            UIData hdt = myHdt;
            tab.getChildren().add(hdt);
            
            // Data scroller for actual HtmlDataTable
            HtmlDataScroller scroller = new HtmlDataScroller();
            scroller.setPaginator(true);
            scroller.setPaginatorActiveColumnClass("evenrow");
            scroller.setPaginatorColumnClass("oddrow");
            scroller.setPaginatorMaxPages(10);
            scroller.setId("SCROLLER_" + "hdtId" + cntTabs);
            scroller.setFor("hdtId" + cntTabs);
            scroller.setFastStep(10);
            scroller.setPageIndexVar("pageIndex");
            scroller.setPageCountVar("pageCount");
            // First
            HtmlGraphicImage imageFirst = new HtmlGraphicImage();
            imageFirst.setUrl("/images/first.gif");
            imageFirst.setAlt("First");
            imageFirst.setStyleClass("imagelink");
            scroller.setFirst(imageFirst);
            // Last
            HtmlGraphicImage imageLast = new HtmlGraphicImage();
            imageLast.setUrl("/images/last.gif");
            imageLast.setAlt("First");
            imageLast.setStyleClass("imagelink");
            scroller.setLast(imageLast);
            // Previous
            HtmlGraphicImage imagePrevious = new HtmlGraphicImage();
            imagePrevious.setUrl("/images/prev.gif");
            imagePrevious.setAlt("Previous");
            imagePrevious.setStyleClass("imagelink");
            scroller.setPrevious(imagePrevious);
            // Next
            HtmlGraphicImage imageNext = new HtmlGraphicImage();
            imageNext.setUrl("/images/next.gif");
            imageNext.setAlt("Next");
            imageNext.setStyleClass("imagelink");
            scroller.setNext(imageNext);
            tab.getChildren().add(scroller);
            
            // Setup data model...
            
            hdt.setValue(actTable);
                
            for (...) {
                // Create column
                UIColumn column = (UIColumn)app.createComponent(HtmlSimpleColumn.COMPONENT_TYPE);

                // Create and add header
                UIOutput header = (UIOutput)app.createComponent(HtmlOutputText.COMPONENT_TYPE);
                header.setValue(actName);
                column.setHeader(header);

                // Create and add content
                // First column: link to detail view, attach primary key of the
                // InfoObject which detail view has to be presented
                // Other columns: no link

                // add column
                hdt.getChildren().add(column);
                
                cntCols++;
            }
            
            // Add column for Delete and Edit buttons

            // add column
            hdt.getChildren().add(columnEditDelete);
                
        }

    }

    ...

}


View this message in context: t:panelTabbedPane and t:dataScroller: links work only on the first page
Sent from the MyFaces - Users mailing list archive at Nabble.com.
------=_Part_3016_4483700.1158917280347--