Sorting in dataTable
If anyone had played with display arena .. plss plss let me know ..
can we do sorting in dataTable .. i dont see any tags attributes around ..
if its not at all possible in jsp , then only i can get in bean coding side ..
use bean coding style :)
Similar Messages
-
Sort B1 DataTable - Code Inside...
Hi
I hope this will help you ...
In case you know a better way to implement this - please post your code...
[B1Listener(BoEventTypes.et_ITEM_PRESSED, false)]
public virtual void OnAfterItemPressed(ItemEvent pVal)
bool ActionSuccess = pVal.ActionSuccess;
Form oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
if (pVal.Row < 0)
//click on headers...
//call sort DT according to Col.
Grid oGrid = (Grid) oForm.Items.Item("CFLG").Specific;
DataTable oDT = oGrid.DataTable;
oForm.Freeze(true);
SortDT(ref oDT , pVal.ColUID);
oForm.Freeze(false);
public static bool SortDT(ref DataTable oDT, string ColName)
//Copy To System DT
System.Data.DataTable oSysDT = new System.Data.DataTable();
// Add Cols
for (int iCol = 0; iCol < oDT.Columns.Count; iCol++)
oSysDT.Columns.Add(oDT.Columns.Item(iCol).Name);
for (int iRow = 0; iRow < oDT.Rows.Count; iRow++)
System.Data.DataRow oRow = oSysDT.NewRow();
for (int iCol = 0; iCol < oDT.Columns.Count; iCol++)
oRow[iCol] = oDT.GetValue(iCol, iRow);
oSysDT.Rows.Add(oRow);
//Sort DT
SortSystemDataTable(oSysDT, ColName);
//Copy Sorted table to B1DT
oDT.Rows.Clear();
oDT.Rows.Add(oSysDT.Rows.Count);
for (int iRowCount = 0; iRowCount < oSysDT.Rows.Count; iRowCount++)
for (int iColCount = 0; iColCount < oSysDT.Columns.Count; iColCount++)
string scol = oDT.Columns.Item(iColCount).Name;
int icol = oSysDT.Columns.IndexOf(scol);
string sValue = oSysDT.Rows[iRowCount].ItemArray[icol].ToString();
if (oDT.Columns.Item(iColCount).Type == BoFieldsType.ft_Date)
if (sValue.Length > 0)
DateTime dDate = DateTime.Parse(sValue);
oDT.SetValue(iColCount, iRowCount, dDate);
else
if (sValue.Length > 0)
oDT.SetValue(iColCount, iRowCount, sValue);
return true;
private static void SortSystemDataTable(System.Data.DataTable oDT, string Sort)
System.Data.DataTable newDT = oDT.Clone();
int rowCount = oDT.Rows.Count;
System.Data.DataRow[] foundRows = oDT.Select(null, Sort); // Sort with Column name
for (int i = 0; i < rowCount; i++)
object[] arr = new object[oDT.Columns.Count];
for (int j = 0; j < oDT.Columns.Count; j++)
arr[j] = foundRows<i>[j];
System.Data.DataRow data_row = newDT.NewRow();
data_row.ItemArray = arr;
newDT.Rows.Add(data_row);
//clear the incoming dt
oDT.Rows.Clear();
for (int i = 0; i < newDT.Rows.Count; i++)
object[] arr = new object[oDT.Columns.Count];
for (int j = 0; j < oDT.Columns.Count; j++)
arr[j] = newDT.Rows<i>[j];
System.Data.DataRow data_row = oDT.NewRow();
data_row.ItemArray = arr;
oDT.Rows.Add(data_row);
Enjoy,
J.J,
If you search the Business One SDK forum on this topic you will find many posts that may help you. Here is one as an example ...
Re: sorting db datatable
HTH,
Eddy -
Automatic Sort on dataTable affects other tables
Hi everybody,
I'm struggling a little bit with JSF as I have a special requirement - I need a dynamic display of some independently sortable dataTables below each other.
It works quite well, but the problem is, that if I sort one of the shown tables, it affects the other tables as well.
Hav a look on my page content:
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<f:view>
<html>
<body>
<h:form id="frm">
<t:dataList value="#{bean.tablelist}" var="table">
<t:dataTable value="#{table.data}" var="tablerow"
width="500" border="1"
sortable="true" sortColumn="#{table.sortColumn}"
sortAscending="#{table.sortAscending}"
preserveSort="false">
<t:column>
<f:facet name="header">
<h:outputText value="column1" />
</f:facet>
<h:outputText value="#{tablerow.col1}"/>
</t:column>
<t:column>
<f:facet name="header">
<h:outputText value="column2" />
</f:facet>
<h:outputText value="#{tablerow.col2}"/>
</t:column>
<t:column>
<f:facet name="header">
<h:outputText value="column3" />
</f:facet>
<h:outputText value="#{tablerow.col2}"/>
</t:column>
<t:column>
<f:facet name="header">
<h:outputTextvalue="column4" />
</f:facet>
<h:outputText value="#{tablerow.col4}"/>
</t:column>
<t:column>
<f:facet name="header">
<h:outputText value="column2" />
</f:facet>
<h:outputText value="#{tablerow.col5}"/>
</t:column>
</t:dataTable>
</t:dataList>
</h:form>
</body>
</html>
</f:view>I have checked the table.sortColumn value, it is changed just in one table, but it affects somehow the display of the others, too.
Just an example:
I have Table1, Table2 and Table3 that are displayed each inside of the dataList.
Every table has the same columns (column1 to 5).
By default, each table is sorted by column1.
If I click on the column2 header of Table2 to sort just Table2 by column2, Table1 and Table3 also get sorted by column2 (but have still the small arrow indicating that the sort is by column1).
It's a bit tricky to describe :)
I appreciate any help, maybe just a workaround.
Edited by: coppermine on Jul 10, 2008 4:13 PMI have checked the table.sortColumn value, it is changed just in one table, but it affects somehow the display of the others, too.
alizia
[Wide Circles|http://www.widecircles.ca] -
Sorting a datatable with a boolean value
Hi all,
I have a datatable and one of the columns is just a true or false field.
I'm using the DTOComparator from the BalusC (here: http://balusc.xs4all.nl/srv/dev-jep-dat.html) server but I'm getting the error:
Error 500: java.lang.RuntimeException: Getter getInclude cannot be invoked.
It comes from this line of code:
try {
c1 = (Comparable) o1.getClass().getMethod(getter, null).invoke(o1, null);
c2 = (Comparable) o2.getClass().getMethod(getter, null).invoke(o2, null);
} catch (Exception e) {
// Obvious. Check if method names are correct.
throw new RuntimeException("Getter " + getter + " cannot be invoked.");
Can you not use boolean values with this?
Thanks for any help!
IlluInstead of a primivive, use a wrapper objects as DTO property which represents a DB entry. Remember, DB2 fields can contain null values.
So use Boolean instead of boolean. Or just change the comparator to make it compatible with primitives. -
Sorting datatable based on column
Hi,
I am new to java studio creator and java. I am trying to sort the datatable based on a column using the methods given in previous posts which uses a button in the column header. I am trying to implement the same method but getting an error when using dataTable1Model.execute().
My code is
public String button1_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
// SesssionBean1.tbl_sde_helpRowSet1
getSessionBean1().getTbl_sde_helpRowSet().setCommand("select * from tblSample order by tblSample.serial_no");
// getDataTable1Model()
dataTable1Model.execute();
return null;
The error i am getting is
Cannot find symbol
symbol:method execute()
location: class com.sun.jsfcl.data.CachedRowSetDataModel
Please help me solve this.
Thanks,
SruHi,
Thanks for the reply John. I tried using the Table component. But the problem I am facing with using that is I am not able to add scroll bars to it. I tried using the table component inside group panel just like using dataTable component inside group panel to get scroll bars. But didnt work. Any idea on how to add scroll bars to the table.
Thanks,
Sru -
Hi all,
How can the contents of dataTable component be sorted, tomahawk dataTable component provides a commandSortHeader how to use this, can any one show an example on how to write the sort handler ?
Thanks in advanceI think that the examples should have the source. Unfortunatly don't. I've decompiled the code, and i post here what you need:
package org.apache.myfaces.examples.listexample;
public abstract class SortableList
protected SortableList(String defaultSortColumn)
_sort = defaultSortColumn;
_ascending = isDefaultAscending(defaultSortColumn);
protected abstract void sort(String s, boolean flag);
protected abstract boolean isDefaultAscending(String s);
public void sort(String sortColumn)
if(sortColumn == null)
throw new IllegalArgumentException("Argument sortColumn must not be null.");
if(_sort.equals(sortColumn))
ascending = !ascending;
} else
_sort = sortColumn;
ascending = isDefaultAscending(sort);
sort(_sort, _ascending);
public String getSort()
return _sort;
public void setSort(String sort)
_sort = sort;
public boolean isAscending()
return _ascending;
public void setAscending(boolean ascending)
_ascending = ascending;
private String _sort;
private boolean _ascending;
package org.apache.myfaces.examples.listexample;
import java.util.*;
// Referenced classes of package org.apache.myfaces.examples.listexample:
// SortableList, SimpleCar
public class SimpleSortableCarList extends SortableList
public SimpleSortableCarList()
super("type");
_cars = new ArrayList();
_cars.add(new SimpleCar(1, "car A", "red"));
_cars.add(new SimpleCar(1, "car B", "blue"));
_cars.add(new SimpleCar(1, "car C", "green"));
_cars.add(new SimpleCar(1, "car D", "yellow"));
_cars.add(new SimpleCar(1, "car E", "orange"));
public List getCars()
sort(getSort(), isAscending());
return _cars;
protected boolean isDefaultAscending(String sortColumn)
return true;
protected void sort(final String column, final boolean ascending)
Comparator comparator = new Comparator() {
public int compare(Object o1, Object o2)
SimpleCar c1 = (SimpleCar)o1;
SimpleCar c2 = (SimpleCar)o2;
if(column == null)
return 0;
if(column.equals("type"))
return ascending ? c1.getType().compareTo(c2.getType()) : c2.getType().compareTo(c1.getType());
if(column.equals("color"))
return ascending ? c1.getColor().compareTo(c2.getColor()) : c2.getColor().compareTo(c1.getColor());
else
return 0;
Collections.sort(_cars, comparator);
private List _cars;
The code was decompiled with:
// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html -
Link Action in datatable header not working!!!
hi all
i want to sort the datatable rows when link in the header of a column in datatable is clicked. I am using Sun Creator but it doesnot provide functinality to directly add link action in header. So i changed the jsp page to add the following code
<h:dataTable binding="#{SearchResults.dataTable1}" headerClass="list-header" id="dataTable1" rowClasses="list-row-even,list-row-odd" style="left: 24px; top: 24px; position: absolute" value="#{SearchPage.searchResultsDataModel}" var="currentRow">
<h:column binding="#{SearchResults.column1}" id="column1">
<f:facet name="header">
<h:commandLink action="#SearchResults.linkActionApplicantIDHeader_action}"
binding="#{SearchResults.linkActionApplicantIDHeader}" id="linkActionApplicantIDHeader">
<h:outputText binding="#{SearchResults.linkActionApplicantIDHeaderText}" id="linkActionApplicantIDHeaderText" value="Applicant ID"/>
</h:commandLink>
</f:facet>
</h:column>................... other columns of table(bold is what i added )
if i check through the IDE application outline window that which action handler is associated with my header link action, it takes me to proper method. but while running it doesnot go to the proper method and hence doennot fire the event.
what should i do??
plz help
thankshi all
i want to sort the datatable rows when link in the
header of a column in datatable is clicked. I am
using Sun Creator but it doesnot provide functinality
to directly add link action in header. So i changed
the jsp page to add the following code
<h:dataTable binding="#{SearchResults.dataTable1}"
" headerClass="list-header" id="dataTable1"
rowClasses="list-row-even,list-row-odd" style="left:
24px; top: 24px; position: absolute"
value="#{SearchPage.searchResultsDataModel}"
var="currentRow">
<h:column binding="#{SearchResults.column1}"
id="column1">
<f:facet name="header">
<h:commandLink
action="#SearchResults.linkActionApplicantIDHeader_act
ion}"
binding="#{SearchResults.linkActionApplicantIDHeader}
" id="linkActionApplicantIDHeader">
<h:outputText
binding="#{SearchResults.linkActionApplicantIDHeaderTe
xt}" id="linkActionApplicantIDHeaderText"
value="Applicant ID"/>
</h:commandLink>
</f:facet>
</h:column>................... other columns of table(bold is
what i added )
if i check through the IDE application outline window
that which action handler is associated with my
header link action, it takes me to proper method. but
while running it doesnot go to the proper method and
hence doennot fire the event.
what should i do??
plz help
thanksI had a similar problem w/ links in a datatable that didn't work. I had to do two things:
1. Initialize the SearchPage.searchResultsDataModel property in the constructor of the bean (this is because I use request scope).
2. Remove the rendered property from the surround h:panelGroup tag that I have around my table. I haven't been able to get the rendered property to work with the datatable links.
Hope this helps! -
No Button in a specific JSP page fires event..
hi
I desperately need help in following thing.
I wanted to sort a datatable by command links in headers but those were not firing events so i used teh buttons instead. They kept on working fine but now something weird has happened. Neither the buttons in the header nor anywhere else on page work .. (I copy - pasted the sorting logic into a button outside datatable) but this button is also not working. If i use the debugger then debugger doesnot go into any of the actionListener methods. My CreatorLog file shows the following trace.
INFORMATIONAL *********** Exception occurred ************ at Fri Jul 15 06:42:44 java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
[catch] at com.sun.rave.insync.beans.BeansUnit.instantiateBean(BeansUnit.java:1101)
at com.sun.rave.insync.live.LiveUnit.ressurectDesignBean(LiveUnit.java:316)
at com.sun.rave.insync.live.LiveUnit.resurrect(LiveUnit.java:379)
at com.sun.rave.insync.live.LiveUnit.sync(LiveUnit.java:276)
at com.sun.rave.insync.models.FacesModel.sync(FacesModel.java:761)
at com.sun.rave.designer.DesignerTopComp.sync(DesignerTopComp.java:657)
at com.sun.rave.designer.DesignerTopComp.componentShowing(DesignerTopComp.java:761)
at org.openide.windows.WindowManager.componentShowing(WindowManager.java:333)
at com.sun.rave.windowmgr.WindowManagerImpl.componentShowing(WindowManagerImpl.java:375)
at com.sun.rave.windowmgr.LayoutManagerListenerImpl.layoutWindowShown(LayoutManagerListenerImpl.java:69)
at com.sun.winsys.layout.impl.RLayoutManager.fireWindowShown(RLayoutManager.java:289)
at com.sun.winsys.layout.impl.RLayoutWindow.fireShown(RLayoutWindow.java:482)
at com.sun.winsys.layout.impl.RTabbedDocumentPane.fireChangedNoActivate(RTabbedDocumentPane.java:400)
at com.sun.winsys.layout.impl.RTabbedDocumentPane.stateChanged(RTabbedDocumentPane.java:388)
at javax.swing.JTabbedPane.fireStateChanged(JTabbedPane.java:287)
at javax.swing.JTabbedPane$ModelListener.stateChanged(JTabbedPane.java:219)
at javax.swing.DefaultSingleSelectionModel.fireStateChanged(DefaultSingleSelectionModel.java:116)
at javax.swing.DefaultSingleSelectionModel.setSelectedIndex(DefaultSingleSelectionModel.java:50)
at javax.swing.JTabbedPane.setSelectedIndexImpl(JTabbedPane.java:468)
at javax.swing.JTabbedPane.setSelectedIndex(JTabbedPane.java:461)
at com.sun.winsys.swing.BasicClosableTabbedPaneUI$MouseHandler.mousePressed(BasicClosableTabbedPaneUI.java:3456)
at java.awt.Component.processMouseEvent(Component.java:5097)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3195)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Jul 15, 2005 6:42:46 AM com.sun.faces.renderkit.html_basic.HtmlBasicRenderer getForComponent
WARNING: Unable to find component with ID 'componentLabel3' in view.
If i open the server log from server navigation it doesnot show any other message on button clicks...
plz help..hi
thanks for reply.. But what if i want to do my own sorting. I am making enterprise application using JSF (Sun Creator). Using my own layered architecture.
The prolem is why Creator(/JSF??) behaved so unpredictably. One moment all the buttons in header of datatable were working fine and other moment an exception trace was found in Creator Log(Help->CreatorLog)??
What went wrong..
Any possible reasons?? -
IceFaces 1.8 dataTable-sort example gives error
Hi All:
I need help, please!! Any help or hint is greatly appreciated it!!
In the tutorial from IceFaces 1.8
Data Table Component Tutorials
I am using weblogic 10.3.2, IceFaces 1.8 and Jsf 1.2.
I am using the jars that comes with the IceFaces 1.8 download.
index.jsp:
<html>
<head>
<title>ICEfaces Component Showcase</title>
</head>
<body>
<jsp:forward page="sortableTable.iface" />
</body>
</html>
sortableTable.jspx:
<f:view xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ice="http://www.icesoft.com/icefaces/component">
<ice:outputDeclaration doctypeRoot="HTML"
doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
doctypeSystem="http://www.w3.org/TR/html4/loose.dtd"/>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1"></meta>
<title>DataTable Component Tutorial</title>
<link href="./xmlhttp/css/xp/xp.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h2>Sortable dataTable Component</h2>
<p>In this example commandSortHeader components have been added to the
table headers. Clicking on the headers will sort the table data.</p>
<ice:form>
<!--
This is a very basic table comprising four columns. Each
row represents an inventory item. Each column represents a
inventory item property. commandSortHeader components have been
added ot the table headers.
The sortAscending and sortColumn attributes are set when a command
sortColumnName header is activated. The sortColumn and sortAscending
data can then be sortColumnName by a sortColumnName algorithm if a
change is detected.
-->
<ice:dataTable
id="dataSortData"
sortColumn="#{inventoryList.sortColumnName}"
sortAscending="#{inventoryList.ascending}"
value="#{inventoryList.carInventory}"
var="item">
<!-- Stock number -->
<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{inventoryList.stockColumnName}"
arrow="true" >
<ice:outputText value="#{inventoryList.stockColumnName}"/>
</ice:commandSortHeader>
</f:facet>
<ice:outputText value="#{item.stock}"/>
</ice:column>
<!-- Model number -->
<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{inventoryList.modelColumnName}"
arrow="true" >
<ice:outputText value="#{inventoryList.modelColumnName}"/>
</ice:commandSortHeader>
</f:facet>
<ice:outputText value="#{item.model}"/>
</ice:column>
<!-- Description -->
<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{inventoryList.descriptionColumnName} "
arrow="true" >
<ice:outputText value="#{inventoryList.descriptionColumnName}"/>
</ice:commandSortHeader>
</f:facet>
<ice:outputText value="#{item.description}"/>
</ice:column>
<!-- Odometer reading -->
<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{inventoryList.odometerColumnName}"
arrow="true" >
<ice:outputText value="#{inventoryList.odometerColumnName}"/>
</ice:commandSortHeader>
</f:facet>
<ice:outputText value="#{item.odometer}"/>
</ice:column>
<!-- Price number -->
<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{inventoryList.priceColumnName}"
arrow="true" >
<ice:outputText value="#{inventoryList.priceColumnName}"/>
</ice:commandSortHeader>
</f:facet>
<ice:outputText value="#{item.price}"/>
</ice:column>
</ice:dataTable>
</ice:form>
</body>
</html>
</f:view>
Error 500--Internal Server Error
java.lang.Exception: javax.faces.FacesException: Can't parse stream for /index.jsp The prefix "jsp" for element "jsp:forward" is not bound.
at com.icesoft.faces.context.View.servePage(View.java :152)
at com.icesoft.faces.webapp.http.core.MultiViewServer .service(MultiViewServer.java:67)
at com.icesoft.faces.webapp.http.common.ServerProxy.s ervice(ServerProxy.java:11)
at com.icesoft.faces.webapp.http.servlet.MainSessionB oundServlet$4.service(MainSessionBoundServlet.java :149)
at com.icesoft.faces.webapp.http.common.standard.Path DispatcherServer.service(PathDispatcherServer.java :24)
at com.icesoft.faces.webapp.http.servlet.BasicAdaptin gServlet.service(BasicAdaptingServlet.java:16)
at com.icesoft.faces.webapp.http.servlet.PathDispatch er.service(PathDispatcher.java:23)
at com.icesoft.faces.webapp.http.servlet.SessionDispa tcher.service(SessionDispatcher.java:53)
at com.icesoft.faces.webapp.http.servlet.PathDispatch er.service(PathDispatcher.java:23)
at com.icesoft.faces.webapp.http.servlet.MainServlet. service(MainServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:820)
at weblogic.servlet.internal.StubSecurityHelper$Servl etServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invok eServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute( ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(Tail Filter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFi lter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :3592)
at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.sec uredExecute(WebAppServletContext.java:2202)
at weblogic.servlet.internal.WebAppServletContext.exe cute(WebAppServletContext.java:2108)
at weblogic.servlet.internal.ServletRequestImpl.run(S ervletRequestImpl.java:1432)
at weblogic.work.ExecuteThread.execute(ExecuteThread. java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java :173)
Caused by: javax.faces.FacesException: Can't parse stream for /index.jsp The prefix "jsp" for element "jsp:forward" is not bound.
at com.icesoft.faces.application.D2DViewHandler.rende rResponse(D2DViewHandler.java:445)
at com.icesoft.faces.application.D2DViewHandler.rende rView(D2DViewHandler.java:159)
at com.sun.faces.lifecycle.RenderResponsePhase.execut e(RenderResponsePhase.java:110)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:1 00)
at com.sun.faces.lifecycle.LifecycleImpl.render(Lifec ycleImpl.java:139)
at com.icesoft.faces.webapp.http.core.JsfLifecycleExe cutor.apply(JsfLifecycleExecutor.java:19)
at com.icesoft.faces.context.View$2$1.respond(View.ja va:48)
at com.icesoft.faces.webapp.http.servlet.ServletReque stResponse.respondWith(ServletRequestResponse.java :201)
at com.icesoft.faces.context.View$2.serve(View.java:7 7)
at com.icesoft.faces.context.View.servePage(View.java :149)
... 25 more
Caused by: org.xml.sax.SAXParseException: The prefix "jsp" for element "jsp:forward" is not bound.
at com.sun.org.apache.xerces.internal.parsers.Abstrac tSAXParser.parse(AbstractSAXParser.java:1231)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserI mpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogic XMLReader.java:133)
at weblogic.xml.jaxp.RegistryXMLReader.parse(Registry XMLReader.java:173)
at org.apache.commons.digester.Digester.parse(Digeste r.java:1785)
at com.icesoft.faces.webapp.parser.Parser.parse(Parse r.java:130)
at com.icesoft.faces.application.D2DViewHandler.rende rResponse(D2DViewHandler.java:439)
... 34 moreHi All:
I need help, please!! Any help or hint is greatly appreciated it!!
In the tutorial from IceFaces 1.8
Data Table Component Tutorials
I am using weblogic 10.3.2, IceFaces 1.8 and Jsf 1.2.
I am using the jars that comes with the IceFaces 1.8 download.
index.jsp:
<html>
<head>
<title>ICEfaces Component Showcase</title>
</head>
<body>
<jsp:forward page="sortableTable.iface" />
</body>
</html>
sortableTable.jspx:
<f:view xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ice="http://www.icesoft.com/icefaces/component">
<ice:outputDeclaration doctypeRoot="HTML"
doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
doctypeSystem="http://www.w3.org/TR/html4/loose.dtd"/>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1"></meta>
<title>DataTable Component Tutorial</title>
<link href="./xmlhttp/css/xp/xp.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h2>Sortable dataTable Component</h2>
<p>In this example commandSortHeader components have been added to the
table headers. Clicking on the headers will sort the table data.</p>
<ice:form>
<!--
This is a very basic table comprising four columns. Each
row represents an inventory item. Each column represents a
inventory item property. commandSortHeader components have been
added ot the table headers.
The sortAscending and sortColumn attributes are set when a command
sortColumnName header is activated. The sortColumn and sortAscending
data can then be sortColumnName by a sortColumnName algorithm if a
change is detected.
-->
<ice:dataTable
id="dataSortData"
sortColumn="#{inventoryList.sortColumnName}"
sortAscending="#{inventoryList.ascending}"
value="#{inventoryList.carInventory}"
var="item">
<!-- Stock number -->
<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{inventoryList.stockColumnName}"
arrow="true" >
<ice:outputText value="#{inventoryList.stockColumnName}"/>
</ice:commandSortHeader>
</f:facet>
<ice:outputText value="#{item.stock}"/>
</ice:column>
<!-- Model number -->
<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{inventoryList.modelColumnName}"
arrow="true" >
<ice:outputText value="#{inventoryList.modelColumnName}"/>
</ice:commandSortHeader>
</f:facet>
<ice:outputText value="#{item.model}"/>
</ice:column>
<!-- Description -->
<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{inventoryList.descriptionColumnName} "
arrow="true" >
<ice:outputText value="#{inventoryList.descriptionColumnName}"/>
</ice:commandSortHeader>
</f:facet>
<ice:outputText value="#{item.description}"/>
</ice:column>
<!-- Odometer reading -->
<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{inventoryList.odometerColumnName}"
arrow="true" >
<ice:outputText value="#{inventoryList.odometerColumnName}"/>
</ice:commandSortHeader>
</f:facet>
<ice:outputText value="#{item.odometer}"/>
</ice:column>
<!-- Price number -->
<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{inventoryList.priceColumnName}"
arrow="true" >
<ice:outputText value="#{inventoryList.priceColumnName}"/>
</ice:commandSortHeader>
</f:facet>
<ice:outputText value="#{item.price}"/>
</ice:column>
</ice:dataTable>
</ice:form>
</body>
</html>
</f:view>
Error 500--Internal Server Error
java.lang.Exception: javax.faces.FacesException: Can't parse stream for /index.jsp The prefix "jsp" for element "jsp:forward" is not bound.
at com.icesoft.faces.context.View.servePage(View.java :152)
at com.icesoft.faces.webapp.http.core.MultiViewServer .service(MultiViewServer.java:67)
at com.icesoft.faces.webapp.http.common.ServerProxy.s ervice(ServerProxy.java:11)
at com.icesoft.faces.webapp.http.servlet.MainSessionB oundServlet$4.service(MainSessionBoundServlet.java :149)
at com.icesoft.faces.webapp.http.common.standard.Path DispatcherServer.service(PathDispatcherServer.java :24)
at com.icesoft.faces.webapp.http.servlet.BasicAdaptin gServlet.service(BasicAdaptingServlet.java:16)
at com.icesoft.faces.webapp.http.servlet.PathDispatch er.service(PathDispatcher.java:23)
at com.icesoft.faces.webapp.http.servlet.SessionDispa tcher.service(SessionDispatcher.java:53)
at com.icesoft.faces.webapp.http.servlet.PathDispatch er.service(PathDispatcher.java:23)
at com.icesoft.faces.webapp.http.servlet.MainServlet. service(MainServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:820)
at weblogic.servlet.internal.StubSecurityHelper$Servl etServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invok eServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute( ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(Tail Filter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFi lter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter (FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :3592)
at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.sec uredExecute(WebAppServletContext.java:2202)
at weblogic.servlet.internal.WebAppServletContext.exe cute(WebAppServletContext.java:2108)
at weblogic.servlet.internal.ServletRequestImpl.run(S ervletRequestImpl.java:1432)
at weblogic.work.ExecuteThread.execute(ExecuteThread. java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java :173)
Caused by: javax.faces.FacesException: Can't parse stream for /index.jsp The prefix "jsp" for element "jsp:forward" is not bound.
at com.icesoft.faces.application.D2DViewHandler.rende rResponse(D2DViewHandler.java:445)
at com.icesoft.faces.application.D2DViewHandler.rende rView(D2DViewHandler.java:159)
at com.sun.faces.lifecycle.RenderResponsePhase.execut e(RenderResponsePhase.java:110)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:1 00)
at com.sun.faces.lifecycle.LifecycleImpl.render(Lifec ycleImpl.java:139)
at com.icesoft.faces.webapp.http.core.JsfLifecycleExe cutor.apply(JsfLifecycleExecutor.java:19)
at com.icesoft.faces.context.View$2$1.respond(View.ja va:48)
at com.icesoft.faces.webapp.http.servlet.ServletReque stResponse.respondWith(ServletRequestResponse.java :201)
at com.icesoft.faces.context.View$2.serve(View.java:7 7)
at com.icesoft.faces.context.View.servePage(View.java :149)
... 25 more
Caused by: org.xml.sax.SAXParseException: The prefix "jsp" for element "jsp:forward" is not bound.
at com.sun.org.apache.xerces.internal.parsers.Abstrac tSAXParser.parse(AbstractSAXParser.java:1231)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserI mpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogic XMLReader.java:133)
at weblogic.xml.jaxp.RegistryXMLReader.parse(Registry XMLReader.java:173)
at org.apache.commons.digester.Digester.parse(Digeste r.java:1785)
at com.icesoft.faces.webapp.parser.Parser.parse(Parse r.java:130)
at com.icesoft.faces.application.D2DViewHandler.rende rResponse(D2DViewHandler.java:439)
... 34 more -
First i populate a datatable with no error then i used a commandlink to sort through the list. The new list came out to be fine but the problem i am facing is that my jsp page display the data of the same page index before the sort. For example, before the sort i am viewing page 3. Then after i click the sort, the data is rearranged and will display the new data that is currently positioned in page 3, but i want it to start at page 1. Furthermore, the commandbutton to navigate through the pages no longer work. I think this is due to the lifecycele of JSF. Can someone give me some in sight on how to fix this. Here is the sample of my code.
Bean:
public void populateDynamicDataTable() {
// Any columns?
if (myList != null && myList.size() > 0) {
dynamicDataTable = new HtmlDataTable();
// Get amount of columns.
int columns = ((List) myList.get(0)).size();
// Set columns.
for (int i = 0; i < columns; i++) {
// Set header (optional).
HtmlCommandLink button = new HtmlCommandLink();
MethodBinding actionListener =
FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{viewLog.testListener}", new Class[] {ActionEvent.class});
button.setActionListener(actionListener);
button.setValue(headers);
button.setStyle("color:white");
// Set output.
UIOutput output = new UIOutput();
ValueBinding myItem =
FacesContext.getCurrentInstance().getApplication()
.createValueBinding("#{myItem[" + i + "]}");
output.setValueBinding("value", myItem);
// Set column.
UIColumn column = new UIColumn();
column.setHeader(button);
column.getChildren().add(output);
// Add column.
dynamicDataTable.getChildren().add(column);
dynamicDataTable.setRows(5);
public void testListener(ActionEvent e) throws AbortProcessingException {
System.out.println("hellow rold");
String hei = ((UICommand) e.getComponent()).getValue().toString();
dbTools = new DbTools();
Connection con=null;
try {
con = dbTools.getConnection();
String que = "SELECT * FROM ATTRIBUTE_VALUE_CHANGELOG where submitter_id = '2995' order by attribute_id" ;
ResultSet results=con.prepareStatement(que).executeQuery();
int size =0;
List myID = new ArrayList();
List type = new ArrayList();
List typeID = new ArrayList();
List attributeID = new ArrayList();
List submitter = new ArrayList();
List date = new ArrayList();
List valueOld = new ArrayList();
List valueNew = new ArrayList();
while(results.next()){
myID.add(results.getString(1));
type.add(results.getString(4));
typeID.add(results.getString(5));
attributeID.add(results.getString(6));
submitter.add(results.getString(7));
date.add(results.getString(8));
valueOld.add(results.getString(9));
valueNew.add(results.getString(10));
System.out.println("size of: " + myID.size());
headers = new String[] { "header1", "header2", "header3", "header4", "header5", "header6", "header7", "header8" };
myList = new ArrayList();
for(int i =0; i<valueNew.size(); i++){
String[] row = {myID.get(i).toString(),
type.get(i).toString(),
typeID.get(i).toString(),
attributeID.get(i).toString(),
submitter.get(i).toString(),
date.get(i).toString(),
valueOld.get(i).toString(),
valueNew.get(i).toString()};
myList.add(Arrays.asList(row));
dbTools.close(con);
} catch (SQLException ex) {
System.out.println("error here");
ex.printStackTrace();
populateDynamicDataTable();
//dynamicDataTable.setRows(0);
public void pageFirst() {
dynamicDataTable.setFirst(0);
public void pagePrevious() {
dynamicDataTable.setFirst(dynamicDataTable.getFirst() - dynamicDataTable.getRows());
public void pageNext() {
dynamicDataTable.setFirst(dynamicDataTable.getFirst() + dynamicDataTable.getRows());
public void pageLast() {
int count = dynamicDataTable.getRowCount();
int rows = dynamicDataTable.getRows();
dynamicDataTable.setFirst(count - ((count % rows != 0) ? count % rows : rows));
JSP:
<h:dataTable value="#{viewLog.myList}" var="myItem" binding="#{viewLog.dynamicDataTable}" />
<h:panelGroup>
<h:commandButton value="first" action="#{viewLog.pageFirst}" disabled="#{viewLog.dynamicDataTable.first == 0}" />
<h:commandButton value="prev" action="#{viewLog.pagePrevious}" disabled="#{viewLog.dynamicDataTable.first == 0}" />
<h:commandButton value="next" action="#{viewLog.pageNext}" disabled="#{viewLog.dynamicDataTable.first + viewLog.dynamicDataTable.rows >= viewLog.dynamicDataTable.rowCount}" />
<h:commandButton value="last" action="#{viewLog.pageLast}" disabled="#{viewLog.dynamicDataTable.first + viewLog.dynamicDataTable.rows >= viewLog.dynamicDataTable.rowCount}" />
</h:panelGroup>I have tried adding dynamicDataTable.setFirst(0) at the end of the testListener method where i invoke the sort. The list gets sorted, however, the navigation button gets disabled still
-
(Tomahawk) DataTable sort question
Hello,
I'm showing the system properties on a webpage. The backing bean simply returns a list of entries (java.util.Map.Entry) which are shown by a t:datatable (backing bean has request scope).
So now that they are there, I'd like to have them sorted one way or another. I don't know how to use the sortColumn attribute in this case, perhaps I'll need to sort them in the backing bean instead?
Thanks,
DaveHi!
you dont need to stor in the been.
you can do it in the jsp page like this: (using DataTable from RichFaces)
<rich:extendedDataTable sortPriority="#{spot.startTimeForTable}"
value="#{scheduleResultBean.lspotsOnDate}" var="spot" id="spots"
rowClasses="#{spot.statusName}" >
<rich:column sortBy="#{spot.rating}" filterBy="#{spot.rating}"
filterEvent="onkeyup" label="Rating" >
<f:facet name="header">
<h:outputText value="Rating" />
</f:facet>
<h:outputText value="#{spot.rating}">
</h:outputText>
</rich:column>
</rich:extendedDataTable>I'd like to hear if it helped you to! -
Deleting a dataTable item after sorting
Hello,
I am using a "h:dataTable" which has a 'delete' commandLink on every row.
If I sort the table and then delete an item, the wrong item is deleted.
The deleted item is the item that was originaly in the same place (before sorting).
What should I do to fix that?
Thank you,
DanaShould I call "sortDataList" before deleting the item the way it was sorted in the previous request?
If so, the function should receive an "ActionEvent event".
public void sortDataList(ActionEvent event) {
String sortFieldAttribute = getAttribute(event, "sortField");
}What should I send as the parameter to the sorting function? -
Hi all,
How can the contents of JSF dataTable component be sorted (any column). I need solution in JSF.
can any one show an example or code snippet.
I have this code of dataTable and I want to sort it by Date Created.
How I can associate my code of sort with this column.
<h:dataTable value="#{viewCampaignPageBean.allCampaigns}" var="campaign"
border="1" width="60%" cellpadding = "4" styleClass= "sample" headerClass="th"
>
<h:column>
<f:facet name="header">
<f:verbatim>Title</f:verbatim>
</f:facet>
<h:outputText value="#{campaign.title}" styleClass="tLabel" />
</h:column>
<h:column>
<f:facet name="header">
<f:verbatim>Type</f:verbatim>
</f:facet>
<h:outputText value="#{campaign.campaignType}" styleClass="tLabel" />
</h:column>
<h:column>
<f:facet name="header">
<f:verbatim>Date Created</f:verbatim>
</f:facet>
<h:outputText value="#{campaign.createDate}" styleClass="tLabel" />
</h:column>
</h:dataTable>Thanks in advanceCheck <a href="http://balusc.xs4all.nl/srv/dev-jep-dat.html"></a> � <a href="http://balusc.xs4all.nl/srv/dev-jep-dat.html#SortingDatatable"></a>.
-
How to create a Dynamic Datatable with sorting functioanlity
Hi,
I am new to JSF and need some help can some one please tell me how to create a dynamic datatable with sorting functionality. I am reading data data from a database table and wants to build the datatable dynamically based on the columns returned. I know how to created a datatble with a fixed number of columns but can't figure out how to create a datatable dynamically with sort functionality. Any small example will help.
ThanksHi,
Here is what I have so far and can't figure out how to add the sorting functionality. Any help is appreciated.
Managed Bean:
private List<MyDto> data ;
public HtmlDataTable getDataTableOne ()
if ( dataTableOne == null )
populateCheckBoxes () ; // Preload.
populateDynamicDataTableOne () ;
return dataTableOne ;
public void populateCheckBoxes ()
data = new ArrayList<MyDto> () ;
MyDto myDto1 = new MyDto () ;
MyDto myDto2 = new MyDto () ;
MyDto myDto3 = new MyDto () ;
MyDto myDto4 = new MyDto () ;
myDto1.setChecked ( true ) ;
myDto1.setValue ( "myDto1" ) ;
myDto2.setChecked ( false ) ;
myDto2.setValue ( "myDto2" ) ;
myDto3.setChecked ( false ) ;
myDto3.setValue ( "myDto3" ) ;
myDto4.setChecked ( true ) ;
myDto4.setValue ( "myDto4" ) ;
data.add ( myDto1 ) ;
data.add ( myDto2 ) ;
data.add ( myDto3 ) ;
data.add ( myDto4 ) ;
public void populateDynamicDataTableOne ()
dataTableOne = new HtmlDataTable () ;
UIOutput header = new UIOutput () ;
header.setValue ( "" ) ;
UIColumn tableColumn ;
tableColumn = new UIColumn () ;
HtmlOutputText textHeader = new HtmlOutputText () ;
textHeader.setValue ( "" ) ;
tableColumn.setHeader ( textHeader ) ;
HtmlSelectBooleanCheckbox tCheckBox = new HtmlSelectBooleanCheckbox () ;
tCheckBox.setValueBinding ( "value" , FacesContext.getCurrentInstance ().getApplication ().createValueBinding ( "#{row.checked}" ) ) ;
tableColumn.getChildren ().add ( tCheckBox ) ;
// Set output.
UIOutput output = new UIOutput () ;
ValueBinding myItem = FacesContext.getCurrentInstance ().getApplication ().createValueBinding ( "#{row.value}" ) ;
output.setValueBinding ( "value" , myItem ) ;
// Set header (optional).
UIOutput header2 = new UIOutput () ;
header2.setValue ( "" ) ;
UIColumn column = new UIColumn () ;
column.setHeader ( header2 ) ;
column.getChildren ().add ( output ) ;
dataTableOne.getChildren ().add ( tableColumn ) ;
dataTableOne.getChildren ().add ( column ) ;
MyDto.java
public class MyDto
private Boolean checked;
private String value;
public MyDto ()
public void setChecked ( Boolean checked )
this.checked = checked;
public Boolean getChecked ()
return checked ;
public void setValue ( String value )
this.value = value;
public String getValue ()
return value ;
JSP
<h:dataTable id="table" value="#{myRequestBean.data}" binding="#{myRequestBean.dataTableOne}" var="row" />Thanks -
X:dataTable sort arrow rendered as question mark (?)
Hey All:
I am using tomahawk 1.1.3 and when I use sortable columns with x:dataTable, the sort arrows are being rendered as question marks (?). Any ideas?were would be the place to find the original system install CD.
Ideally, your friend:
My Friend gave me his Old Imac G5
The Apple Store may have original system install discs but I would be surprised since no Apple Store in the US that I know of sells them any longer.
It will not be free, but if they have one that would be the best option. Otherwise you will have to peruse the used market. In the US that could be Amazon Marketplace or eBay. I do not know where you would start in India, but many eBay sellers ship worldwide.
Make absolutely certain you are getting a full retail installation CD and if it is Leopard or Tiger, make sure it is for your G5 and not an Intel iMac. System specific disks are grey in color and will not work except for the exact system with which they were included.
Maybe you are looking for
-
I have a table with info and would like to select an item from that table
Hi I have a table with info (course info that I searched for) and would like to select an item from that table to use for further use in my application. It must work more or less like the tree structure where I can use an On Action select. In other w
-
I have strange problem with my mp3 player. When I bought it, it was all ok, I uploaded songs etc. But now mp3 player is just recharging but computer don't recognize it, I can't upload new songs. I don't why :/ Any sugestions ?
-
How do you find out how many views and downloads a podcast has had?
How do you find out how many views and downloads a podcast has had?
-
Need attachment file name which had sent or received in entire days.
Hi Friends I need your help for getting information on exchange mailbox user who had sent or received mails along with attachment file name for entire day. Basically I get the information of entire mails which had received or sent in all days but I
-
Error en Salida de Mercancías por Data Transfer
Buen día y Feliz Año Tengo la versión SAP Business One 2007 A (8.00.234) SP: 01 PL: 09 HOTFIX4 Al momento de tratar de crear por medio de DTW una salida masiva de productos, me marca el error: [IGE1.ItemCode][Line: 72], 'On Hold' - 'Error definido