Problem with rich datatable

Hi, there.
I'm a newbie in JSF and was trying to build a rich datatable.
Using the docs of this page I was able to build the header but not a sub table:
<rich:dataTable
cellpadding="0" cellspacing="0"
width="780" border="0">
<f:facet name="header">
     <rich:columnGroup>
          <rich:column>
               <rich:spacer />
          </rich:column>
          <rich:column>
               <h:outputText value="Nome" />
          </rich:column>
          <rich:column>
               <h:outputText value="Canal" />
          </rich:column>     
          <rich:column>
               <h:outputText value="PT" />
          </rich:column>
          <rich:column>
               <h:outputText value="EN" />
          </rich:column>
     </rich:columnGroup>
</f:facet>
<rich:subTable>
<rich:column>
     <h:outputText value="batatas"></h:outputText>
     <f:facet name="footer">
          <rich:spacer />
     </f:facet>
</rich:column>
</rich:subTable>
</rich:dataTable>
What is wrong with this code? Can anyone help me?
Thanks in advance.

But this code shouldn't show anything in the browser?
I know that I didn't feed it. I've started to test it using hard coded values...

Similar Messages

  • Problem with jsf DataTable

    when data is fetch using user criteria:
    i have a problem with jsf DataTable. I use e request bean to populate the datatable and i insert a commandButton column. The data dispay successfully into the datatable, but when a push the button on the row...the page simply refresh and notinhg else
    when data is fetch using constants:
    The data dispay successfully into the datatable, when a push the button on the row...the action execute OK

    Hi,
    I don't think that with this description only anybody on this list is able to help you.
    I use e request bean to populate the datatable and i insert a commandButton column
    What is a command button column and what does it do ?
    but when a push the button on the row...the page simply refresh and notinhg else
    What did you do to debug the problem ?
    when data is fetch using constants
    What does this mean ?
    Frank

  • Ajax Update of a rich:subTable with rich:dataTable

    Hello,
    i just want to rerender a subtable within a dataTable via ajax request.
    The concrete requirement is just to model a 1-level table tree, such that i am
    able to expand items in the superior table. I have tried different solutions.
    One is, that value.items returns an empty list on not expanded,
    other was to use the rendered attribute at the subtable and/or also
    at a wrapping columngroup.
    Another thing is, that the table obviously requests the
    ajaxKeys attribute at the dataTable, it also returned
    the correkt rows (as integer index keys within a Set),
    but the subtable is never refreshed.
    I have no more idea! Do i only have the possibility
    to update the whole table (this works fine) ?
    When do i really need the ajaxKeys attribute?
    My third question by this way is, is there a nice
    way of doing it using pure client side javascript effects?
    Hope you can help,
    Ijaja
    <rich:dataTable      value="#{bean.list}" var="value" id="table">
         <rich:column colspan="2">
              <a4j:commandLink action="#{value.switchExpanded()}" reRender="subtable">
                   <h:graphicImage id="expandimage" value="#{value.image}"/>
              </a4j:commandLink>
              <h:outputText value="Text"/>
         </rich:column>
         <rich:subTable id="subtable" value="#{value.items}" var="item">
              <rich:column>
                   <h:outputText value="#{item.label1}" />
              </rich:column>
              <rich:column>
                   <h:outputText value="#{item.label2}" />
              </rich:column>
         </rich:subTable>
    </rich:dataTable>

    Hi, thanks for your reply. I looked at the ajax code in that post.
    attrResponse should be called from my Action class (controller class in my case since am using spring)
    However, this is extremely useful if I am expecting the user to do an input for me.
    I need to figure out if a Query is updating table abc ( I plan to do it this way :
    I will get the table name from all update queries being executed (this I dont know how I will do though), and then after the successfull updation I will execute the select query for the same table) and then return the result set in the attrResponse.
    ultimately this will help in updating rows displayed in jsp based on updates done to the database without the page being refreshed. For ex, if my current Jsp is displaying my total no. of employees, which is 2 then if someone updates the table with a third employee, then the third row gets automatically updated.
    am I taking it up in the correct way ?
    Is there another way to do this ?
    Thanks for your time on this.

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

  • 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

  • Problem with h:dataTable and binding attribute

    I am new to JSF and I have a problem using the binding attribute of h:dataTable.
    I can successfully use the value attribute to display rows of data fetched from an Oracle database into h:dataTable, but I do know how to bind a h:dataTable to a server object which I would use to update the changes made in the h:dataTable.
    Can some body show me an example how to do so ?
    Thanks in advance.

    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

  • Problem with binding in h:dataTable

    Hi
    I have a problem with h:dataTable, where the table rows are bound to objects (Bean$Line) nested within a backing bean (Bean).
    JSP:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <html>
      <f:view>
        <head>
          <link href="styles.css" rel="stylesheet" type="text/css"/>
          <title>Sandbox</title>
        </head>
        <body>
          <h:form>
            <h:dataTable value="#{bean.lines}" var="line">
              <h:column>
                <h:outputText value="#{line.id}"/>
              </h:column>
              <h:column>
                <!-- using value = line.lineSelected here works (assuming boolean property Line.lineSelected) --/>
                <h:selectBooleanCheckbox binding="#{line.lineSelected}"/>
              </h:column>
            </h:dataTable>
          </h:form>
        </body>
      </f:view>
    </html>Bean:
    package com.test;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.component.UISelectBoolean;
    public final class Bean {
      private final List<Line> lines;
      public Bean() {
        lines = new ArrayList<Line>();
        lines.add(new Line("one"));
        lines.add(new Line("two"));
        lines.add(new Line("three"));
      public List<Line> getLines() {
        return lines;
       * Nested class in order to access containing class
       * properties etc.
      public static class Line {
        //private boolean lineSelected = false;
        private UISelectBoolean lineSelected;
        private String id;
        public Line(String id) {
          this.id = id;
        /*public boolean isLineSelected() {
          return lineSelected;
        public void setLineSelected(boolean lineSelected) {
          this.lineSelected = lineSelected;
        public UISelectBoolean getLineSelected() {
          return lineSelected;
        public void setLineSelected(UISelectBoolean lineSelected) {
          this.lineSelected = lineSelected;
        public String getId() {
          return id;
        public void setId(String id) {
          this.id = id;
      } // Line
    }The setup works when I use value="#{line.lineSelected}" (assuming the property is defined as boolean in Bean$Line) but as soon as I use a binding, I get the following exception:
    com.sun.rave.web.ui.appbase.ApplicationException: javax.servlet.ServletException: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'line' resolved to null
    at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.cleanup(ViewHandlerImpl.java:594)
    at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:325)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    faces_config:
    <faces-config version="1.2"
                  xmlns="http://java.sun.com/xml/ns/javaee"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
      <application>
        <locale-config>
          <default-locale>en_GB</default-locale>
          <supported-locale>en_GB</supported-locale>     
        </locale-config>
      </application>
      <managed-bean>
        <managed-bean-name>bean</managed-bean-name>
        <managed-bean-class>com.test.Bean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>
    </faces-config>What am I missing here?
    Help much appreciated
    Lance

    Guys
    Thanks a lot, both of your replies are immensely instructive. Maybe a little background on what I'm trying to do. In the table, I have header rows with dependent line rows. When a check box is ticked in the header, I want the corresponding check boxes in the dependent lines to be checked automatically (in slave fashion and ideally without using JavaScript). My idea was to update the bound components (for the lines) from within the Bean (in response to change on the header). However, given there's only a single component for each column in the table, this of course doesn't make sense.
    I'm trying to get to the typical MVC workflow of a) user updates a View component, b) Controller detects the change and updates the Model, c) The Model fires a property change event, which the View detects and updates appropriately. What's the way to achieve this in JSF (by design)?
    Here's a simple fragment (which does not work):
            <h:dataTable value="#{bean.lines}" var="line">
              <h:column>
                <h:outputText value="#{line.id}"/>
              </h:column>
              <h:column>
                <!-- (1) This is the master and (2) should refresh on update here --/>
                <h:selectBooleanCheckbox onchange="submit()" value="#{line.lineSelected}"/>
              </h:column>
              <h:column>
                <!-- (2) This is the slave and I want this to update in response to a change of (1) above --/>
                <h:selectBooleanCheckbox value="#{line.slaveSelected}"/>
              </h:column>
            </h:dataTable>In the setter method for lineSelected, I'm setting slaveSelected to the new value but the View is not refreshing based on this. How do I get the View to update (each dependent line) based on the new values for slaveSelected?
    Thanks again
    Lance

  • I need help with JSF DataTable

    hi all,
    i have a problem with my DataTable items ...
    i need to access the actuell item of the Table dynamiclly something like this :
    <TD width=1000><h:dataTable id="myId" width="0" border="0" cellspacing="0" cellpadding="10"
    value="#{PageIteratorBean.first}" var="item">
    <h:column>
    <f:verbatim>
    <br>
    <h:outputText value="#{item.discription}" />
    </f:verbatim>
    <h:commandLink action="#{NewsReadBean.linkNews}" styleClass="readMoreLink">
    <h:outputText value="read more ..." styleClass="newsDate" />
    <f:param name="newsPath" value="#{item.path}" />
    </h:commandLink>
    <f:verbatim>
    <jsp:include page='<%=item.path%>' flush="true">
    </jsp:include>
    how can i realise this code ... in this 2 rows i get allways that
    "item.path" cannt be resolved.... what should i do??
    maybe u have an idea or other solutions
    help me please i need to include dynamiclly to every item some other information...
    </f:verbatim>
    </h:column>

    Hi,
    Enter:      79649908
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Problems with DefaultTableModel

    Hi everyone...
    I m trying to use DefaultTable model to present data from my database, but i cannot get it to work or better said show any data what so ever...
    this is the sample of my code...
    //just a snippet of my code...just the part where i have problems with
    JTable dataTable=new JTable();
            DefaultTableModel tableModel=new DefaultTableModel();       
            tableModel.setColumnIdentifiers(amarnaTableNames);       
            try{
                CallableStatement calling=myConnectionClass.returnConnection().prepareCall(selectQuery);
                ResultSet result=calling.executeQuery();
                ResultSetMetaData metaResult=result.getMetaData();
                Object[] myData;
                while(result.next()){
                    myData=new Object[columnNumber];
                    for(int i=0;i<amarnaTableNames.length;i++){
                        amarnaData=result.getObject(i+1);
    System.out.print(amarnaData[i]);//just to see if i get anything from my database...and i do
    tableModel.addRow(amarnaData);
    catch(SQLException ex){
    dataTable.setModel(tableModel);//but when i try to show ma JTable...i cannot get nothing though i know i get the neccessary data from my database
    So basically what i would like, if someone can please help me, is if there is any good tutorials or at least a simple example on how to use DefaultTableModel...
    Thnx everyone

    or at least a simple example on how to use DefaultTableModel..Here is my simple example:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=577919
    And here is another example of building the TableModel from a ResultSet:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=597666
    How do you know the problem is with the TableModel. Do you add the table to the GUI? Maybe you define the table twice, once when you add it to the GUI and once in the code you just posted.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

  • Problem with binding in rich:tabPanel

    I have the problem with binding in rich component. In the first request the tabPanel work fine, but in the second request the component is not displayed. When i remove binding="#{organizationController.tabPanel}" everything works well. Anybody can help me? thanks.
    <rich:tabPanel style="height : 63px; width:auto; border:0px;" id="panelOrganizationForm" binding="#{organizationController.tabPanel}" >
    <rich:tab label="Dados da organizacao" id="tab1">
                   <h:panelGrid columns="2" id="panelGridOrganizationForm">
         <h:outputText value="Id: " id="idlabel"/>
         <h:inputText value="#{organizationController.organization.organizationId}" styleClass="input" id="organizationId" required="true"/>
         <h:outputText value="Nome: " id="nameLabel"/>
         <h:inputText size="60" value="#{organizationController.organization.organizationName}"
         styleClass="input" id="organizationName"/>
         </h:panelGrid>
         </rich:tab>
    </rich:tabPanel>
    <a4j:commandButton value="Voltar" action="back" id="bot" immediate="true"/>

    Guys
    Thanks a lot, both of your replies are immensely instructive. Maybe a little background on what I'm trying to do. In the table, I have header rows with dependent line rows. When a check box is ticked in the header, I want the corresponding check boxes in the dependent lines to be checked automatically (in slave fashion and ideally without using JavaScript). My idea was to update the bound components (for the lines) from within the Bean (in response to change on the header). However, given there's only a single component for each column in the table, this of course doesn't make sense.
    I'm trying to get to the typical MVC workflow of a) user updates a View component, b) Controller detects the change and updates the Model, c) The Model fires a property change event, which the View detects and updates appropriately. What's the way to achieve this in JSF (by design)?
    Here's a simple fragment (which does not work):
            <h:dataTable value="#{bean.lines}" var="line">
              <h:column>
                <h:outputText value="#{line.id}"/>
              </h:column>
              <h:column>
                <!-- (1) This is the master and (2) should refresh on update here --/>
                <h:selectBooleanCheckbox onchange="submit()" value="#{line.lineSelected}"/>
              </h:column>
              <h:column>
                <!-- (2) This is the slave and I want this to update in response to a change of (1) above --/>
                <h:selectBooleanCheckbox value="#{line.slaveSelected}"/>
              </h:column>
            </h:dataTable>In the setter method for lineSelected, I'm setting slaveSelected to the new value but the View is not refreshing based on this. How do I get the View to update (each dependent line) based on the new values for slaveSelected?
    Thanks again
    Lance

  • Problem with selectOneMenu in Datatable

    Hi
    I have the following datatable that binds correctly to a set of Game objects.
    I need to have a dropdown with the numbers 1 to 10 as items which is bound to each dataItem's newRating field.
    However there is some problem with the dropdown that i can't figure out. The datatable stops rendering when it hits the first dropdown.
    At the moment,
    The new rating field in the Game class is of type SelectItem with the appropriate get and set methods.
    Could anyone please point out what I'm doing wrong
    Thanks.
    Here is the relevant part in Home.jsp:
                                              <h:dataTable binding="#{Home.newGamesTable}" id="newGamesTable" value="#{Home.newGames}" var="dataItem">
                                                                <h:column>
                                                                    <f:facet name="header">
                                                                        <h:outputText value=""/>
                                                                    </f:facet>
                                                                    <h:panelGroup layout="block" styleClass="new_game_main">
                                                                        <h:outputText styleClass="new_game_title" value="#{dataItem.title}"/>
                                                                        <h:outputText escape="false" styleClass="new_game_label" value="Date added: "/>
                                                                        <h:outputText styleClass="new_game_data" value="#{dataItem.dateString}"/>
                                                                        <h:outputText escape="false" styleClass="new_game_label" value="Average Rating:"/>
                                                                        <h:outputText styleClass="new_game_data" value="#{dataItem.rating}"/>
                                                                        <h:outputText styleClass="new_game_label" value="Uploaded by:"/>
                                                                        <h:outputText styleClass="new_game_data" value="#{dataItem.userName}"/>
                                                                        <h:commandLink styleClass="new_game_label" value="Play Now!"/>
                                                                        <h:selectOneMenu styleClass="new_game_rating" value="#{dataItem.newRating}">
                                                                            <f:selectItems value="#{ratingItems}" />
                                                                        </h:selectOneMenu>
                                                                        <h:commandLink action="#{Home.rateNewGame}" styleClass="message_link" value="Rate"/>
                                                                    </h:panelGroup>
                                                                </h:column>
                                                            </h:dataTable>and Home.java
    private List<SelectItem> ratingItems = null;
         public List<SelectItem> getRatingItems()
             if (ratingItems == null)
                 ratingItems = new ArrayList<SelectItem>();
                 for (int i = 1; i <= 10; i++)
                     SelectItem item = new SelectItem();
                     item.setValue(Integer.valueOf(i));                        
                     ratingItems.add(item);
             return ratingItems;
         public void setRatingItems(List<SelectItem> items)
             ratingItems = items;        
        private List<Game> newGames = null;
        private boolean hasNewGames;
        public List<Game> getNewGames()
            if (newGames ==null)
                newGames = DataFactory.getNewGames();           
            hasNewGames = !newGames.isEmpty();
            return newGames;
        }

    What do you mean by stops rendering? Can you paste the relevant portion of the output (from view source in the browser).

  • Just moved my email from entourage to Mail. Having real problems with getting my signatures to work properly. When adding in a small company logo, windows computers only receive signature as an attachment. Am sending email as Rich Text. Any ideas on a fix

    Just moved my email from Entourage to Mail. Having real problems with getting my signatures to work properly despite sending email as Rich Text.
    When adding in a small company logo to the signature, PC's / windows computers only receive signature and logo as attachments.
    I've tried all possible fixes I can find including getting a PC user to format the logo but no joy. Has anyone experienced this and any ideas on a fix gratefully received.

    Send it as html so the signature is an image source URL

  • Problem with binding of a selectManyCheckbox inside a dataTable

    Hi,
    first i want to point out that my english is not the best. :)
    A german version is followed at the end of the english text.
    I have a class "MyClass" with few attributes like:
    private long id;
    private String text;
    private Set<MyClass2> childs;
    An a second class "MyClass2" wich also have some attributes:
    private long id;
    private String text;
    Now i have a List with lots of objects from typ "MyClass":
    List myList = new ArrayList();
    // Sample Data!!
    for (int i=0; i<100; i++)
    MyClass1 m1 = new MyClass1();
    m1.setId(i);
    m1.setText("MyClass1 Line " + i);
    // Now add some "childs":
    for (int j=0; j<i*2; j++)
    MyClass2 m2 = new MyClass2();
    m2.setId( i );
    m2.setText("Sample "+ i);
    m1.getChilds().add(m2);
    myList.add ( m1 );
    So now i want to show the ID and text every Object of MyClass1 on my "test.jsp" (width JSF Tags).
    The Collections inside this class should display as checkboxes (value = id, label = text).
    Sample:
    ID: +1+ TEXT: MyClass1 Line 1
    CHECKBOXES:
    [x] Sample 0
    [x] Sample 1
    ID: +2+ TEXT: MyClass1 Line 2
    CHECKBOXES:
    [x] Sample 0
    [x] Sample 1
    [x] Sample 2
    [x] Sample 3
    Okay i think you know what i mean. ;-)
    I tryed it also with a dataTable to iterate in "myList" and use a selectOneMenu with selectItems to generate the checkboxes.
    Here is the code:
    <h:dataTable value="#{myBean.myList}" var="rowInstance" binding="#{myBean.dataTable}" id="dataTable">
    <h:column>
    <h:outputText value="ID: #{rowInstance.id}" />
    <h:outputText value="TEXT: #{rowInstance.text}" />
    </h:column>
    <h:column>
    <h:selectManyCheckbox id="cbox" styleClass="checkbox">
    <f:selectItems value="#{myBean.childs}"/>
    </h:selectManyCheckbox>
    </h:column>
    </h:dataTable>
    Maybe you see the that i've used childs in the selectItems.
    This is a methode like that:
    public SelectItem[] getChilds()
    MyClass1 mc1 = (MyClass1) dataTable.getRowData();
    // now i iterate the childs and make for each a SelectItem()
    Also you maybe see that i have no binding on selectManyCheckbox, because i have no idea how it works. :-)
    I've tried to bind it to a String[] but and the end this String[] always contain the last low.
    My Question is now:
    When the user pressed the submit Button how can i figure out which Checkboxen the user clicked ?
    Thank you a lot.
    Now the german version (surley better explained):
    Hallo nochmal,
    ich habe versucht auf englisch mein Problem zu schildern.
    Was mit sicherheit nicht zu 100% gelungen ist, deshalb hier noch mal eine deutschsprachige Version (maybe some germans out there).
    Wie oben abgeblidet habe ich im Prinzip zwei Klassen.
    Die erste Klasse "MyClass1" hat eine Collection die Objekte von der Klasse "MyClass2" enth�lt.
    Nun m�chte ich auf meiner JSP Seite die JSF Tags benutzt eine Liste von Objekten (die vom Typ "MyClass1" sind) abbilden.
    Die Collection innerhalb dieser Klasse soll als Checkboxen dargestellt werden.
    Ich habe es ohne gro�e Probleme hinbekommen, dass er das so anzeigt wie ich das m�chte.
    Nur habe ich z.Z. noch Probleme damit wie ich sp�ter herausfinde, welche der Checkboxen denn nun angew�hlt sind.
    Normalerweise w�rde man ja ein binding machen, so k�nnte man alle ausgew�hlten Checkboxen (getSelectedValues()) ja bekommen.
    Da aber die Anzahl der Objekte immer unterschiedlich ist kann ich nicht die entsprechenden Variablen anlegen.
    Deshalb die Frage: Wie bekomme ich mit welche der Checkboxen ausgew�hlt wurden? Wie muss das binding aussehen?
    Vielen Dank.
    Greetings from Germany. :)

    Just bind it to the row object.
    JSF<h:dataTable value="#{myBean.myDataList}" var="myData">
        <h:column>
            <h:selectManyCheckbox value="#{myData.selectedItems}">
                <f:selectItems value="#{myData.selectItems}" />
            </h:selectManyCheckbox>
        </h:column>
    </h:dataTable>MyDataprivate List<String> selectedItems; // + getter + setter
    private List<SelectItem> selectItems; // + getter

  • Oracle.adf.view.rich.pprNavigation.OPTIONS on give problem with servlets

    I recentrly fix ADF_FACES-60058 using in web.xml:
    <context-param>
    <param-name>oracle.adf.view.rich.newWindowDetect.OPTIONS</param-name>
    <param-value>on</param-value>
    </context-param>
    and now bc this change, when i call a sevlet using ajax.. all my servlets stop working...
    =( This mean this is not good fix...

    Hi i am getting now after fix problem with my servlet( Delete servlet and use Backing bean instead)
    javax.servlet.ServletException: java.lang.InternalError: name is too long to represent
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:266)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
    at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
    at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
    at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
    at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
    at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$OverrideDispatch.dispatch(FacesContextFactoryImpl.java:267)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:473)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:141)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
    at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:685)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:261)
    =/

  • I have a problem regarding af:dataTable with tableSelectOne .

    HI,
    I have a problem regarding <af:dataTable> with <tableSelectOne>. I would like to know how can I pre-select
    the first item of the table? I have tried to search on the net but can't find something useful.
    Any help would be appreciated
    Regards
    Amu

    Ask has the human to know?

Maybe you are looking for

  • Folder disappeared after update!! How to recover it?

    Today i was prompted to update Mountain Lion to10.8.1 and after downloading it, my system was going to restart but Mail "crashed" and my Macbook Air didn't restarted (I waited for several minutes), I needed to go there and press restart. After that b

  • Domain name fowarding to my iWeb page.

    the company I secured my domain name with asks for a PRIMARY and SECONDARY SERVER HOST NAME. do i use: http://web.mac.com/[YourMemberName]? the space to put this information has ns.infoservemedia.com ns2.infoservemedia.com in the box Macbook Pro 2GHz

  • Alpha not rendering

    My alpha is not rendering out with the new CC2014 update. anyone else has this problem?

  • Creating Dynamic Flash Video From Photos

    I am creating a web application, mainly in php, and one of the key functions we need in the system is for it to take a set of photos that have been uploaded and dynamically create a slideshow from these files. The slideshow player (flash) should auto

  • Error -2002 hardware issue after diagnostics what can i do to fix?

    My macbbok 11 air has a mind of it's own. Sometimes turns on, often doesn't! the genius bar couldn't even turn on. At the moment it is on and so i have run a diagnostics and an error -2002 came up. Does anyone know what i can do to fix this myself? O