Rowspan in datatable: how?

Hi all,
I have a problem displaying my data in a datatable. Actually, I have a list of dates, each with a number of events (in a list that is a class variable of "MyDate" class). I wish to display this datastructure into a database so that the date is in the first column and the event details in the next cols. The event column must however span the number or rows equal to the number of events there are on that day.
So far I have been unable to do this with a standard component. Is this possible with the default JSF components or what library could I use to realise this?
Many thanks,
Steven

hey,
i have used the richfaces component
<%@taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich" %>u can set rowspan and colspan in this component like this ..
<rich:column id="usernameheader" rowspan="2">
                                <h:outputText value="User Name" />
                            </rich:column>hope that will help
Edited by: BirenB on Apr 2, 2008 10:02 PM

Similar Messages

  • JMaki yahoo.dataTables - how to remove cache for EntityManager?

    Hi i'm using NetBeans6.1, GlassFish2, TopLink and jMaki 1.0. I've created an admin page for viewing and editing users details. The page contains 3 yahoo.dataTables (because there's no option for listing data vertically using a yahoo.dataTable), one for listing 'Users', one for listing 'Personal Details' and another listing 'Activity' (flags and dates) and a few yahoo.buttons. Selecting a row in dataTable 1 updates tables 2 and 3 respectivly.
    I'm using a servlet which sits between j_security_check which allows the use of custom login functionality eg. If a user has exceeded the failed login attempts limit, the user is locked out. An admin user may then enter the admin section and clear the 'locked out' flag by clicking one of the yahoo.buttons. tataTable's data is loaded via data.jsp pages using EntityManager and EntityClasses's.
    Once a button is clicked to set a flag via glue, the sql database table is updated but when i call the same functions which populates tables 2 and 3 the data is not refreshed. If another page is navigated to then navigate to the users page, the data is refreshed.
    How can i set an EntityManager to use no cache?
    I'm using inline code on data.jsp pages for EntityManager declarations and data retreival then spitting out JSON code. Should i be placing code in a java class to create a stateless EntityManager or is there an EM property allowing no cache? Any help would be much appreciated.

    Hi mustafa,
    Your performance will not degrade if you run the query second time ( if i understood correctly, you worry about the performance if you execute the procedure second time). Executing/running the code/sql statements over and over again will have following two good benefits.
    1) This will avoid hard parsing (Hard parsing is resource intensive operation and this generally increase the overall processing time.
    2) This will avoid physical read IO (You gonna see the benefits if data blocks already cached and you dont have to spend time in reading blocks from disk. Reading from disk is much costlier and time consuming operation as compared to data in RAM)
    Having that said sometime bad written queries will acquire more blocks then required and consume most part of buffer cache, and this can some times effect the other important blocks and force to flush out from buffer cache.
    Oracle have built some intelligence for large full table scan operations for e.g will doing full table scan(I hope you already know what is fts) oracle will put its blocks at end of LRU chain. So these will be the buffers will would flush out first then any other.
    From oracle documentation:
    "When the user process is performing a full table scan, it reads the blocks of the table into buffers and puts them on the LRU end (instead of the MRU end) of the LRU list. This is because a fully scanned table usually is needed only briefly, so the blocks should be moved out quickly to leave more frequently used blocks in the cache.
    You can control this default behavior of blocks involved in table scans on a table-by-table basis. To specify that blocks of the table are to be placed at the MRU end of the list during a full table scan, use the CACHE clause when creating or altering a table or cluster. You can specify this behavior for small lookup tables or large static historical tables to avoid I/O on subsequent accesses of the table."
    Regards
    Edited by: 909592 on Feb 6, 2012 4:37 PM

  • Datatable: How to limit entries (paging)?

    Hello Guys,
    I am having a question to datatables (I am using the sun reference implementation).
    How is it possible to create a datatable with just 10 or 20 entries. Below that table I would like to have links for more pages like:
    [datatable]
    <<(prev page) 1,2,3, (next page)>>
    Thanks for your help!

    Are you talking about a Visual Web Java ServerFaces Project (Netbeans 6.1) or can I also do it with a standard JSF Project (which my project is programmed in)?
    Right now I am getting the data from a method of a Bean, which returns a vector with data objects. These data objects are displayed in the data table.
    Thanks for helping
    I just found something useful on BalusC-Blog, I will try this first and reply if it helped:
    http://balusc.blogspot.com/2006/06/using-datatables.html#PagingDatatable
    Edited by: Varox on Sep 8, 2008 12:37 PM
    It worked out well!
    BalusCs blog is really the best :)
    I learned so many things because of it!
    Thanks for your help too Chamila Amabahera
    Edited by: Varox on Sep 8, 2008 1:00 PM

  • DataTable  How to calculate "x of y rows displayed"

    Does anyone know of a quick way to determine how many rows are available in the result set and how many are shown in a datatable so I can create a line:
    x rows found. Showing rows y-z

    Hello,
    You can try this
    Create a CKF and assign the vale 1 to it. Open the query and select Character where you want to display ' number of rows ', go to properties windows, select 'display', in the results row drop down box, select  'always display'.
    Thanks.
    With regards,
    Anand Kumar

  • StaticText in Datatable-How to implement

    Hi,In my datatable two columns should be static that will not be changed.Other two columns should contain inputtext field.
    This is the sample of the code.
    <h:dataTable value="#{UserController.users}"
    var="dataTableItem">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Username"/>
    </f:facet>
    <h:outputText value="row1" />
    <h:outputText value="row2" />
    <h:outputText value="row3" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="First name"/>
    </f:facet>
    <h:inputText value="#{dataTableItem.firstName}" />
    </h:column>
    </h:dataTable >
    When I run this code row1,row2,row3 gets displayed in every row of the table.
    Is this the correct way to proceed (or ) any other way to implement this.
    Thanks in advance.

    Your code is correct and the behaviour is correct.
    It would help more if you elaborate a bit more about the functional requirements.
    This article might be helpful as well: http://balusc.blogspot.com/2006/06/using-datatables.html

  • How to insert additional column header using dataTable

    Hi everyone, I am using MyFaces 1.1.3, tomahawk 1.1.3, tomahawk-sandbox 1.1.5
    I have to add one column header "Proficiency" as in image [http://www.nabble.com/file/p17206601/screenshot.jpg]
    This is JSF code without "Proficiency":
    <t:dataTable id="data" value="#{commonBean.tableList}" styleClass="standardTable" headerClass="table_header" rowClasses="table_row1, table_row2" columnClasses="standardTable_Checkbox_Column,standard_text,standardTable_Checkbox_Column,standardTable_Checkbox_Column" var="value" preserveSort="true" rows="10" width="100%" border="0" sortColumn="#{commonBean.sortColumn}" sortAscending="#{commonBean.ascending}" cellpadding="2" cellspacing="1" rowIndexVar="tableRowIndex">
         <h:column>
              <f:facet name="header">
                        <h:panelGrid styleClass="table_header2">
                                  <h:outputText value="#{msg['select']}" />
                        </h:panelGrid>
              </f:facet>
              <h:selectBooleanCheckbox id="select" value="#{value.select}" />
         </h:column>
         <h:column>
              <f:facet name="header">
                        <t:commandSortHeader columnName="languageSkill" arrow="true" styleClass="table_header">
                                  <h:outputText value="#{msg['language.skill']}" />
                        </t:commandSortHeader>
              </f:facet>
              <h:commandLink action="#{commonBean.editAction}" actionListener="#{commonBean.editActionListener}">
                        <h:outputText value="#{value.languageSkill}" />
              </h:commandLink>
              <f:param id="object" value="#{value}" />
         </h:column>
         <h:column>
              <f:facet name="header">
                        <h:outputText value="#{msg['spoken']}" />
              </f:facet>
              <h:outputText value="#{value.spokenDescription}" styleClass="standardText"/>
         </h:column>
         <h:column>
              <f:facet name="header">
                        <h:outputText value="#{msg['written']}" />
              </f:facet>
              <h:outputText value="#{value.writtenDescription}" styleClass="standardText"/>
         </h:column>
    </t:dataTable>How to do ?
    Thanks for your help
    Edited by: nvduc82 on May 13, 2008 12:09 PM
    Edited by: nvduc82 on May 13, 2008 8:46 PM

    I see 2 possibilities:
    1. Merge two last columns. And then use panelGrid inside the cells.
    2. Use JSTL and tag forEach. I found it much easy-to-use.

  • How to select one row from the datatable

    hi,
    I have a data table which displays the employee list .the table contains 4 columns which represents the employee code,address,status like that.
    when we click on particular row,the row must be selected and the total details of the employee will be displayed on the same page below the datatable.
    how to write the code for this.

    Hi
    Jsp Page
    <h:dataTable value="#{bean.list}" var="role" binding="#{bean.table}">
    binding- attribute need to include in dataTable tag
    Bean
    1> private UIData _table; as variable
    2>Getter and setter Methods
    public void setTable(UIData table) {
    _table = table;
    public UIData getTable() {
    return _table;
    3> Object objectName=(Object)_table.getRowData();; -- include the code in the method u wanna fetch the row data.
    It'll work

  • Add row counter in output for datatable

    How would one add a row counter on the output of a datatable component.
    The datatable will be populated from a database resultset
    The out put should be as follows
    1 data columns .......
    2 data columns .......
    3 data columns ........
    <h:dataTable value="#{register.newregistrations}" var="payment">
    <h:column>
         <h:outputText value="#{payment.counter}"> <<<< what can I replace this with ????
         </h:outputText>
    </h:column>
    <h:column>
         <h:outputText value="#{payment.expiry_date}">
         </h:outputText>
    </h:column>
    </h:dataTable>
    How do I create the row counter .

    The Following post is a solution
    http://forum.java.sun.com/thread.jspa?forumID=427&threadID=549084

  • SelectOneRadio inside datatable?

    How do I put a <h:selectOneRadio> inside a datatable> Ie if I wanted to rank names from 1 to 3?
    <h:dataTable value="#{bean.myNames}"
    var="n"
    >
    <h:column>
    <f:facet name="header">
    <h:outputText value="Function Name"/>
    </f:facet>
    <h:outputText value="#{n.Name}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Rank"/>
    </f:facet>
    <h:selectOneRadio binding="#{bean.selectOneRank}" >
    <f:selectItem itemValue="1" />
    <f:selectItem itemValue="2" />
    <f:selectItem itemValue="3" />
    </h:selectOneRadio>
    </h:column>
    </h:dataTable>
    How do I in the bean say that name y got rank z?

    Worked thanks...
    I wish you could iterate though two items at one time in a data table... like this
    List temp;
    List temp2;
    for (int i=0; i<temp.size(); i++){
    temp.get(i);
    if (temp2.get(i)) temp2.get(i);
    But in a datatable....
    I also found this
    http://www.javaworld.com/javaworld/jw-02-2007/jw-02-jsf.html?page=2
    That would work better IMHO
    Thanks for your help.

  • Banding attribute in data table not working

    Hi all,
    I am using the table for displaying rows of data from the backing bean. I set the banding attribute to be "row" and the bandingInterval="1",but I don't see the effect of these attributes when the table is rendered. Anything I miss in the backing bean? In case I can't make this work, I would want to fall back to drawing row and column grids in the table, similar to the "rule" attribute in the basic jsf dataTable, how do achieve the same thing with ADF table?
    Thank you,
    Lngo

    Hi,
    Can you try by casting row with PoRequisitionLinesVORowImpl.
    Something like below
    PoRequisitionLinesVOImpl xxReqLineVO = am.getPoRequisitionLinesVO();
    PoRequisitionLinesVORowImpl xxReqLineRow = null;
                for(xxReqLineRow = (PoRequisitionLinesVORowImpl)xxReqLineVO.first(); xxReqLineRow != null; xxReqLineRow = (PoRequisitionLinesVORowImpl)xxReqLineVO.next())
                    try
                        String xxdelToLocId = xxReqLineRow.getDeliverToLocationId().toString());
                        if(<your condition   >)
                            xxReqLineRow.setAttribute1("");
                        else
                            xxReqLineRow.setAttribute1("xx_YOUR_VALUE");
                    catch(Exception e)
                        throw OAException.wrapperException(e);
                xxReqLineVO.reset();
            }Thanks,
    Jit

  • Dynamic HtmlDataTable issue.

    I am populating the HtmlDataTable dynamically through an ArrayList of String[] objects(rowData) where rowData is populated from database. Its working fine.
    Now I need to create a Link inside the datatable where the target and text of the link is also defined in the ArrayList ... something like
    rowData[0] = { "11/10/2007", "http://www.yahoo.com", "Link to Yahoo", "some input text" }
    rowData[1] = { "11/11/2007", "http://www.msn.com", " Link to Msn", "some text"}
    Now I need to display the link in the DataTable something like
    Date:            Link                  Input Text
    11/10/2007 Link to Yahoo    some input text
    11/11/2007 Link to Msn     some text
    Where Link to Yahoo is an anchor pointing to "http://www.yahoo.com"
    Now my question Is when I am displaying the datatable how do I traverse through the rows of the datatable... My code below does the display of the datatable.
        private void populateDynamicDataTable() {
            dynamicDataTable = new HtmlDataTable();
            dynamicDataTable.setValueBinding("value", app.createValueBinding("#{DynamicViewBean.dynamicList}"));
            dynamicDataTable.setValueBinding("binding", app.createValueBinding("#{DynamicViewBean.dynamicDataTable}"));
            dynamicDataTable.setVar("dynamicItem");
            dynamicDataTable.setRows(3);
            // No Columns...dynamicHeaders is an ArrayList of columns
            int columns = dynamicHeaders.size();
            for (int i = 0; i <= columns; i++) {
                                 // Create column.
                                UIColumn column  = new UIColumn();
                     column.setId(createID());
                     // Create header and add to column.
                     HtmlOutputText header = new HtmlOutputText();
                     header.setValue(dynamicHeaders.get(i));
                     column.setHeader(header);
                     header.setId(createID());
                     // Create output and add to column.
                     HtmlOutputText output = new HtmlOutputText();
                     output.setValueBinding("value",app.createValueBinding("#{dynamicItem[" + i + "]}"));
                     output.setId(createID());
                     column.getChildren().add(output);
                     // Add column to datatable.
                     //dynamicDataTable.setTransient(true);
                     dynamicDataTable.getChildren().add(column);
                }Now I have tried to get the column Value through the variable dynamicItem...
    String linkTarget = (String) resolveExpression("#{dynamicItem["+ i +"]}"); // get the Link
    But this resolves to null.
    This is code for resolveExpression...
         protected Object resolveExpression(String expression) {
              Object value = null;
              if ((expression.indexOf("#{") != -1)
                   && (expression.indexOf("#{") < expression.indexOf('}'))) {
                   value =
                        getFacesContext().getApplication().createValueBinding(
                             expression).getValue(
                             getFacesContext());
              } else {
                   value = expression;
              return value;
         }I have also tried to use the getRowData() method of the HtmlDataTable
    String row [] = (String[]) dynamicDataTable.getRowData();
    But this returns the same row for each column..
    Any ideas how can I get the data within the HtmlDataTable ?
    Any help will be appreciated ?

    No replies :(...
    One other question (probably this is not a jsf question) I had was If i generate the whole anchor tag within the rowData variable of dataList itself e.g.
    rowData[1] = { "11/11/2007", "<a href=http://www.msn.com>msn</a>", "some text"}
    How can I display the anchor tag in the JSF datatable as a LINK ? Right now it just shows up as plain text..
    Any ideas ?

  • Page Total for a Column in JSF HtmlDataTable

    Hi All,
    I need an example to calculate page total for price column in HtmlDataTable.
    Each page displays 10 rows and there are 50 rows hence 5 pages in datatable.How to calculate page total after displaying the rows on page.
    Thanks in advance.

    Just get the desired sublist of the datalist and sum the price? You can get the starting index and the rowcount from the HtmlDataTable by its getFirst() and getRows() methods respectively and use it in List#subList(). Then iterate over the list and add the price value of every item in a loop to the total value. You can display it in the footer of the datatable. You can define a footer with <f:facet name="footer">.

  • Using joins In toplink

    Hi.I'm using toplink with JSF in Jdeveloper.I want to retrieve data by which uses joins between various tables and and then display it in a datatable.how can I do this??Also,I want scrolls in the datatable with one column fixed and the rest of the columns scrollable.How can I do this?

    To specify joins within your TopLink query in 10.1.3 JDeveloper and earlier you will need to use some customization code ( a descriptor after-load) to set the joining through code. This will be declaratively available a future release.
    To have your data table include columns from related entities you can add columns to the table and use the expression language to access values from related objects.
    Doug

  • Multiple calls to ValueChangeListener through only one change event...

    Hi All,
    I created a datatable that contains a set of records, each record consists of checkbox , name and account ...
    I registered a ValueChangeListener for the checkbox...when I press any of the checkboxes...the method is called for all the checkboxes in the datatable...what if I want only that checked checkbox to be selected...
    A appreciate any help...
    Thanks...
    <h:dataTable value="#{CustomersDB.subCustomers}" var="customers" border="1" id="custtable">
    <!--oracle-jdev-comment:Faces.RI.DT.Class.Key:java.util.List<customers.Customer>-->
    <h:column>
    <h:selectBooleanCheckbox value="false" valueChangeListener="#{Customer.addUserToList}"/>
    </h:column>
    <h:column>
    <h:outputText value="#{customers.name}"/>
    </h:column>
    <h:column>
    <h:outputText value="#{customers.account}"/>
    </h:column>
    </h:dataTable>

    How very weird.  If I step through the change logic (into the JavaFX library source), for each r.setName call line-by-line using the Intellij Idea debugger, then the behavior is as expected and all changes are reported.  If I just run the program without stepping (either inside or outside the debugger), then not all changes are reported (as in your question).  So it seems that stepping through in the debugger somehow triggers the evaluation of some expression which lazily resolves the property change correctly. Schrödinger's cat has been irradiated
    I glanced through the JavaFX 8u40 source and can't work out what is going on.
    I ran my tests on OS X 10.9 and Idea 14.1.
    Log a bug report:
    https://javafx-jira.kenai.com/

  • Catching  java.sql.SQLException:

    ok this might be a stupid question
    but say i had a dataTable populated by a resultSet,
    when i update the dataTable how i can catch the java.sql.SQLException's being thrown
    i.e the PK exception
    i know i could catch it in the web.xml but was wondering if i can catch it in my bean?

    Oh boy. You may want to go back and take Sun's exception tutorial. It's a fundamental concept. That having been said:
    String sql = "some spiffy SQL goes here";
    Connection conn = null;  // initialize in a spiffy way
    PreparedStatememt stmt = null;
    try {
       stmt = conn.prepareStatement(sql);
       stmt.executeUpdate();  // assume an exception will be thrown
    catch (SQLException e) {
       e.printStackTrace();  // handle error processing
    finally {
      // ensure all resources are released regardless of success or failure
       if (stmt != null) try { stmt.close(); } catch (SQLException ignore) { ignore.printStackTrace() }
      if (conn != null) try { conn.close(); } catch (SQLException ignore) { ignore.printStackTrace() }
    }- Saish

Maybe you are looking for

  • How will check the space taken by a single table in a tablespace ?

    How will check the space taken by a single table in a tablespace ? dba_segments is giving the same values even if I truncate the table? Pls reply

  • How to add PO date and Vendor name in SAP table MB5S

    How do I add PO date field and Vendor name field in SAP table MB5S?? Kindly Help

  • Imovie event library

    Hey Apple users out there. Years ago I started out with a Steve Wozniac signed Apple IIGS. Switched to PCs due to software and finally am back in the Apple fold. I am learning with the imovie after using Ulead for a while. When I do a project, then c

  • Grouping similar movies under one thumbnail

    Hi, I've bought a few movies from iTunes that are part of a series, like Star Trek, Die Hard, etc. I want to group such moves together so that (for example), all the Star Treks appear together under one thumbnail - like episodes are grouped in season

  • [SOLVED] error message when launching deluge

    Hi everyone, i see this error message when launching deluge torrent client ( its not launching at all from menu) [bb@arch ~]$ deluge [ERROR   ] 00:59:41 ui:168 No module named gobject Traceback (most recent call last):   File "/usr/lib/python2.7/site