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

  • Home
  • SEARCH
  • 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 6563473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:51:23+00:00 2026-05-25T13:51:23+00:00

I have input fields and datatable in the same page, in such a way

  • 0

I have input fields and datatable in the same page, in such a way that when user adds a new data, data should be added to the datatable without refreshing the page.

To achieve this I tried the following code

xhtml part

<table border="0">
        <tr>
            <td width="700" height="100px">Customer Name: <h:inputText
                immediate="true" id="customername" autocomplete="false" value="#{salesBean.customerName}">

            </h:inputText> 

            </td>
        </tr>
        <tr>
            <td width="900" height="160px">
            <table border="1">
                <tr>
                    <td align="left">Product Name</td>
                    <td align="left">Rate</td>
                    <td align="left">Quantity</td>
                    <td align="left">Total Price</td>
                    <td align="left">Paid</td>
                    <td align="left">Date of Sales</td>
                    <td align="left"></td>
                </tr>
                <tr>
                    <td align="left"><h:inputText immediate="true"
                        id="productname" autocomplete="false" value="#{salesBean.productName}">


                    </h:inputText></td>
                    <td align="left"><h:outputText id="rate"
                        binding="#{salesBean.productRate}" /></td>
                    <td align="left"><h:inputText size="2"
                        onkeyup="return calculateTotalRate(event);" id="quantity" value="#{salesBean.quantity}"/></td>
                    <td align="left"><h:outputText id="totalprice" /></td>
                    <td align="left"><h:selectOneRadio  id="sor"
                        title="Select any one of the choice" value="#{salesBean.paidFlag}">
                        <f:selectItem id="si1" itemLabel="Yes" itemValue="yes" />
                        <f:selectItem id="si2" itemLabel="No" itemValue="no" />
                    </h:selectOneRadio></td>
                    <td align="left"><rich:calendar id="salesDate" value="#{salesBean.salesDate}"></rich:calendar></td>
                    <td align="center">
                    <h:commandButton value="Submit">                        
                        <a4j:support action="#{salesBean.submit}" reRender="table"></a4j:support>
                    </h:commandButton>
                    <h:commandButton value="Cancel" /></td>
                </tr>
            </table>`
            </td>
        </tr>
        <tr>
            <td>
                <h:outputText id="errormessage" style="display:inline-block;color:Red;width:300px;"/>
            </td>
        </tr>
        <tr>
            <td>
            <h:panelGroup id="panel">
                <rich:dataTable  var="data" id="table" binding="#{salesBean.table}" rendered="#{salesBean.salesHistoryRendered}">
                    <h:column>
                        <f:facet name="header">
                                <h:outputText value="Product Name"/>                                    
                                </f:facet>
                        <h:outputText value="#{data.productName}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                                <h:outputText value="Date of Sale"/>                                    
                                </f:facet>
                        <h:outputText value="#{data.dateOfSales}"/>
                    </h:column>
                    <h:column>
                    <f:facet name="header">
                                <h:outputText value="Is Paid?"/>                                    
                                </f:facet>
                        <h:outputText value="#{data.paidCheck}"/>
                    </h:column>
                    <h:column>
                    <f:facet name="header">
                                <h:outputText value="Quantity?"/>                                   
                                </f:facet>
                        <h:outputText value="#{data.quantity}"/>
                    </h:column>

                </rich:dataTable>
                <h:outputText id="text" binding="#{salesBean.checkValueChangeListener}"/>
                </h:panelGroup>
            </td>
        </tr>
        <tr>
            <td>


            </td>
        </tr>
    </table>

Please help me to solve this. Please update me if my question is not clear.

I am using JSF 1.2 and Richfaces 3.3.2

Thanks in advance

  • 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-25T13:51:24+00:00Added an answer on May 25, 2026 at 1:51 pm

    You have missed event attribute in a4j:support. Should be like this (disableDefault=”true” is to prevent h:commandButton standard behavior):

    <h:commandButton value="Submit">                        
        <a4j:support event="onclick" disableDefault="true" action="#{salesBean.submit}" reRender="table"/>
    </h:commandButton>
    

    Or even better like this (will do the same as the lines above, but in more a4j-style):

    <a4j:commandButton value="Submit" action="#{salesBean.submit}" reRender="table"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an input field on my page where the user will type in
We have some input data that sometimes appears with &nbsp characters on the end.
I have a form with many input fields. When I catch the submit form
I have several input and option elements on my page, each (well almost) have
I have an input file that I want to sort based on timestamp which
I need to make a search page for some project. Input fields are: <h:inputText
I have jsf page: .... <form jsfc=h:form action=> <h:dataTable value=#{newMusician.strings} var=preferredMusicGenre id=musicGenresSelectTable> <h:column> <h:inputText
I have a simple data table which contains dynamic form text fields. Each field
I have a dynamic data table in JSF which has multiple input elements which
for example, i have a data table named [User], and mapping to User enetity

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.