Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6834249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:05:18+00:00 2026-05-26T23:05:18+00:00

I have an h:dataTable with data generated from an ArrayList with custom object Result.

  • 0

I have an h:dataTable with data generated from an ArrayList with custom object Result.
When I try to enable editing of cells, it will not allow me to do so. I suspect that it request data from the server and overrides my last choice.

My <h:dataTable> form and the complete xhtml document

<!-- language: xhtml -->
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>IGNORED</title>
    </h:head>
    <h:body>
        <ui:composition template="../templates/masterLayout.xhtml">
            <ui:define name="windowTitle"> #{msgs.viewResultsTitle}</ui:define>
            <ui:define name="content">
                <h:form>
                    <h:dataTable value="#{managedBean.viewResultList}" var="res"
                                 styleClass="tracks"
                                 headerClass="trackHeader"
                                 columnClasses="oddColumn,evenColumn">
                        <h:column>
                            <f:facet name="header">#{msgs.trackID}</f:facet>
                                #{res.track_name}
                        </h:column>
                        <h:column>
                            <f:facet name="header">#{msgs.startnumber}</f:facet>
                                <h:inputText value="#{res.startnumber}" size="5" rendered="#{res.editable}" />
                                <h:outputText value="#{res.startnumber}" rendered="#{not res.editable}" />
                        </h:column>
                        <h:column>
                            <f:facet name="header">#{msgs.time}</f:facet>
                                <h:inputText value="#{res.time}" size="10" rendered="#{res.editable}" >
                                    <f:validator validatorId="ResultValidator" />
                                    <f:converter converterId="ResultConverter" />                                    
                                </h:inputText>
                                <h:outputText value="#{res.time}" rendered="#{not res.editable}" />
                        </h:column>
                        <h:column>
                            <f:facet name="header">#{msgs.runnerID}</f:facet>
                                #{res.runner_name}
                        </h:column>
                        <h:column>
                            <f:facet name="header">#{msgs.divID}</f:facet>
                                #{res.division_value}
                        </h:column>
                        <h:column>
                            <h:commandLink value="#{msgs.edit}" action="#{managedBean.editAction(res)}" rendered="#{not res.editable}"/>
                       </h:column>
                        <h:column>
                                <h:commandLink value="#{msgs.saveChanges}" action="#{managedBean.saveAction(res)}" />
                       </h:column>
                </h:dataTable>
            </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

It calls the managedBean.editAction wich looks like this:

public String editAction(Result result) {
result.setEditable(true);
return null;
}

It bassicly set all the result objects to editable. But when I press the it loads the page and nothing happends.

I’ve followed the tut at http://www.mkyoung.com jsf tutorial

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:05:19+00:00Added an answer on May 26, 2026 at 11:05 pm

    Without knowing what your managedBean looks like, here are some hints:

    • viewResultList() should not update the result list but only return it. Otherwise changes to entries in that list might be overwritten if you don’t update your model first (e.g. write them to the database if you load the results from there).
    • result.setEditable(true); seems to refer to one object in your list, or it might even refer to an object not in that list. Note that only that object is set to editable.

      If you want make all entries editable, you either have to set a global property in your managed bean and check that in your table or iterate over the result list and call setEditable(true) on each entry in that list.

      Note that in the example you followed, the editAction() actually takes an object parameter order which defines which entry in orderList will be set to editable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataTable which I select from database (Well, these data cross several
I have a data tier select method that returns a datatable. It's called from
I have a DataTable as a data source of a GridView. I'm adding a
I have datatable with column name tag and 100 rows of data.I need to
I have a System.Data.DataTable which is populated by reading a CSV file which sets
I have a datatable that contains rows of transaction data for multiple users. Each
I have a DataTable that I manually created and loaded with data using C#.
I have a Datatable with Id(guid) and Name(string) columns. I traverse through the data
I have a DataContext object, called CodeLookupAccessDataContext, that was generated through the Visual Studio
My DataTable is programatically generated, and contains objects of type JobInstance in the cells.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.