Tomahawk dataTable Issue
i have a Datatable which displays employee Salary Details, i implemented using tomohawk data table to display the data as below,/
Year Salary Bonus Proposed Salary
2007 15000 1400 19000
2006 13000 1000 14000
2005 12000 1000 13000 but my requirement is displaying that data vertically, as below. here salary,bonus,proposed salary are the columns we are getting from database, any one please help me....
Year 2007 2006 2005
Salary 15000 13000 12000
Bonus 1400 1000 1000
Proposed Salary 19000 14000 13000
Thanks in Advance.
i have a Datatable which displays employee Salary Details, i implemented using tomohawk data table to display the data as below,/
Year Salary Bonus Proposed Salary
2007 15000 1400 19000
2006 13000 1000 14000
2005 12000 1000 13000 but my requirement is displaying that data vertically, as below. here salary,bonus,proposed salary are the columns we are getting from database, any one please help me....
Year 2007 2006 2005
Salary 15000 13000 12000
Bonus 1400 1000 1000
Proposed Salary 19000 14000 13000Thanks in Advance.
Similar Messages
-
(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! -
Datascroller working with dataDefinitionList/datatable issue
Hi
I used the datascroller in conjunction with the dataDefintionList to achieve pagination for search results.
If I search for an item which has 10 pages of results, clicking on page 1,2,...,10 works fine. However, if I click on *>>* it loads page 7 of the search results. However, the *>>* control works perfect after this. I am wondering if anyone else has come upon this.
I have also noted this behavior using the datascroller in conjunction with a datatable. Like I say, the *>>* control works fine after the first usage. Why it jumps to page 7(generally) on the first usage of it I don't know.
Thanks
Joe
<rich:datascroller for="calendarEntries"
binding="#{calendarController.dataScroller}"
maxPages="#{calendarController.maxPages}" fastControls="show"
pagesVar="#{calendarController.pageCount}"
pageIndexVar="pageIndex" pages="page"
page="#{calendarController.currentPage}" boundaryControls="show"
renderIfSinglePage="false" reRender="tableDisplayMode"
tableStyleClass="dataScroller" selectedStyleClass="active"
inactiveStyleClass="inActive"
actionListener="#{calendarController.viewPageActionListener}">
</rich:datascroller>
<rich:datascroller for="listDisplayMode"
maxPages="#{searchController.maxPages}"
fastControls="show"
pagesVar="#{searchController.pageCount}"
pageIndexVar="pageIndex"
pages="page"
page="#{searchController.currentPage}"
boundaryControls="show"
renderIfSinglePage="false"
reRender="listDisplayMode"
tableStyleClass="dataScroller"
selectedStyleClass="active"
inactiveStyleClass="inActive"
actionListener="#{searchController.viewPageActionListener}"
rendered="#{searchController.searchReturned and sessionController.listDisplayMode}">
</rich:datascroller>Hi,
I have find the way.
We should use
<f:verbatim>
<br />
</f:verbatim>here is the example
<h:column binding="#{general$Job_Details.column4}" id="column4">
<h:outputText binding="#{general$Job_Details.outputText7}" id="outputText7" value="Low Bid : #{currentRow['LOW_BID']}"/>
<f:verbatim>
<br />
</f:verbatim>
<h:outputText binding="#{general$Job_Details.outputText9}" id="outputText9" value="High Bid : #{currentRow['HIGH_BID']}"/>
<f:verbatim>
<br />
</f:verbatim>
<h:outputText binding="#{general$Job_Details.outputText13}" id="outputText13" value="Bid Count : #{currentRow['BID_COUNT']}"/>
<f:facet name="header">
<h:outputText binding="#{general$Job_Details.outputText8}" id="outputText8" value="Bid Status"/>
</f:facet>
</h:column>Regards
Sudhakar -
Cellspacing in tomahawk datatable
Can someone please advise me how to get rid of the cellspacing in the a myspaces datatable?
example here:
http://www.irian.at/myfaces/optDataTable.jsf
Thank You.Allow me to answer my own question.. partially.
The error is due to a custom component parsing error of a null object.
The object is null I suspect due to the way I'm "replacing" a managed bean with the user selected object.
As you were. -
Tomahawk t:dataTable question, please help
I am using tomahawk dataTable and dataScroller tags to display results retrieved from database. For each row, I would like to have a button that will edit a value associated with that particular row. But the JSF gave all rows on the page same id, when I press one button, every row was fired off. Any suggestion is highly appreciated.
Here is my code:
<t:dataTable id="data" styleClass="TabForegroundColor" headerClass="standardTable_Header" footerClass="standardTable_Header"
rowClasses="AltRows1, AltRows2"
columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
var="bl" value="#{ctReportdatahandler.ctReportModel}"
rows="#{ctReportdatahandler.noOfRows}"
rowIndexVar="index"
forceId="true" forceIdIndex="true"
sortColumn="#{ctReportdatahandler.sort}"
sortAscending="#{ctReportdatahandler.ascending}" preserveSort="true">
<t:column>
<f:facet name="header">
<h:outputText value="" />
</f:facet>
<h:commandButton value="h" actionListener="{ctReportdatahandler.historyCtBarcodes}" action="#{ctReportdatahandler.dummy}" onclick="barcodeHistory('#{bl.ctBarcode}')" styleClass="Button" /> </t:column>
Incorrect source:
<tr class="AltRows1"><td class="standardTable_Column"><input id="_id26:data:_id29" name="_id26:data:_id29" type="submit" value="h" onclick="barcodeHistory('CT00468873');clear__5Fid26();document.forms['_id26'].elements['autoScroll'].value=getScrolling();" class="Button" /></td</tr>
<tr class="AltRows1"><td class="standardTable_Column"><input id="_id26:data:_id29" name="_id26:data:_id29" type="submit" value="h" onclick="barcodeHistory('CT00468877');clear__5Fid26();document.forms['_id26'].elements['autoScroll'].value=getScrolling();" class="Button" /></td></tr>
Both buttons are id26:data:id29, I expect the first row id26:data0:id29 and 2nd row id26:data1:id29 so if I press button for row 0, row1 button won't get fired off.Thank y'all for responding. I am using SUN RI with Tomahawk. For whatever reason, I am not able to get myfaces to work with my menu:
<t:jscookMenu layout="hbr" theme="ThemeOffice">
<%/* Availaible jscookMenu themes: ThemeIE, ThemeMiniBlack, ThemeOffice, ThemePanel
Availaible jscookMenu layout: hbr, hbl, hur, hul, vbr, vbl, vur, vul
respect to Heng Yuan http://www.cs.ucla.edu/~heng/JSCookMenu
*/%>
<t:navigationMenuItem id="nav_1"
I figured out a work around though:
<t:commandButton value="h" forceId="true" forceIdIndex="true" actionListener="#{ctReportdatahandler.historyCtBarcodes}" action="#{ctReportdatahandler.dummy}" onclick="barcodeHistory('#{bl.ctBarcode}')" styleClass="Button" />
This gives me the unigue id that I am looking for. -
Can�t manage to select a row in a t:dataTable
I use a tomahawk dataTable to list a collection of objects called �dmex� in dmexTable.jsp
When I select one row to edit details in the next page �dmexDetails.jsp� I systematically get the last entries of my table.
In debug mode I could find out that JSF/MyFaces iterates through the whole list instead of selecting only the entry I clicked on.
Here is my code of dmexTable.jsp where #{dmexTable} is a backingBean of dmexTable.jsp and #{dmexBean} the backingBean of dmexDetails.jsp
<h:form id="formDmexTable">
<t:dataTable id="dmexTable"
cellspacing="3"
cellpadding="3"
styleClass="orders"
headerClass="ordersHeader"
rowClasses="evenRow,oddrow"
var="rowDmex"
value="#{dmexTable.dmexList}"
preserveDataModel="true" >
<h:column>
<f:facet name="header">
<h:outputText value="Id" id="columnDmexId" />
</f:facet>
<h:outputText value="#{rowDmex.dmexId}" id="rowDmexId" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{msgsDmex.application}" id="columnApps" />
</f:facet>
<t:commandLink id="selectDmexApps" action="go_to_dmexDetails" immediate="true">
<h:outputText value="#{rowDmex.application}"
id="rowApplication" />
<t:updateActionListener property="#{dmexBean.dmexId}"
value="#{rowDmex.dmexId}" />
</t:commandLink>
</h:column>
� some others properties in other columns �
</t:dataTable>
</h:form>
Herebelow the code of my RequestScope ManagedBean #{dmexTable} containing a property dmexList and a hibernate Class called �dmexManager� that gives access to the dataBase :
public class DmexTable{
private ArrayList dmexList ;
private bsa.integration.service.DmexManager dmexManager;
public ArrayList getDmexList() {
dmexList = (ArrayList) dmexManager.findPoolList(new Dmex())
return dmexList;
public void setDmexList(ArrayList dmexList) {
this.dmexList = dmexList;
SOFAR EVRYTHING WORKS FINE ; I can list my dmex in the dataTable dmexTable !
Here below is the code of my JSP view called �dmexDetails.jsp� where #{dmexBean}is still the backingBean of the view :
<h:form id="formDmexIdentification">
<t:saveState value="#{dmexBean.dmexId}" />
<h:panelGrid columns="2">
<h:outputText value="id" styleClass="sorti" />
<h:outputText value="#{dmexBean.dmex.dmexId}"styleClass="sorti"/>
<h:outputText value="#{msgsDmex.application}" styleClass="sorti" />
<h:inputText value="#{dmexBean.dmex.application}"
size="6" styleClass="ent" required="true" id="inputApplication" />
<h:message for="inputApplication" styleClass="mess" />
Herebelow the code of my RequestScope ManagedBean #{dmexDetails} containing the �t:saveState� property dmexId and the hibernate Class �dmexManager� that gives access to the dataBase :
public class DmexBean {
private int dmexId ;
public int getDmexId() {
return dmexId;
// this is the method that JSF/MyFaces iterates through when clicking on one commandLink of the Table !!!
public void setDmexId(int _rowDmexId) {
if (_rowDmexId > 0)
dmex = getSimpleDmex(_rowDmexId);
if (dmex == null) {
return;
private Dmex getSimpleDmex(int _id) {
dmex = (Dmex)dmexManager.findOneId(new Dmex(),_id);
return dmex;
I can�t figure out why clicking on the command Link JSF/MyFaces does not simply send back the selected dmexId !
May someone give a hint ? I have nomore Idea since my implementation seems exactly similar to the MyFace example I used ..Hello !
Okay, I could see the message you logged a few days before about a similar issue you identified as a Bug ... then after upgrading MyFaces to Core 1.1.3 + Tomahowak 1.1.2 I could make my test case work.
The further issue I am facing now is that in my Detail view dmexDetails.jsp when I try to POST the form I got for each inputText field the following message :
"inputText field id : Error during model data update "
I "googled" on it without success ... I am still investigating !
regards
lsalse -
How to rotate a dataTable in jsf?
Hello,
I need to display a list of products in jsf "vertically" - so every product is in its own COLUMN, not ROW as usually.
Can this be done with somehow "rotating" Tomahawk dataTable? or maybe using some other component?
tnx,
KaurNot possible.
Use a custom component or t:dataList / ui:repeat with your own shot of HTML. -
Remove Image Icon in DataTable
Hai EveryBody,
I had implemented a Data Table with dynamic rows and columns using JSF and now I would like to invoke a Trash Image Icon(<h:graphicimage>) in one of the column in the datatable.so if I click that Icon the entire row of the DataTable should be erased.Could any give me a valuable inputs on this regarding..
Thanks in Advance!!!Shakeel.Abbas wrote:
you must use tomahawk datatable because <h:datatable have some bugs ie specially in case of command linkYou've never used a JSF version newer than 1.x_02 (out since 2006) ?
in command link use <f:params to set parameters that will be used in action method ie the id of the record to be deletedRather use UIData#getRowData() to retrieve the actual row object in question. Also see [http://balusc.blogspot.com/2006/06/using-datatables.html]. -
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 -
h:commandLink inside t:dataTable
Hi ,
I am using Tomahawk datatable and inside this datatable there is JSF HTML commandlink.
when clicking the record in a datatable my action method is executing for multiple number of times. If there are four results present in datatable my action method is executing for four times. Is there any way to stop multiple calls and should execute only once.
In JSP
<t:dataTable id="searchProcCodeResults" value="#{SearchRatesDataBean.searchResultList}"
var="searchDetails" rows="10" >
<h:column id="procCol">
<h:commandLink id="edit" action="#{SearchRateProcedureCodeControllerBean.getRatePCProvSpeDetails}">
<h:outputText id="valueProc" value="#{searchDetails.procCode}" />
<f:param name="procedureCode" value="#{searchDetails.procedureCode}" />
<f:param name="providerSpecialtyCode" value="#{searchDetails.providerSpecialtyCode}" />
<f:param name="lobcode" value="#{searchDetails.lobCode}" />
</h:commandLink>
</h:column>
</t:dataTable>take a HtmlDataTable refrece varible in your backing bean and create setter and getter method corresponding to it ,then bind this data table using the binding attibute in your jsp then you can can get the particular row data on calling getRowData() method on HtmlDataTable object and cast it to your's receiving object.
-
How to create customized DataTable???
Hi all,
I will have to create Customized DataTable.
Requirements for the DataTable are mentioned below
1.*DataTable Should Accept An Array from which Column Name Values are iterated.*
2.*DataTable Should Accept List from which rows are iterated as usual.*
can anyone guide me how to create this dataTable?
Thanks & Regards,
sundarsundar82 wrote:
Thanks 4 d reply Reymand,is it possible to write the DataTable by extending Tomahawk DataTable?That sounds like a reasonable approach to me. -
I have a JSF page access a session scoped bean that maintains a datatable. When I first load the page, it correctly displays rows 1 through 20 (the values of the variables configured for "first" and "rows"). There are 150 items in the list ("#{alerts}"). However, when I perform any operation from the page (commandLink pointing to the session bean) the underlying collection is being replaced by a collection that only holds the 20 items that were displayed. Any ideas???
I have the following datatable setup (It's the MyFaces/Tomahawk dataTable):
<t:dataTable id="grid"
sortColumn="#{alertSession.sortColumn}"
sortAscending="#{alertSession.sortAscending}"
preserveDataModel="true"
preserveSorting="true"
rows="#{alertFilter.pageSize}"
first="#{alertSession.firstRow}"
value="#{alerts}"
var="alert" >Followup: if I remove the "preserveDataModel" attribute the problem goes away. Now I confess I don't understand that attribute the way I thought I did. I had thought is was a MyFaces workaround for the fact that JSF pages are loading the data model twice due to the processing performed during the various states of the page loading. However, it seems to be causing the current view of the model (i.e. the 20 rows that I'm displaying in the table) to be put back into the model on the server side, destroying the original collection.
-
I need to display a sortable dataTable. I look in some forums and find soemthings like this:
<h:dataTable sortable=true sortColumn="#{list.sort}" ...>
But in my environement, it is impossible to write "sortable" and "sortColumn" attributes:
"Atribute sortable invalid for tag dataTable according to TLD"
Environement:
- IDE=NetBeans 6.7.1
- Server=Glassfish v3 Prelude Domain
Any idea ?.. and in Tomahawk datatable.
If you insist in using the RI datatable, or rather want the most effective method to page and sort a table in JSF, then check this article: [http://balusc.blogspot.com/2008/10/effective-datatable-paging-and-sorting.html]. -
How to apply different CSS styles to different table cells?
I have an h:dataTable table and I would like to apply different CSS styles to different table cells depending on their content. If I were doing JSP I would probably have a <c:if> test on the cells, and give them a style name depending on contents, and then define the styles in a separate style sheet. Is there a way in JSF to do the equivalent? Thanks.
mitchgart wrote:
BalusC wrote:
How to achieve a cell-specific style is already answered in my 1st reply of this topic.That tells how to apply a style to the text (or other content) inside a cell but not how to apply a style to the <td> as a whole. It would work for something like text font or text color but not cell border.
I'm thinking I can mark the content somehow and then have javascript traverse the DOM, find marked content, and traverse outward to the enclosing <td>. Is there a better way?BalusC already spoke about rowClasses and columnClass attributes, I assume those are insufficient.
The Tomahawk dataTable component has the rowStyleClass and rowStyle attributes for assigning CSS to the HTML tr tag. One is allowed to reference the row data variable when assigning values to these. However, see https://issues.apache.org/jira/browse/TOMAHAWK-523 for workarounds to bugs in some implementations.
The Tomahawk column component has the styleClass and style attributes for assigning CSS to the HTML td tag. These also may reference the row data variable. -
The issue with dataTables is well known - they currently don't handle fields with nulls in them gracefully. But it also appears there is an issue with standard rowSets -
I have a panelGrid of textFields, and if one of my columns in the rowSet is null, the page doesn't even create the HtmlInputText object's value - so when I try to use the idiomatic phrase:
fooRowset.updateString("Col1", getTfName().getValue().toString() );
I throw a null ptr exception from the subphrase "getTfName().getValue()" (I broke it all out and did it step by step...)
Question, when the dataTable issue with nulls gets figured out, will have a fix for this one too? Will the update center have a patch of any this anytime before the end of the year? (I'm starting to push my deadlines.)
(On a related point, the fix that I used for the editing of nulls in tables as posted here in a thread doesn't work in this case, because you can't 'loop' thru the textFields...)
(Maybe a dataTable that can be layout 'sideways' would be useful? If it did a vertical layout, with rows marching off to the right, instead of down, would atleast give us a way to edit a record in a rowset that only contained one row... and we wouldn't have to mess with panel grids??) I'd write something if I knew how... have a rowSet, and create a 2-column panelGrid with the name of the column in a outputText, and then the value of the row's column in a textField... some sort of dataForm object on the palette... california dreamin'....
cheers.Hi,
Thanks for your Suggestions. A request has been filed for the same.
Regards.
Maybe you are looking for
-
Hi, I've purchased a few films from itunes (and they are listed as Purchased in my account), but I can't find them on my computer or my itunes account, and itunes wants me to pay for them again. How do I get around this? I've tried all the suggestion
-
(SOLVED) external hard drive
when i try to delete files on my external hard drive i get error could not delete file. do i need any special permissions or what? Please help. Thanks! Last edited by Rician (2011-04-02 16:16:26)
-
ISR Form is hanging after converting to ZCI
Hi experts, We are on EP7 ECC 6.0 SP9. We have recently converted few ISR forms (SAP delivered forms for PCR) to ZCI. The form is hanging when clicked on 'Review Form' . Earlier before changing the forms to ZCI at least we used to go to the next scre
-
File-Export grayed out in CS4 Photoshop 64-bit
Is it because no 64-bit export modules are available? Thanks, Dave I am running on Windows 7
-
Help me for the requirement.....obiee 10g
Hi, I have a requirement like when i select LAN from service pack then it needs to show the Metal Class + Service Pack + Switch Type for LAN If i select other than LAN then it need to show the Metal Class + Service Pack for WAN, Video Conferencing an