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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:00:15+00:00 2026-05-21T21:00:15+00:00

I have a problem using HtmlDataTable for viewing data from database. When I create

  • 0

I have a problem using HtmlDataTable for viewing data from database.

When I create component, the table has sometimes (not always) twice number of columns.

It is shown correctly and after several refreshes (without move in dtb or something) there is for example 6 columns instead of 3 and application (sometimes) become unstable.
Since this time I can’t work with table because it reports “duplicate Id for a component”..

Simple example (source: http://balusc.blogspot.com/2006/06/using-datatables.html):

<h:form id="bde">  
    <h:dataTable id="tbl"  
                 binding="#{myBDE.dataTable}"  
                 value="#{myBDE.dataList}"   
                 var="bdeItem">  
    <h:column>  
      <f:facet name="header">  
        <h:outputText value="S" />  
      </f:facet>  
      <h:outputText value="#{bdeItem.s}" rendered="#{!myBDE.editModeRow}"/>  
      <h:inputText value="#{bdeItem.s}" rendered="#{myBDE.editModeRow}" required="true" size="3"/>  
    </h:column>  

    <h:column>  
      <f:facet name="header">  
         <h:outputText value="ID" />  
      </f:facet>  
      <h:outputText value="#{bdeItem.id}"/>  
    </h:column>  
  </h:dataTable>  
</h:form> 

And java.class

protected HtmlDataTable dataTable;  

public void setDataTable(HtmlDataTable dataTable)   
{  
  this.dataTable = dataTable;  
}  

public HtmlDataTable getDataTable()   
{  
  if (dataTable == null)   
  {  
     dataTable = new HtmlDataTable();  
     dataTable.setRows(DEFAULT_TABLE_ROWS);  
   }  
   return dataTable;  
} 

And the Error message:

javax.servlet.ServletException: Component ID j_idt92:bde:tbl:j_idt129 has already been found in the view.    
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:422)  

root cause  

java.lang.IllegalStateException: Component ID j_idt92:bde2:tbl:j_idt129 has already been found in the view.    
    com.sun.faces.util.Util.checkIdUniqueness(Util.java:821)  
    com.sun.faces.util.Util.checkIdUniqueness(Util.java:805)  
    com.sun.faces.util.Util.checkIdUniqueness(Util.java:805)  
    com.sun.faces.util.Util.checkIdUniqueness(Util.java:805)  
    com.sun.faces.util.Util.checkIdUniqueness(Util.java:805)  
    com.sun.faces.util.Util.checkIdUniqueness(Util.java:805)  
    com.sun.faces.application.view.StateManagementStrategyImpl.saveView(StateManagementStrategyImpl.java:144)  
    com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:133)  
    com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:225)  
    com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:418)  
    com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)  
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)  
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)  
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)  
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:410)  

Followed by tree of components.
I thing there’s nothing duplicated in code, but dataTable create a new columns and after that it’s really duplicated

I have two working similar modules, and the third doesn´t work.

Have you ever met this kind of problem?

Thanks for advice

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

    This can happen if the bean is session scoped instead of request scoped and you’re sharing this bean among multiple views. Best is to keep the bean to which the component is been bound in the request scope.

    As an alternative, you can also use DataModel as value instead of binding the table to HtmlDataTable if the functional requirement is to get the currently selected row.

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

Sidebar

Related Questions

No related questions found

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.