Using non-h:dataTable and h:dataTable tags

I have the following.
A JSF JSP with h:inputText tags. The tags are bound to properties of my bean (named ProductApprovalBean) which accesses the database. This code works ok.
I want to add a h:dataTable tag to the same JSF JSP but the combinations I have tried cause runtime errors. Is it possible to mix them? If so, how would you recommend I do it?

Do not use an h:panelGrid, instead make five h:column instances, each containing what goes in one cell of the table.

Similar Messages

  • Trouble using MyFaces dataTable and t:columns tag in JSR168 portlet

    Hi, I have a question and need some help.
    I am building a JSF portlet, and trying to use Appache MyFaces custom tags.
    I need to use t:dataTable, and t:columns tags to display a dynamic ListDataModel, since the number and content of columns will vary.
    The problem is, the dataTable will only display the first row of the ListDataModel, although the data is all there. It seems that the page only reads the first row of the ListDataModel. Anybody has similar experience, or have some work around?
    Thank you in advance.

    Thats a way I had not thought of to approach this
    problem.
    I'd like to see what your backing bean looks like in
    this instance.
    How does the binding to #{item.data} map to anything?As usual BackingBean
    TableInfoBean.contentTable is UIData. I use binding just for combobox. You can drop this binding.
    TableInfoBean.content.currentPage is any container supported by dataTable. In my case this is Collection. This Collection contains item objects. Each item can has one property with array, List, Collection etc. In my case this property is data (row.data). Each item of this data collection is some object too. In my case this objects has property data too.
    The hierarchy is
    dataTableList:Collection->itemObjectYAxis:SomeType->data:Collection->itemObjectXAxis:SomeAnotherType->properties for output.
    >
    Thanks
    -Matthew

  • How To Install Invoke-SQLcmd2, Write-DataTable and Out-DataTable

    I found Chad Miller's SQL Server PowerShell scripts Write-DataTable, Out-DataTable and Invoke-SQLcmd2. I can't find any information regarding how to install them though - everywhere I look they're referred to as a script and not a module so add-module wouldn't
    work unless I'm missing something. Is there a module pack containing all three cmdlets available?
    Thanks in advance
    Adam

    $profile
    Will show you the loction
    test-path $profile
    Will give you a true or false if you actually have a file in there
    new-item $profile -itemtype file -force
    if false use the above to create one, from there you can open it up in notepad and edit it to include what you need.
    THIS IS FOR ANYONE IN THE FUTURE WHO COMES A CROSS THIS THREAD AND DOESN'T KNOW HOW TO DO PROFILES
    If this is helpful please mark it so. Also if this solved your problem mark as answer.

  • Some questions about using non-english characters and keyboard layouts

    I've found a lot of guides about how to enable characters in Linux, and that is easy enough, but I want to understand it better.
    The way that I understand it, if you don't enable a given set of characters in locale.gen, then in theory you should not be able to either use or display a that set of characters in any programs (however, certain programs, like web-browsers seem to have work arounds).
    Furthermore, in order to be able to type characters in X programs, you need to enable those keyboard setups in your xorg.conf (in addition to enabling those locales in locale.gen).  I don't think that this effects the displaying of characters
    Then, Last, you need a way to switch back and forth between different keyboard layouts within your X environment in order to type those characters. There are programs to assist in switching keyboard layouts provided by some DE's.  By using these keyboard layout tools, I alter the behaviour of all programs started in X.  (for example, swithing keyboard layouts in gnome's settings will alter the behaviour of kde programs, firefox and openoffice.)
    How close am I?
    A few more questions:
    If I'm a Spanish student which locales do I need to enable.  There is a long list of locales that start with ES, and I don't know if there are any drawbacks to enabling unnecessary locales. I think that the ones that I need are es_ES* (Spanish spanish?) and es_MX* (Mexican spanish?).
    What is do the *@EURO locales do?
    what does the locale setting in rc.conf do?

    I've found a lot of guides about how to enable characters in Linux, and that is easy enough, but I want to understand it better.
    The way that I understand it, if you don't enable a given set of characters in locale.gen, then in theory you should not be able to either use or display a that set of characters in any programs (however, certain programs, like web-browsers seem to have work arounds).
    Furthermore, in order to be able to type characters in X programs, you need to enable those keyboard setups in your xorg.conf (in addition to enabling those locales in locale.gen).  I don't think that this effects the displaying of characters
    Then, Last, you need a way to switch back and forth between different keyboard layouts within your X environment in order to type those characters. There are programs to assist in switching keyboard layouts provided by some DE's.  By using these keyboard layout tools, I alter the behaviour of all programs started in X.  (for example, swithing keyboard layouts in gnome's settings will alter the behaviour of kde programs, firefox and openoffice.)
    How close am I?
    A few more questions:
    If I'm a Spanish student which locales do I need to enable.  There is a long list of locales that start with ES, and I don't know if there are any drawbacks to enabling unnecessary locales. I think that the ones that I need are es_ES* (Spanish spanish?) and es_MX* (Mexican spanish?).
    What is do the *@EURO locales do?
    what does the locale setting in rc.conf do?

  • Errors with querying a query table using non-QoQ query and QoQ query

    HELP ! ! !  Going into testing soon. I need this to work to get correct report results ! ! ! !
    My issue seems similar to the one just answered about Query of Queries RunTime Error
    and the reply from lawhite01 caught my eye.
    This is a 2 parter. The second part is the QoQ part, but the 1st part has a line in the query that is similar to the QoQ one and it uses the same data. Part 1 also throws an error.
    PART # 1.
    I'm trying to use a query table created through QueryNew and then query it.
    I need multiple columns in the query table I create:
    <cfscript>
            tot_AllCurrentDraftListing = QueryNew("AnnounceNum, JP_PDLoc, JP_JS_Title, JP_JS, JP_KW_1, JP_JobTitle, JP_Open, JP_Close, JP_CloseType, JP_CloseName, JP_PosNeed, JP_DirectHire, JP_Desc, JP_Draft, JP_Archived, JP_State, JP_AreaName, JP_AreaID, JP_AreaAlias, JP_Fac_SU, JP_Fac_Facility, JP_FAC_ID, JP_Grade1, JP_sal_low1, JP_sal_high1, JP_Grade2, JP_sal_low2, JP_sal_high2, JP_Grade3, JP_sal_low3, JP_sal_high3, JP_Grade4, JP_sal_low4, JP_sal_high4, JP_Grade5, JP_sal_low5, JP_sal_high5, JP_Posted, JP_TypeHire, JP_HRemail");
        </cfscript>
    Then I populate all the cells of the query table.
    Then I set up to use the created query table.
    I do this first:
        <cfquery name="qAltPostID" datasource="#at_datasource#">
             SELECT AltPoster, fk_Job_AnnounceNum
             from JOB_JPContacts
             Where AltJPContactType = 'AltPosterID'
             and AltPoster = '#session.IHSUID#'
             </cfquery>
    Then, in my first query using the created query, I expect to need to choose from multiple values, so I'm using this line in the query (this is NOT a QoQ query):
                and AnnounceNum IN (<cfqueryparam cfsqltype="CF_SQL_varchar" value="#ValueList(qAltPostID.fk_Job_AnnounceNum)#">)
    I've also tried:
                   and AnnounceNum IN (#ValueList(qAltPostID.fk_Job_AnnounceNum)#)   
    and:
                   and JOB_AnnounceNum IN
                    SELECT fk_Job_AnnounceNum
                    from JOB_JPContacts
                    Where AltJPContactType = 'AltPosterID'
                    and AltPoster = '#session.IHSUID#'
    ERROR is: one record should return. I get 0.
    PART # 2: Here's the QoQ part.
    I get the error:
    Query Of Queries runtime error.
    Comparison exception while executing IN.
    Unsupported Type Comparison Exception: The IN operator does not support comparison between the following types:
    Left hand side expression type = "LONG".
    Right hand side expression type = "STRING".
    A tutorial I found gave an example using only one column for this part of the fix:
         tot_AllCurrentDraftListing = QueryNew("AnnounceNum", "CF_SQL_VARCHAR")
    How would I set up the query with the datatype when I'm using multiple columns:
    <cfscript>
            tot_AllCurrentDraftListing = QueryNew("AnnounceNum, JP_PDLoc, JP_JS_Title, JP_JS, JP_KW_1, JP_JobTitle, JP_Open, JP_Close, JP_CloseType, JP_CloseName, JP_PosNeed, JP_DirectHire, JP_Desc, JP_Draft, JP_Archived, JP_State, JP_AreaName, JP_AreaID, JP_AreaAlias, JP_Fac_SU, JP_Fac_Facility, JP_FAC_ID, JP_Grade1, JP_sal_low1, JP_sal_high1, JP_Grade2, JP_sal_low2, JP_sal_high2, JP_Grade3, JP_sal_low3, JP_sal_high3, JP_Grade4, JP_sal_low4, JP_sal_high4, JP_Grade5, JP_sal_low5, JP_sal_high5, JP_Posted, JP_TypeHire, JP_HRemail");
        </cfscript>
    I used this code after all the cells contained values and before running my QoQ query:
            <cfloop index="intID" from="1" to="#tot_AllCurrentDraftListing.recordcount#" step="1">
                <cfset tot_AllCurrentDraftListing["AnnounceNum"] [intID] = JavaCast("string", intID) />
            </cfloop>
              Is that correct?
    Thanks.
    Whoever can help me with this should be awarded extra points ! ! ! !

                and AnnounceNum IN (<cfqueryparam cfsqltype="CF_SQL_varchar" value="#ValueList(qAltPostID.fk_Job_AnnounceNum)#">)
    If you're passing a list as a param, you need to tell <cfqueryparam> it's a list.  Read:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_p-q_18.html#1102474
    ERROR is: one record should return. I get 0.
    It's a bit hard to comment on this sort of thing without knowing the data involved.
    A tutorial I found gave an example using only one column for this part of the fix:     tot_AllCurrentDraftListing = QueryNew("AnnounceNum", "CF_SQL_VARCHAR")
    How would I set up the query with the datatype when I'm using multiple columns:
    Again, this is a matter of reading the relevant docs:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/functions_m-r_19.html#292759
    As a general rule, if you're having trouble with the syntax of a CFML statement, look it up in the docs.
    Adam

  • Can I use non-apple earphones with radio remote?

    I have a new Ipod 3g and want to buy the radio remote. Must I use the earbuds supplied with the radio remote or can I use non-apple earbuds and earphones? Will I still get good radio reception with a non-apple earphone?

    Yes you can. I use Sennheiser PX100's and they work just fine.
    Plug the headphones into the remote rather than the iPod to get the best reception.

  • c:choose and c:when tags aren't working....

    I have created a page that allows the user to change their password if they want. I am requiring they enter their current password and then the new password twice. When they click the submit button it will validate in the background that all passwords match and there are no mistakes... But if there are mistakes I want to set a variable to true then on my .jsp page use the <c:choose> and <c:when> tags to check if the variable is set to true and if it is have a message appear on the page saying it didnt work and to try again. Here's my code for the .jsp page:
                <c:choose>
                    <c:when test="${ChangePasswordAction.showError == true}">
                        Your request to change your password was unsuccessful. Please try again!<br />
                    </c:when>
                    <c:otherwise>
                        Your request to change your password was successful. An email has been sent to your primary email address.<br />
                    </c:otherwise>
                </c:choose>Any suggestions will help!! Thanks

    Remember EL doesn't refer to java variables or classes. It uses the attributes in page, request, session and application scopes.
    Is ChangePasswordAction an attribute in scope somewhere?
    Does it have a "isShowError()" or "getShowError" method to reveal error as a boolean attribute?

  • h:dataTable and c:when

    Hi, I am trying to use jstl inside datatable but it always goes into the otherwise though the flag is true in <c:when.
    pls help if anyone had the same problem..Here is the code i have written
    <h:dataTable value="#{pc_ResetPassword.secQuestions}" var="varsecList" id="secQuestionTable">
    <h:column>
         <h:outputText id="textQuestion" value="# varsecList.questionText}"></h:outputText>
    </h:column>
    <c:choose>
    <c:when test="${varsecList.flag =='true'}">
    <h:column>
    <h:inputText styleClass="inputText" id="answer"
    value="#{varsecList.answer}"></h:inputText>
    </h:column>
    </c:when>
    <c:otherwise>
    <h:column>
    <h:inputSecret styleClass="inputSecret" id="ansSecret"
    value="#{varsecList.answer}"></h:inputSecret>
    </h:column>                         
    </c:otherwise>
    </c:choose>     
    </h:dataTable>
    Thanks.

    You may be able to achieve your desired result using the "rendered" attribute of your jsf tags and skip jstl entirely.
    Example:
    <h:column>
    <h:inputText tyleClass="inputText" id="answer"
    value="#{varsecList.answer}"
    rendered="#{varsecList.flag eq true}">
    <h:inputSecret styleClass="inputSecret" id="ansSecret"
    value="#{varsecList.answer}"
    rendered="#{varsecList.flag eq false}">
    </h:column>

  • 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

  • h:dataTable and h:panelGrid Troubles

    I have a list of Server Objects that I want to display in a table format with specifically 5 columns and the number of rows can be dynamic based on the number of Servers. I need the Servers to be displayed as buttons with the Server.name on the button and the button color based on the Server.status. I am trying to accomplish this with a <h:dataTable> and a <h:panelGrid>, but with no luck. Can someone please offer up a solution? I am getting what I want, but it is all in 1 column, not in 5 columns. My code is below:
    <h:dataTable value="#{serversBacking.servers}" var="server">
      <h:column>
        <h:panelGrid columns="5">
          <ui:fragment rendered="#{server.status=='up'}">
            <h:commandButton action="processes?faces-redirect=true" value="#{server.name}" style="background-color:green"/>
          </ui:fragment>
          <ui:fragment rendered="#{server.status!='up'}">
            <h:commandButton action="processes?faces-redirect=true" value="#{server.name}" style="background-color:red"/>
          </ui:fragment>
        </h:panelGrid>
      </h:column>
    </h:dataTable>

    Do not use an h:panelGrid, instead make five h:column instances, each containing what goes in one cell of the table.

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

  • How do link form input and a datatable that are on the same page?

    I am real new to JSF, so I'm having the following issue...
    I created a demo app that will pull records from from a database and display them in a datatable. I hava a backingbean for this process that works great with hardcoded data.
    Now, I want to add a form to this page and use the form input to drive the results in the datatable. I have created my form and used a separate backingbean that is essentially a JavaBean for all the form input.
    My question is how do I integrate the submit button from this new form to feed the call that is used for the datatable?
    Here's is a snippet of the pertinent code from the JSP:
    <TABLE border="0">
                   <TBODY>
                        <TR>
                             <TD>
                             <P>Correlation ID:</P>
                             </TD>
                             <TD><h:inputText styleClass="inputText" id="correlationId"
                                  value="#{LogMessageBean.correlationId}"></h:inputText></TD>
                             <TD width="121"></TD>
                             <TD width="153">
                             <P>Workflow ID:</P>
                             </TD>
                             <TD width="158"><h:inputText styleClass="inputText" id="workItemId"
                                  value="#{LogMessageBean.workItemId}"></h:inputText></TD>
                        </TR>
                   </TBODY>
              </TABLE>
              <BR>
              <div align="center">
              <h:commandButton value="Search" actionListener="#{LogValueListHandler.search}" action="#{LogValueListHandler.result}"/>
              <h:commandButton value="Reset" onclick="reset()"/></div>
              <H5>Application Logging Results</H5>
              <t:dataTable value="#{LogValueListHandler.logList}" var="feed"
                   rowClasses="oddrow, evenrow" headerClass="table">
                   <t:column>
                        <f:facet name="header">
                             <h:outputText value="ClassName" />
                        </f:facet>
                        <h:outputText value="#{feed.className}" />
                   </t:column>
                   <t:column>
                        <f:facet name="header">
                             <h:outputText value="MethodName" />
                        </f:facet>
                        <h:outputText value="#{feed.methodName}" />
                   </t:column>
    ...Thanks!

    Locutus_1,
    I'm working on the same sort of app - A data table where the record selected is displayed in a form below the datatable and may be edited and saved.
    I've included a checkbox in the datatable so that the user can indicate which record is to be displayed and edited. The have everything working, except that I cannot get the checkbox click event passed to the backing bean correctly (critical to the entire operation). When I have this working, I'll post the code.
    This solution does not have a direct link between the datatable model and the data handled by the form. The backing bean code does this. If there was a solution where the two could be linked directly via JSF, I'd be very interested in it.
    Werner

  • 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

  • Q: How to access and modify xml tags using Java

    I have an xml based document that i need to access and change. For example, the code
    <section id="section1">
    <div>
    <xforms:group id="id1">
    <xforms:label id="label1">
    <l style="font-size:16pt"> something </l>
    </xforms:label>
    </xforms:group>
    </div>
    </section>
    Working with Java I need to access all the tags, select some of them that are relevant to the current device and remade the document. I thought I would read the file character by character identifying the different labels and building a tree, storing in the tree nodes the relevant information as some kind of attributes (for example, in the case of the <xforms:group id="id1"> I would name the node "xforms:group" and create an "id" attribute with value "id1"). I'm not sure if that is the most efficient way of accessing the problem (computational power might be an issue), and would appreciate some help on the subject.
    Thanks,

    this may help you..
    this is a little util i made to help me read/write files.
    using this, you are only one step away from your solutions, you only need to figure out the regex you need to run on the text of the file to make it become what you need it to become.
    though if you use non-standard encoding, you might not want to use this code..
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.Arrays;
    public class ASCIIFile {
         private File file;
         private StringBuilder builder;
         public ASCIIFile(String path) throws IOException{
              file = new File(path);
              openFile();
         public ASCIIFile(File file) throws IOException{
              this.file = file;
              openFile();
         public void setNewFileName(String fileName){
              file = new File(file.getAbsolutePath(), fileName);
         public void setNewFilePath(String filePath){
              file = new File(filePath, file.getName());
         private void openFile() throws IOException{
              if(!file.exists()) file.createNewFile();
              BufferedReader read = new BufferedReader(new FileReader(file));
              String line = read.readLine();
              builder = new StringBuilder();
              while(line != null){
                   builder.append(line);
                   builder.append("\n");
                   line = read.readLine();
              read.close();
         public String getContents(){
              return builder.toString();
         public StringBuilder getStringBuilder(){
              return builder;
         public void setStringBuilder(StringBuilder b) throws IOException{
              setContents(b.toString());
         public void setContents(String contents) throws IOException{
              FileWriter writer = new FileWriter(file);
              writer.write(contents);
              writer.flush();
              writer.close();
              builder = new StringBuilder(contents);
         public static File[] getAllFilesUnderDir(String fullpath, boolean recursive) {
              ArrayList queue = new ArrayList(10);
              ArrayList matched = new ArrayList();
              File root = new File(fullpath);
              File[] files = root.listFiles();
              if (files == null || files.length == 0) {
                   return new File[] {};
              queue.addAll(Arrays.asList(files));
              for (int j = 0; j < queue.size(); j++) {
                   File child = (File) queue.get(j);
                   if (child.isDirectory() && recursive) {
                        files = child.listFiles();
                        if (files != null) {
                             queue.addAll(Arrays.asList(files));
                   } else { // child is file
                        matched.add(child);
              return (matched.size() > 0)?((File[]) matched.toArray(new File[] {})):(new File[] {});
    }

  • Rowspan and h:datatable

    Hi,
    I've a little problem with datatable,
    I want to make table like this
    A |________
    |________
    |________
    ___|________
    B |________
    |________
    |________
    ___|________
    How to do this table using h:datatable.
    I think, that I must use h:datatable within h:datatable, but it's difficult.
    Is there any simple way, or better to wait for JSF2.0?
    Thanks

    I've tried to get correct working nested datatable
    with commandbutton in innertable.
    To view nested table are good, but events in don't
    work correctly.UICommand elements in datatables are tricky. Keep in mind that the data should be available all the time, during all JSF phases, so that JSF knows which row was involved in the ActionEvent. A simple prove: if the managed bean which takes care of the data is set in request scope, change it to session scope. Big chance that it should work.
    Does anybody know, how to get simple walkaround in
    this problem, or it's better to use 1 table, delete
    unnecessary data or/and try to make rowspan?
    Thanks for help:)Deleting unnecessary data so that you get empty cells in the right rows is easy to implement. Just compare with the former row in a loop. If you want to create rowspans, then go for another datatable component, like I mentioned earlier. Tomahawk or RISB.

Maybe you are looking for

  • Mini displayport HDMI adaptor doesn't work

    I bought a mini display port to HDMI adaptor for my Macbook Pro. But every time i plug it into my tv it only shows the default purple sky background and none of my actually stuff. I don't know why it's doing this. can anyone help?

  • User password not accepted after migration

    Source: iMac Lion OSX.7.4  Destination iMac OSX6.8 Problem: user password is not accepted after migration What I did: Tried to migrate over the LAN, but in the migration assistant the other Mac was mutually never recognized. (Did migrations several t

  • Condition Type Of Shipment Cost

    Hi Guru: Anyone can tell me which transaction/table to include all the condition type of shipment cost ?Thanks.

  • Serious Problems :(

    Ok... So a few days ago my iMac just stopped working... First Adium crashed, than Safari crashed... I tried to restart my mac but all i got was the grey screen with the Apple and after that a blue screen. I re-installed everything with my OS cd's and

  • Online Number randomly not connecting - going to V...

    I am having this problem now for months. Randomly, people trying to call me on one of my three online numbers hear either a busy signal, the VM message, or it just keeps ringing forever for them, all without my Skype client notifying me in any way. T