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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:33:21+00:00 2026-05-29T12:33:21+00:00

I have a primefaces datatable: <p:dataTable id=idCrawledDataTable var=crawledData value=#{crawlerCorpusTreatmentBean.crawledDataModel} rowKey=#{crawledData.id} rows=10 scrollable=true scrollHeight=300 selection=#{crawlerCorpusTreatmentBean.crawledData}

  • 0

I have a primefaces datatable:

<p:dataTable id="idCrawledDataTable"
    var="crawledData"
    value="#{crawlerCorpusTreatmentBean.crawledDataModel}"
    rowKey="#{crawledData.id}"
    rows="10"
    scrollable="true"
    scrollHeight="300"
    selection="#{crawlerCorpusTreatmentBean.crawledData}"
    style="width: 850px;">

 <f:facet name="header">
     RadioButton Based Selection
 </f:facet>

  <p:column selectionMode="single"
     style="width: 12px;"/>

  <p:column headerText="id"
     style="width: 20px;">
         #{crawledData.id}
  </p:column>

  <p:column headerText="Sritis"
      style="40px;">
          #{crawledData.domain}
  </p:column>

  <p:column headerText="URL"
      style="width: 450px;">
          #{crawledData.url}
  </p:column>

</p:dataTable>

It is all filled with values after action method is called. Datatable has radio button selection. When I select one of the radio button and click the command button, I go to some method in which I call my bean, but all values from datatable that my bean has is null.

Showcases shows only how to display data in modal window, I can not find any information on how to pass parameters to managed bean. Maybe someone could help me with this?

  • 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-29T12:33:21+00:00Added an answer on May 29, 2026 at 12:33 pm

    Works just for me. Perhaps your data loading logic is wrong (e.g. you’re doing it inside a getter method) or the equals() method of the object behind rowKey is broken.

    Here’s a self-containing kickoff example so that you can at least nail down your own mistake:

    <h:form>
        <p:dataTable value="#{bean.items}" var="item" selection="#{bean.item}" rowKey="#{item.id}">
            <p:column selectionMode="single" />
            <p:column headerText="id">#{item.id}</p:column>
            <p:column headerText="value">#{item.value}</p:column>
        </p:dataTable>
        <p:commandButton value="submit" action="#{bean.submit}" />
    </h:form>
    

    with

    @ManagedBean
    @ViewScoped
    public class Bean implements Serializable {
    
        private List<Item> items;
        private Item item;
    
        @PostConstruct
        public void init() {
            items = new ArrayList<>();
            items.add(new Item(1L, "one"));
            items.add(new Item(2L, "two"));
            items.add(new Item(3L, "three"));
        }
    
        public void submit() {
            System.out.println(item);
        }
    
        public List<Item> getItems() {
            return items;
        }
    
        public Item getItem() {
            return item;
        }
    
        public void setItem(Item item) {
            this.item = item;
        }
    
    }
    

    where Item has just Long id and String value properties.

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

Sidebar

Related Questions

I have a datatable: <p:dataTable style=width: 100%; id=dTable var=tt value=#{backingBean.memberList} paginator=true rows=20 selection=#{backingBean.selectedMember} selectionMode=single
I have a h:dataTable that displays ProfileNotification like below: <h:dataTable value=#{myBean.profileNotifications} var=item rendered=#{myBean.renderProfileNotification}> <h:column>
I have a JSF datatable like this one: <h:form id=productsBox> <h:dataTable var=product value=#{categoriesBean.category.products} id=productsTable>
I am new to jQuery. I have PrimeFaces dataTable. when it is converted to
I have a non-editable DataTable built with PrimeFaces. The table is initially filled with
I'm using primefaces and jstl to loop a datatable.I have a List in backing
I have an application that contains commandLinks within a Primefaces dataTable. The commandLinks link
I have problem firing an ajax request with Primefaces <f:metadata> <f:viewParam name=token value=#{clientBean.token}/> <f:event
I have a popup with three tabs in primefaces tabPanel. In the middle is
I have a modal ConfirmDialog that is shown over a modal Dialog using PrimeFaces

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.