FooterClass in h:dataTable

I want to have the footer in my table to be presented without borders. I tried to do this by specifying a footer class (with border: 0) as a property in my <h:dataTable>, but, when I did a "view source" on the resulting HTML, I found that the footer class was specified as part of the <td> tag, not the <footer> tag. The result appears to be that the border gets displayed anyway.
Is this the HTML being generated according to spec? If so, is there a way to have my footer appear without borders? I need the footer to appear as part of the table (rather than just another line after the table) because certain elements are right-justified, so I want them to be flush with the right-hand side of the table.
- Brendan

Clarification: When specifying border: 0 in the footerClass, the border does appear to get thinner when the footer is displayed, but it doesn't disappear altogether. I'm guessing that the border attribute gets applied only to the cells, but that the outer border provided by the table still gets displayed.
- Brendan

Similar Messages

  • Datatable wackiness - JSF trying to read a non-existant field from a bean

    I am having a very strange problem in JSF. I currently have one links page with four commandLinks in it, and one JSF page witha datatable in it, and an IBM <hx:pagerDeluxe> in it to page through the data. Each command link fires off a different action, as shown below:
         <h:commandLink action="UM02">
              <h:outputText value="UM02" />
         </h:commandLink>
         <h:commandLink action="UM03">
              <h:outputText value="UM03" />
         </h:commandLink>          ..........etc ........
    My Navigation rules all point to one JSP file, but with a different param appended to the URL:
              <from-view-id>/index.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>UM02</from-outcome>
                   <to-view-id>/jsp/mappings/listViewUM02.jsp?tbl=UPD_MAP_UM02</to-view-id>
              </navigation-case>
              <navigation-case>
                   <from-outcome>UM03</from-outcome>
                   <to-view-id>/jsp/mappings/listViewUM02.jsp?tbl=UPD_MAP_UM03</to-view-id>
              </navigation-case>     So as you can see, I have one JSF file to display a list from any given table name. I also dynamically populate the dataTable through my code, by reading through a list of columns for each table, and creating a "UIColumn":
              while( itr.hasNext() ){
                   String fieldName = (String) itr.next();                                                  
                   ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{var." + fieldName + "}");
                   HtmlOutputText header = new HtmlOutputText();               
                   header.setValue(fieldName);               
                   UIColumn col = new UIColumn();
                   UIOutput out = new UIOutput();
                   out.setValueBinding("value", vb);
                   col.setHeader( header );
                   col.getChildren().add(out);               
                   dataTable.getChildren().add(col);               
              }          And that dataTable is shown in the JSF page. So i can go back to the main links page, click on another table name, and it will populate the datatable with the correct columns, data, etc. The problem happens when I go to one table, say UM02, and hit ">" on the pager, to go to the next page, which works, THEN i go back to the links page, and hit "UM03" and the first page displays fine. When I try to go to the next page, I get an error saying that the backing bean UM03Bean does not have field "subProductCd". Basically, values from the old dataTable objects are being used for smoe reason when I page. Not sure why this is happening.
    My datatable is defined like this:
         <h:form id="dataTableForm"><h:dataTable id="dataTable1" border="0" cellpadding="2"
              cellspacing="0" columnClasses="columnClass1"
              headerClass="headerClass" footerClass="footerClass"
              rowClasses="rowClass1, rowClass2, rowClass3"
              styleClass="dataTableEx" width="70%" rows="10"
              value="#{TestAction.list}" var="var"
              binding="#{TestAction.listDataTableUI}">
              <f:facet name="footer">
                   <hx:panelBox styleClass="panelBox" id="pagerbox">
                        <hx:pagerDeluxe styleClass="pagerDeluxe" id="deluxe1" for="dataTable1"/>                              
                        <h:commandLink action="home">
                             <h:outputText value="Back Home"></h:outputText>
                        </h:commandLink>
                   </hx:panelBox>     
              </f:facet>
         </h:dataTable>
         </h:form>

    BalusC wrote:
    It is comparing the selected value against the List<SelectItem> returned by getSetoresOrigem() as it is during the apply request values phase of the form submit request.Ok. That's what I supposed JSF was doing.
    BalusC wrote:
    If the selected value isn't in there, then you will get this error.I can understand this, but is this right? As I said, the old value isn't really there because I changed the list values to new ones. But the new value (the value of fSetorOrigem ) corresponds to a value that exist in the new list items, so a valid value. So JSF is not considering that I also changed the list, not just the value. It is comparing the new value with the old list, not the new one. Acting like this JSF is making the page looks like a static HTML page, not a dynamic one. If I can't change the list and the value, what's the point of that? In my point of view I'm not doing anything wrong, I'm not violating any JSF rules.
    Marcos

  • Problem with a datatable and selectOneMenu

    Hello
    I'm pretty new at java, so this might be an easy problem to solve, but I've been stuck in this for a couple of days now, so any help will be appreciated.
    I have a selectOneMenu item that when it's changed this value loads the info for a datatable below it, this works fine.... but I need that when for example, the select one menu has the value "1", the data tabla loads the activities for the option "1", inside the datatable there is a checkbox for a column, now, in this scenario, when I check 3 options in the datatable, I need to change the value in the selectOneMenu and put, for example the value "2", when this happens now I have to reload the datatable with the values corresponding to the activities for the option "2".
    The problem is when I change the value of the selectOneMenu on the backingBean, because this selectOneMenu has implemented the onchange event, but this is only activated if the the value is changed in the UI, not in the code as I need to do it.
    This are the lilbs that I'm using:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
    <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    This is the fragment of code of the selectOneMenu:
    <h:selectOneMenu id="ddlTipoVisita" value="#{VisitaDomiciliarBean.idTipoVisita}" disabled="#{VisitaDomiciliarBean.modoEdicion == false}"
    rendered="#{VisitaDomiciliarBean.mostrarSegunOpcionMenu}">
    <f:selectItems value="#{VisitaDomiciliarBean.selectItemsTipoVisita}" />
    <a4j:support status="statustablaSubtipoVisita" event="onchange" action="#{VisitaDomiciliarBean.cargarTablaSubtipoVisita}" reRender="tablaSubtipoVisita">
    </a4j:support>
    </h:selectOneMenu>
    This is the datatable section:
    <t:dataTable id="tablaSubtipoVisita" styleClass="scrollerTable2" headerClass="standardTable_Header"
    footerClass="standardTable_Header" rowClasses="standardTable_Row1,standardTable_Row2"
    columnClasses="columna_centrada" value="#{VisitaDomiciliarBean.subtiposVisita}" var="subtipo"
    preserveDataModel="false" rows="10" >
    <%--columna de seleccion multiple--%>
    <t:column rendered="#{VisitaDomiciliarBean.seleccionMultiple == true}">
    <f:facet name="header">
    <h:outputText value="#{recursos['actividades.seleccionar']}" />
    </f:facet>
    <a4j:region>
    <h:selectBooleanCheckbox
    value="#{subtipo.seleccionado}" disabled="#{VisitaDomiciliarBean.modoEdicion == false}">
    <a4j:support event="onchange" status="statustablaSubtipoVisita"
    actionListener="#{VisitaDomiciliarBean.seleccionar}" reRender="ddlTipoVisita" >
    </a4j:support>
    </h:selectBooleanCheckbox>
    </a4j:region>
    </t:column>
    <t:column>
    <f:facet name="header">
    <h:outputText value="#{recursos['actividades.descripcion']}"/>
    </f:facet>
    <h:outputText value="#{subtipo.descripcion}"></h:outputText>
    </t:column>
    </t:dataTable>
    Is there any way to do this using the rendered option of the components? Or does anybody has another idea or recomendation?
    I tried to solve it using two data tables, one for the option "2" and another for all the rest of the options, I tried to hide or show the one I need acoording to the data inside the array that has the info for the datatables, but this failed, because when I change the value for the selectOneMenu from the bean, both datatables are shown and not only the one that I need.
    I would really appreciate any help with this!
    Greetings,

    Well turns out I had a some bad code in the back end that was resetting the model to the 'initial' value. I didn't require the FacesContext.getCurrentInstance().renderResponse(); after all.
    But I still find it disturbing the model generator code being called twice.
    If anyone has any suggestions on how to prevent this I'm all ears.

  • Datatable outputext parameter

    I have a t:datatable that shows severalfields of a pojo. There's a requirement to show additional data from that bean in a 'flattened' way:
    The pojo has a Set of other objects, say, a Person has a Set of Pets and every Person in the system has at least a cat and a dog for pet.
    The datatable needs to show the name of the person, cat and dog in single row.
    <h:column headerClass="columnHeader" footerClass="columnFooter">
      <f:facet name="header">
        <h:outputText value="Cat's name" />
      </f:facet>
      <h:column>
        <h:outputText value="#{person.pets('Cat').name}" />
      </h:column>
    </h:column>I've tried to above, which doesn't work because JSF doesn't accept parameters that way. And I can't use an attribute because I don't know how to solve the binding issue. Is there an alternative next to polluting the pojo (adding explicit get methods).
    dave

    You can abuse a map for this purpose. If you make pets a Map (which might mean you need a nasty ORM query or manual translation of a collection type) you could pose your EL like:
    <h:outputText value="#{person.pets['Cat'].name}" />But since you apparently hardwire the key in the view, you could just as easily create specialized getter methods to retrieve the name of known objects.
    public void getNameOfCat(){
      // code to lookup the cat object and return its name
    }I don't see why you call that "polluting", it makes the code clean and simple IMO.

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

  • Problem with h:dataTable and conditional rowClasses

    Hi!
    I have a problem which I hoped somebody could have a look at. It might be that what I'm trying to do isn't possible, but I think it should have worked ;)
    To give you a quick presentation of my "case" or problem:
    - I have a dataTable which is filled with Document objects retrieved from a database.
    - The Document object has a property "created" which is a Date timestamp
    - In the dataTable I alternate the background of each row with white and blue
    - Then, what I would like to do, is to do a test on the "created" property, if the Document has been created within a fixed time, present it with a yellow line instead.
    - I set the different background-colors with three different styles, tableViewRow1 - tableViewRow2 and tableViewRow3 (the latest is the yellow line).
    To do a test on the dates I convert them into milliseconds and do a simple subtraction - if todayDate minus createdDate is smaller than criteriaDate, then the Document is considered "new" and should have a yellow background.
    This is how I've defined my dataTable:
    <h:dataTable id="documentsTableView"
    binding="#{documentModelFactory.htmlDataTable}"
    value="#{documentModelFactory.documents}"
    var="document"
    columnClasses="tableViewColumn"
    rowClasses="#{ (documentModelFactory.todayInMillisec - document.createdInMillisec) < documentModelFactory.criteriaInMillisec ? 'tableViewRow3':'tableViewRow1,tableViewRow2'}"
    styleClass="tableView"
    footerClass="tableViewFooter"
    headerClass="tableViewHeader"
    >
    So this would be the interesting lines:
    rowClasses="#{ (documentModelFactory.todayInMillisec - document.createdInMillisec)< documentModelFactory.criteriaInMillisec ? 'tableViewRow3':'tableViewRow1,tableViewRow2'}"
    I don't get an exception, and my expression seems valid. But it seems like it is always rendered to be false, I only get the white and blue rows, and I don't understand why.
    I have done different tests on the expression, and this confuses me, because it seems like the result is what it should be.
    # Test 1
    For each row I created a column printing the result of the expression, false or true.
    <h:column>
    <f:facet name="header">
    <h:outputText value="Test " />
    </f:facet>
    <h:outputText value="#{ (documentModelFactory.todayInMillisec - document.createdInMillisec)< documentModelFactory.criteriaInMillisec }" />
    </h:column>
    In all cases this is giving me the correct result, new documents get 'true' and the old ones get 'false'.
    So then I thought that there is a problem setting the tableViewRow3 param properly for the <tr class="" > :
    #Test 2
    I created a selectDocument action which basically just sets the document in my bean when a commandLink in the dataTable is fired.
    Then, in my method I retrieve the HtmlDataTable object, and do a logging of the current rowClasses for that row:
    htmlDataTable.getRowClasses() - which returns a String
    If I selected an "old" document, it returned "'tableViewRow1,tableViewRow2", but if i selected a new document, it returned 'tableViewRow3'.
    So it seems like my expression is rendered correctly, the rowClass is set properly, but still I don't get a yellow line. In the html source I have only <tr>'s with
    'tableViewRow1' and 'tableViewRow2'.
    Anybody? :)
    I don't know if it has something to do with the time / when the rowClasses param is "rendered", that it doesn't know what the "document" property is at that time??? I had the impression that the html was encoded "on the fly", and then this shouldn't be a problem? But I'm not exactly an expert so.. :)
    I guess an alternative solution is to do the testing in my bean and build up a comma-separated String to specify a rowClass for each row displayed in the dataTable, and then set the rowClasses to something like
    rowClasses="#{bean.rowStyles}"
    but first solution seems like a much easier approach (less costly as well), and it would also be interesting to know why it doesn't work.
    I'm using the 1.1.3 version of myfaces-impl, myfaces-api and tomahawk
    Thank you for your time!
    Eivind Roennevik

    I'm not sure whether i understand your problem,
    It doesnot need using the binding attribute If you wanna updating the value of each rows in the datatable.
    below is a sample that updating each rows of a datatable
    jsp file
    <h:dataTable value="#[sampleBean.data}" var="row">
        <h:column><h:inputText value="#{row.col1}"/></h:column>
    </h:dataTable>
    <h:commandButton value="update" action="#{sampleBean.update}"/>BackingBean:
    SampleBean.java
    public class Samplebean{
      private SampleRow[] rows[];
      public SampleRow[] getData{
              return rows;
      public String update(){
          for(int i=0; i<rows.length; i++){
             rows.update();
    return "success";
    SampleRow.java
    public class SampleRow{
      private String col1;
      public String getCol1(){
        return col1;
      public void setCol1(String col1){
        this.col1 = col1;
      public void update(){
         //write your code to save one row data to db/file here

  • Problems with datatable and scroller

    I wonder, if this behavior is a mistake of mine or a bug in the myfaces implementation.
    sitution
    I have datatable and datascroller component. The table gets the data from bean which is in request scope. The table is dynamic. Each time we hit the page, we can expect a different resultset/rowcount for the table.
    problem
    When I change the page of datascroller and come back a second time with a rowcount, that is to small to reach that page, I get a empty table. Expected result, would be a page, that shows at least last elements of the resultset.
    You can see the mistake, by refreshing the page datascroller.jsp a couple of times, change the page in the scroller and refresh again a couple of times.
    You will get results like this:
    15 hits, hits 81 - 15. page 9 / 2
    23 hits, hits 41 - 23. page 5 / 3
    5 hits, hits 21 - 5. page 3 / 1
    Testcase
    datascroller.jsp
    This is almost like the openDatatable example.
    <%@include file="/inc/importPageParams.inc" %>
    <%@include file="/inc/importTaglibs.inc" %>
    <html>
    <%@include file="/inc/head.inc" %>
    <body>
    <f:view>
        <f:loadBundle basename="com.ebsecure.archiv.web.resource.messages.messages" var="messages"/>
    <x:panelLayout id="page" layout="#{globalOptions.pageLayout}"
                styleClass="pageLayout"
                headerClass="pageHeader"
                navigationClass="pageNavigation"
                bodyClass="pageBody"
                footerClass="pageFooter" >
              <f:facet name="body">     
        <h:panelGroup id="body">
              <h:form name="hitlistProcessionForm" styleClass="standardTable">
                             <x:dataTable       id="data"                                              
                                             styleClass="scrollerTable"
                                             headerClass="standardTable_Header"
                                             footerClass="standardTable_Header"
                                             rowClasses="standardTable_Row1,standardTable_Row2"
                                             columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
                                        var="car"
                                        value="#{scrollerList.data}"                                     
                                        preserveDataModel="true"
                                        rows="10">
              <x:columns value="#{scrollerList.columnHeaders}" var="columnHeader">
                <f:facet name="header">
                    <x:commandSortHeader columnName="#{columnHeader}" arrow="false">
                        <f:facet name="ascending">
                            <h:graphicImage value="images/ascending-arrow.gif" rendered="true" border="0"/>
                        </f:facet>
                        <f:facet name="descending">
                            <h:graphicImage value="images/descending-arrow.gif" rendered="true" border="0"/>
                        </f:facet>
                        <h:outputText value="#{columnHeader}" />
                    </x:commandSortHeader>
                </f:facet>
                <!-- row is also available -->
                <h:outputText value="#{scrollerList.columnValue}" />
            </x:columns>
                </x:dataTable>
            <h:panelGrid columns="1" styleClass="scrollerTable2" columnClasses="standardTable_ColumnCentered" >
                <x:dataScroller id="scroll_1"
                        for="data"
                        fastStep="10"
                        pageCountVar="pageCount"
                        pageIndexVar="pageIndex"
                        styleClass="scroller"
                        paginator="true"
                        paginatorMaxPages="9"
                        paginatorTableClass="paginator"
                        paginatorActiveColumnStyle="font-weight:bold;"
                        >
                    <f:facet name="first" >
                        <h:graphicImage url="images/arrow-first.gif" border="1" />
                    </f:facet>
                    <f:facet name="last">
                        <h:graphicImage url="images/arrow-last.gif" border="1" />
                    </f:facet>
                    <f:facet name="previous">
                        <h:graphicImage url="images/arrow-previous.gif" border="1" />
                    </f:facet>
                    <f:facet name="next">
                        <h:graphicImage url="images/arrow-next.gif" border="1" />
                    </f:facet>
                    <f:facet name="fastforward">
                        <h:graphicImage url="images/arrow-ff.gif" border="1" />
                    </f:facet>
                    <f:facet name="fastrewind">
                        <h:graphicImage url="images/arrow-fr.gif" border="1" />
                    </f:facet>
                </x:dataScroller>   
                   <x:dataScroller id="scroll_2"
                                for="data"
                                rowsCountVar="rowsCount"
                                displayedRowsCountVar="displayedRowsCountVar"
                                firstRowIndexVar="firstRowIndex"
                                lastRowIndexVar="lastRowIndex"
                                pageCountVar="pageCount"
                                pageIndexVar="pageIndex"
                               >
                            <h:outputFormat value="{0} hits, hits  {2} - {3}. page {4} / {5}
                            " styleClass="standard" >
                                <f:param name="myRowsCount" value="#{rowsCount}" />
                                <f:param name="myDisplayedRowsCountVar" value="#{displayedRowsCountVar}" />
                                <f:param name="myFirstRowIndex" value="#{firstRowIndex}" />
                                <f:param name="myLastRowIndex" value="#{lastRowIndex}" />
                                <f:param name="myPageIndex" value="#{pageIndex}" />
                                <f:param name="myPageCount" value="#{pageCount}" />
                            </h:outputFormat>
                        </x:dataScroller>       
            </h:panelGrid>
              </h:form>
        </h:panelGroup>
         </f:facet>
         </x:panelLayout>
    </f:view>
    </body>
    </html>
    snippet of faces-config.xml
    <managed-bean>
            <managed-bean-name>scrollerList</managed-bean-name>
            <managed-bean-class>my.tests.DatatableTestBean</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
    and the bean
    package my.tests;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.model.DataModel;
    import javax.faces.model.ListDataModel;
    import org.apache.log4j.Logger;
    public class DatatableTestBean {
        private DataModel data;
        private DataModel columnHeaders;
        Logger logger;
        public DatatableTestBean() {
            List headerList = new ArrayList();
            headerList.add("Index");
            headerList.add("Type");
            headerList.add("Model");
            columnHeaders = new ListDataModel(headerList);
            List rowList = new ArrayList();
            for (int i = 0; i <= (double) ((double) Math.random() * (double) 1000); i++) {
                List colList = new ArrayList();
                colList.add(new Integer(i));
                colList.add("Car Type " + i);
                colList.add(i % 2 != 0 ? "green" : "blue");
                rowList.add(colList);
            data = new ListDataModel(rowList);
        public DataModel getData() {
            return data;
        public DataModel getColumnHeaders() {
            return columnHeaders;
        public Object getColumnValue() {
            Object columnValue = null;
            if (data.isRowAvailable() && columnHeaders.isRowAvailable())
                columnValue = ((List) data.getRowData()).get(columnHeaders.getRowIndex());
            return columnValue;
    }Does anyone know, if I'm totally wrong or can see the mistake I or the implementation do. Does anyone has any suggestions, how to get always a right result?
    Any help is very appreciated.
    thanks, Stephan

    the datascroller is based on the first attribute of the datatable to calculate the index.
    try to set the first attribute to '1' in your jsp. The goal is to reset this value when your data have changed.

  • DataTree or DataTable which one fits the scenario

    Hi everyone,
    I have to render the below structure::
    Category 1
    Title1 Category 1 checkbox1 checkbox2 checkbox3......so on till 10
    Title2 Category 1 checkbox1 checkbox2 checkbox3......so on till 10
    Category 2
    Subcategory2.1
    tile1 subcategory2.1 checkbox1 checkbox2 checkbox3....10
    tile 2subcategory21 checkbox1 checkbox2 checkbox3....10
    Subcategory2.2
    tile1 subcategory.2.2 checkbox1 checkbox2 checkbox3....10
    tile2 subcategory2.2 checkbox1 checkbox2 checkbox3....10
    So its a nested tree structure finally. I question is will i be able to use a jsf tree component to achieve something like this.
    I have tried using datatable... was successful in getting the hierarchy by using row category.. but there are many issues like wheneven i submit a btn action, the tree structure collapses automatically. The parent node doesnot expand until i click twice on it. .. etc.
    I need to implement an ExpandAll & Collapse All feature as well. I am not sure, if it can be done usi ng a data table or java script..
    Can someone suggest the correct way to do it...

    Hi Balu,
    I saw ur code posting.. that scenario doesnot have rowcategoy. Below is my jsf code. can u help me in implementing Expand All/ Collapse All through java script
    <hx:dataTableEx border="0" cellpadding="2" cellspacing="0"
                                  columnClasses="columnClass1" headerClass="headerClass"
                                  footerClass="footerClass" rowClasses="rowClass1, rowClass2"
                                  id="tableEx1" styleClass="dataTableEx" value="#{masterPublList.lst_publication}" var="varlst_publication">
                                  <hx:columnEx id="columnEx3">
                                       <hx:panelRowCategory id="rowCategory2"
                                            styleClass="panelRowCategory" value="#{varlst_publication.publCategory}" collapsed="false">
                                            <h:outputText id="text6" styleClass="outputText"></h:outputText>
                                       </hx:panelRowCategory>
                                       <f:facet name="header"></f:facet>
                                  </hx:columnEx>
                                  <hx:columnEx id="columnEx2">
                                       <hx:panelRowCategory id="rowCategory1"
                                            styleClass="panelRowCategory" value="#{varlst_publication.publSubCategory1}">
                                            <h:outputText id="text5" styleClass="outputText"></h:outputText>
                                       </hx:panelRowCategory>
                                       <f:facet name="header"></f:facet>
                                  </hx:columnEx>
                                  <hx:columnEx id="column1">
                                       <f:facet name="header">
                                            <h:outputText id="text4" styleClass="outputText" value="Title"></h:outputText>
                                       </f:facet>
                                       <h:outputText id="text3" styleClass="outputText" value="#{varlst_publication.publName}"></h:outputText>
                                  </hx:columnEx>
                                  <hx:columnEx id="columnEx1">
                                       <f:facet name="header">
                                            <h:outputText id="text13" styleClass="outputText"
                                                 value="English   German   French"></h:outputText>
                                       </f:facet>
                                       <h:selectManyCheckbox disabledClass="selectManyCheckbox_Disabled"
                                            id="checkbox1" styleClass="selectManyCheckbox" value= "#{varlst_publication.publLang}">
                                            <f:selectItems value= "#{masterPublList.lst_lang}"/>
                                       </h:selectManyCheckbox>
                                  </hx:columnEx>
                             </hx:dataTableEx>

  • How can i use one datatable inside the other?

    Hi all,
    i need help ... i have this page that shows information from a relational table... for example a mapped table "Countries" that has a java.util.Set inside named "Cities" and i would like 2 know how can i do this using jsf...
    The display would be like this:
    Brasil
    Rio de Janeiro
    Sao Paulo
    USA
    New York
    Washington
    New Orleans
    And Goes on... So i guess it would be a dataTable inside the other, right? but i dunno how to do it...
    Thanks for any info. cya

    this is somehow a messy example. But just focus on the var attribute of outer datatable and how value attribute of inner datatable is referencing it.
    <h:dataTable id="table1" value="#{pc_City_state.listofstates.states}" var="varstates" styleClass="dataTable">
                   <h:column id="column1">
                        <f:facet name="header">
                             <h:outputText styleClass="outputText" value="StateName" id="text2"></h:outputText>
                        </f:facet>
                        <h:outputText id="text3" value="#{varstates.stateName}" styleClass="outputText">
                        </h:outputText>
                   </h:column>
                   <h:column id="column3">
    <f:facet name="header">
    </f:facet>
              <h:dataTable id="table2" value="#{varstates.cities}" var="varcities" styleClass="dataTable">
                                       <f:facet name="footer">
                                       </f:facet>
                                       <h:column id="column4">
              <f:facet name="header">
              <h:outputText styleClass="outputText" value="CityName" id="text6"></h:outputText>
              </f:facet>
              <h:outputText id="text7" value="#{varcities.cityName}" styleClass="outputText">
              </h:outputText></h:column>
              </h:dataTable>
    </h:column>
    </h:dataTable>

  • View images in a datatable from byte[]

    I am trying to view images in a datatable where the image is
    a byte[]. This is what I tried... doesn't work.
    <h:dataTable rows="5" value="#{AirportList.airportList}" var="airport" binding="#{AirportList.airportData}">
              <h:column>
                <f:facet name="header">
                  <h:outputText value="airportCode"/>
                </f:facet>
                <h:outputText value="#{airport.airportCode}"/>
              </h:column>
              <h:column>
                <f:facet name="header">
                  <h:outputText value="airportMap"/>
                </f:facet>
                  <h:inputHidden id="ole" value="#{airport.airportMap}"/>
                  <h:outputText value="#{AirportList.myMap}"/>
                 <div>
                 <!--
                      try
                        byte[] pic = (byte[])request.getAttribute("AirportList.myMap");
                        response.setContentType("image/jpeg");
                        OutputStream os = null;
                        os = response.getOutputStream() ;
                       // os.write(pic);
                        os.close();
                        os = null;
                      catch (Exception ex)
                        out.println("Exception: " + ex.getMessage());
                        ex.printStackTrace();
                   -->
                  </div>
              </h:column>
              <h:column>
                <f:facet name="header">
                  <h:outputText value="airportSugBook"/>
                </f:facet>
                <h:outputText value="#{airport.airportSugBook}"/>
              </h:column>
            </h:dataTable>

    my backing code
    public class Airport
      Collection AirportList;
      private UIData AirportData;
      byte[] MyMap;
      public Airport()
      public Collection getAirportList()
        try{
          InitialContext context = new InitialContext();
          AirportLOBLocalHome home =  (AirportLOBLocalHome)context.lookup("java:comp/env/ejb/local/AirportLOBLocal");
          AirportLOBLocal local = home.create();
          AirportList = local.showAirports();
          Iterator it = AirportList.iterator();
          while(it.hasNext())
            ((OtnAirportLobDetailsLocalDTO)it.next()).getAirportMap();
          return AirportList;
        catch(Throwable e)
          e.printStackTrace();
        return null;
      public void setAirportList(Collection AirportList)
        this.AirportList = AirportList;
      public UIData getAirportData()
        return AirportData;
      public void setAirportData(UIData AirportData)
        this.AirportData = AirportData;
      public byte[] getMyMap()
        OtnAirportLobDetailsLocalDTO ap = (OtnAirportLobDetailsLocalDTO)AirportData.getRowData();
        return ap.getAirportMap();
       // return null;
      public void setMyMap(byte[] MyMap)
        this.MyMap = MyMap;
    }

  • I can't view dataTable in JSF

    Hi, anyone who can help me with java server faces, i want to put data from a resultset to dataTable, i made everithing but my table is not visible.
    My code is:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core">
    <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
    doctype-system="http://www.w3.org/TR/html4/loose.dtd"
    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1252"/>
    <title>Consultas</title>
    </head>
    <body><h:form binding="#{backing_Consultas.form1}" id="form1">
    <h:commandButton value="commandButton1"
    binding="#{backing_Consultas.commandButton1}"
    id="commandButton1"
    action="#{backing_Consultas.commandButton1_action}"/>
    </p>
    <p>
    <h:dataTable border="1" var="#{backing_Consultas.dataTable1}"
    id="dataTable1">
    <h:column binding="#{backing_Consultas.column1}"/>
    <h:column binding="#{backing_Consultas.column2}"/>
    <h:column binding="#{backing_Consultas.column3}"/>
    <h:column binding="#{backing_Consultas.column4}"/>
    </h:dataTable>
    </h:form></body>
    </html>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_Consultas-->
    </jsp:root>
    This es a JSPX page.
    Please any idea
    thanks
    alex

    Try to disable the hardware acceleration in the Flash Player.
    See [[Cannot view full screen Flash videos]]
    Flash "Display settings" window:
    * http://www.macromedia.com/support/documentation/en/flashplayer/help/help01.html

  • DataTable.Rows.Count property is occasionally wrong

    I have a web service in C#.NET which calls a stored procedure using ADO.NET. The stored procedure is always returning 1 row, which is then loaded into a DataTable. The Rows.Count property of the DataTable is then examined.
    When this web service is called repeatedly with numerous requests, it occasionally returns Rows.Count as 0 when it should be 1. I have debugged and examined it at runtime and found that there is indeed 1 row in the datatable, but that the Rows.Count property
    is 0.
    Is this a known bug?
    I'm using .Net Framework 2.0
    Note: This is an issue that occurs very rarely. My testing shows that it takes about 90 minutes to recreate it when you have 2 concurrent processes sending requests repeatedly at a rate of about 10 requests per second.

    Are you sure that there aren't multiple threads access the DataTable?
    Can you post a repro? 
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Is there a way to add a column after a filled DataTable from SQL with the same rows?

    My problem is that not to add rows like filled by SQLDataAdapter at the same row in DataGridView. How to make that? I showed below the details with my code also a screen shot, which shows the rows differences from the origin one.
    I don't want to add an expression as column behave in my sql script to get what I need with query result. I don't want to obtain that way.
    using (SqlConnection c = new SqlConnection(ConnStrMSSQL))
    c.Open();
    // 2
    // Create new DataAdapter
    using (SqlDataAdapter a = new SqlDataAdapter("SELECT SIPNO, SERINO, TARIH FROM SNOHAREKETLER WHERE Cast(TARIH as DATE) BETWEEN '2015/03/20' AND '2015/03/20' AND (TEZNO = 'T23' OR TEZNO = 'T31') AND CIKTI is null", c))
    // 3
    // Use DataAdapter to fill DataTable
    DataTable t = new DataTable();
    a.Fill(t);
    t.Columns.Add("MyColumn", typeof(string));
    DataRow workRow;
    int iGetCount = t.Rows.Count;
    for (int i = 0; i <= iGetCount - 1; i++)
    workRow = t.NewRow();
    workRow["MyColumn"] = i;
    t.Rows.Add(workRow);
    dataGridView1.DataSource = t;

    The extra column isn't applied to only certain rows.  The columns of a table identify what data each row will contain.  Hence adding a column to the table automatically adds them to the rows.  What you're seeing is that all the initial rows
    aren't being assigned a value so they retain their default value of null.  Later you enumerate the rows of the existing table and call AddRow which adds new rows.  This isn't adding columns, but rows.
    To generate values for the existing rows you should ideally simply pass the data back from the database.  DT computed columns can be difficult to set up as it is limited to what it can do.  If you want to use a computed column on the Datatable
    itself then define the column as a computed column and every row will calculate its own value.
    DataTable data = GetData();
    //Add elapsed time column
    var col = new DataColumn("ElapsedTime", typeof(TimeSpan), "expr");
    data.Columns.Add(col);
    dataGridView1.DataSource = data;
    The issue you will run into however is that calculating a diff on DateTime doesn't work in a computed column as the expression doesn't support the necessary functions.  You can google for how people solved this if you are interested in alternatives. 
    Most people just tend to add the column and then hook into the various change events to update the value as needed.

  • How can I display one of two DataTables based on criteria

    I have two DataTables. One DataTable should be displayed or the other DataTable should be displayed in the same JSP based on some criteria. I wish I could put an if statement in the JSP page but how else can I do this? Is there a JSF tag that is like an if statement?

    Hi
    Try to use rendered attribute.
    Create boolean variable in your bean ie private boolean showTab1And in jsp type
    <h:dataTable id="tab1" value="..." var="..."  rendered="#{myBean.showTab1}">
    </h:dataTable>
    <h:dataTable id="tab2" value="..." var="..."  rendered="#{!myBean.showTab1}">
    </h:dataTable>if showTab1 is true, first dataTable shows, otherwise second dataTable is shown.
    Hope it helps
    Martin
    ps. You can combine value of rendered :
    rendered="#{myBean.boolVar1 && myBean.boolVar2 && !myBean.boolvar3}"

  • DateField not getting copy in the matrix using Datasource & Datatable

    Hello All,
    I have tried to copy data From Purchase Order Tables to my own created User Defined Form matrix columns using DBDatasource & Datatables ,Instead of Document Date all other data are getting copied but that document date field is not
    getting the data plus it is not showing any error message as such.
    Following is the code which i have written :-
    =====================================
    oPurchase_Amend.DataSources.DataTables.Add("oMatrixDT" )
    oPurchase_Amend.DataSources.DataTables.Item("oMatrixDT" ).Clear()
    Dim sSQL As String = "SELECT T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[Price],(Select InvntryUoM From OITM Where ItemCode=T1.ItemCode) as 'UoM',T1.LineNum,T0.DocNum  as 'FrmDate' FROM OPOR T0  INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.[DocNum] ='1' and T0.CardCode='C0001'
    oPurchase_Amend.DataSources.DataTables.Item("oMatrixDT" ).ExecuteQuery(sSQL)
    oMatrix = oPurchase_Amend.Items.Item("mtx_0").Specific
    oMatrix.Clear()
    Dim oDBDataSource As SAPbouiCOM.DBDataSource = oPurchase_Amend.DataSources.DBDataSources.Item("@OSL_POAMD")
    Dim oDataTable As SAPbouiCOM.DataTable = oPurchase_Amend.DataSources.DataTables.Item("oMatrixDT" )
    oDBDataSource.Clear()
    For row As Integer = 0 To oDataTable.Rows.Count - 1
    Dim offset As Integer = oDBDataSource.Size
    oDBDataSource.InsertRecord(row)
    oDBDataSource.SetValue("U_ItemCode", offset, oDataTable.GetValue("ItemCode", row).ToString())
    oDBDataSource.SetValue("U_ItemName", offset, oDataTable.GetValue("Dscription", row).ToString())
    oDBDataSource.SetValue("U_UoM", offset, oDataTable.GetValue("UoM", row).ToString())
    oDBDataSource.SetValue("U_OldQty", offset, oDataTable.GetValue("Quantity", row).ToString())
    oDBDataSource.SetValue("U_OldRate", offset, oDataTable.GetValue("Price", row).ToString())
    > Line For Copying Document Date Data to the matrix datasource
    oDBDataSource.SetValue("U_OldDate", offset, oDataTable.GetValue("FrmDate", row))
    oDBDataSource.SetValue("U_LineId", offset, oDataTable.GetValue("LineNum", row))
      Next
    '--- Rebinding the datasource to the matrix columns -
    oMatrix.Columns.Item("col_0").DataBind.SetBound(True, "@OSL_POAMD", "U_ItemCode")
    oMatrix.Columns.Item("col_1").DataBind.SetBound(True, "@OSL_POAMD", "U_ItemName")
    oMatrix.Columns.Item("col_3").DataBind.SetBound(True, "@OSL_POAMD", "U_OldQty")
    oMatrix.Columns.Item("col_5").DataBind.SetBound(True, "@OSL_POAMD", "U_OldRate")
    oMatrix.Columns.Item("col_7").DataBind.SetBound(True, "@OSL_POAMD", "U_OldDate")
    oMatrix.Columns.Item("col_9").DataBind.SetBound(True, "@OSL_POAMD", "U_LineId")
    oMatrix.LoadFromDataSource()
    But i am not able to get the document date in the column of the matrix .
    Please suggest what changes i have to meke in this code to get the desired output.
    Thanks & Regards,
    Amit
    Edited by: AmitSharma_061985 on Dec 17, 2009 12:24 PM

    Hi Michael,
    FrmDate is the Document date of the purchase order which i am fetching through sql query and trying to copy that in the matrix
    through datasource .
    Edited by: AmitSharma_061985 on Dec 18, 2009 7:07 AM

Maybe you are looking for

  • OnEnterFrame inside a class

    I don't have a problem as much as just a lack of understanding: Question: Will I run into any problems using onEnterFrame inside a class? I know that onEnterFrame events can overwrite each other if they are written dynamically, but I'm not sure how t

  • Force Outlook for Mac 2011 accept iCal changes

    I am trying to delete duplicates in Outlook and iCal on my MacBook Pro and my iPhone. I can delete duplicates on the Mac, but then they sync back to their duplicates and conform to Outlook. How do I change it so that iCal is the source for the change

  • Populating International Article Number (EAN/UPC) in PO

    Hi Experts, My requirement is to populate the field EAN/UPC in PO, with the value from the field 'OTHER NAME' present in the item line2 of the SRM shopping cart. Can this be achieved by using the BADI - BBP_CREATE_BE_PO_NEW ? If so, can you please he

  • Need Help in JNDI Datasource using tomcat and spring

    Hi, I am trying to connect my local database using JNDI datasource in tomcat and spring I have done the below configuration in Tomcat 7 server: In tomcat server.xml (Path: E:\apache-tomcat-7.0.35\conf) I added the below configuration <Resource name="

  • WebLogic Workshop Portal Extension in workshop 10.1

    I used Workshop 10.0 and have on the menu some features such as File - New - Portal Web Project and Windows - Portal Perspective However, when I installed the Workshop 10.1 (I try both on the same BEA_HOME and on a new directory), I could not find th