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:
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:
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.

