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 6822935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:43:22+00:00 2026-05-26T21:43:22+00:00

<h:dataTable value=#{studentBean2.studentList} var=student> <h:column> <f:facet name=header> <h:outputText value=STUDENT-ID /> </f:facet> <h:outputText value=#{student.studentId} /> </h:column>

  • 0
<h:dataTable value="#{studentBean2.studentList}" var="student">
    <h:column>
        <f:facet name="header">
            <h:outputText value="STUDENT-ID" />
         </f:facet>
         <h:outputText value="#{student.studentId}" />     
    </h:column>
    <h:column>
        <f:facet name="header">
            <h:outputText value="STUDENT-NAME" />
        </f:facet>
        <h:inputText value="#{student.studentName}" /> 
    </h:column>
    .........
    .........
</h:dataTable>
<h:commandButton type="submit" action="#{studentBean2.action}" value="ENTER" />

As from the above code, datatable values can be edited in <h:inputText> field and submitted. Those edited values are seen in action() method of bean StudentBean2.

As I followed the log, it showed that when I submit the page in the phase “Apply Request Values” the getStudentList() method is called. In this method I do the JDBC call to fetch students from the Database and set the newly fetched studentlist.

But in the “Invoke Application” phase, in method action() I get the edited data in the list which I have submitted. How exactly does this happen?

  • 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-26T21:43:22+00:00Added an answer on May 26, 2026 at 9:43 pm

    JSF has set them for you during the update model values phase. During this phase, the processUpdates() method of every component will be invoked. In case of the <h:dataTable> it’s the UIData#processUpdates(). For every row it will then invoke the same method of the input component, which is in your case UIInput#processUpdates().

    Basically:

    get data model of UIData; // studentList = studentBean2.getStudentList()
    for (every row of data model) {
        get the current row item by index; // student = studentList.get(index)
        for (every child UIInput component of UIData) {
            set its value; // student.setStudentName(value)
        }
    }
    

    Unrelated to the concrete problem, doing the JDBC call inside the getter method is a bad idea. The getter method will be called more than once during bean’s life, so the JDBC call will be unnecessarily made too many times. You should make the JDBC call in bean’s (post)constructor instead. See also Why JSF calls getters multiple times.

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

Sidebar

Related Questions

Let's say I have <h:dataTable var=s value#{somebean.properties}> <h:column> <h:inputText initial=#{s.min} value=#{somebean.mintmp}/> <h:commandButton action=#{filterbean.addProretryFilter(s.id, somebean.mintmp)}
I have a DataTable with column Value and column Name that has 30000 rows.
In a DataTable object, is there added overhead to looking up a column value
I have a JSF data table <h:dataTable id=memberTable value=#{bean.pList} border=0 rowClasses=rowEven rowOdd var=item> <h:column
this is my code: <a4j:outputPanel ajaxRendered=true> <h:form> <rich:dataTable id=iprangesList value=#{ipRangeOverviewAction_publicIpRangeList} var=iprange rendered=#{ipRangeOverviewAction_publicIpRangeList.size>0} style=width: 100%
One of my datatable column value looks like the below, alt text http://img101.imageshack.us/img101/200/datatable.jpg How
Is it possible to keep the filterBy value of a rich:datatable rich:column filterBy=... in
I want to achieve this using dynamic parameters for value expressions: <h:dataTable value=#{someBean.someValue} var=field>
In a datatable column how can i display a text for a number value
I have a DataTable. I want to get every rows first column value and

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.