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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:59:29+00:00 2026-06-09T16:59:29+00:00

I have a <tr:table value=#{mybean.tableValue} binding=#{mybean.tableBinding}> that i want to show with the selection

  • 0

I have a <tr:table value="#{mybean.tableValue} binding="#{mybean.tableBinding}"> that i want to show with the selection multiple enabled.
I’m using a List for the collection and the values are take from database when i selected a value from a <tr:selectManyCheckbox> valueChangeListener with partial triggers.

For each row returned, if some value is true, i want this row marked as selected in the <tr:table value="#{mybean.tableValue} binding="#{mybean.tableBinding}">

I think the problem is that my binding value is not updating when the valueChangeEvent runs inspite of i put binding.setValue the results of database (i checked that the binding.getRowCount() not equal than mybean.tableValue.size()) and then the values selected are not correct)

Any idea why the binding rowCount is not equal the value of table?

UPDATE:

<tr:subform id="subform1">
    <tr:panelFormLayout rows="6">
    <tr:selectManyCheckbox id="val1" label="Values"
      layout="horizontal" value="#{mybean.data1Values}" 
      autoSubmit="true" valueChangeListener="#{mybean.valuesChangeListener}">
        <f:selectItems value="#{mybean.list1Values}"/>
    </tr:selectManyCheckbox>                        
   </tr:panelFormLayout>
</tr:subform>
<tr:spacer width="5px"/>
<tr:subform id="subform2">            
    <tr:table rows="0" partialTriggers=":::subform1:val1 " 
      value="#{mybean.data2Values}" var="item" id="tabladatos" width="75%" 
      rowSelection="multiple" rowBandingInterval="1" binding="#{mybena.tableBinding}"
      verticalGridVisible="true" horizontalGridVisible="true">
    <tr:column id="_head1" headerText="Colum1" width="30%">
        <tr:outputText id="_head1_value" value="#{item.value1}"/>
    </tr:column>
    <tr:column id="_head2" headerText="Colum2" width="30%">
        <tr:outputText id="_head2_value" value="#{item.value2}"/>
    </tr:column>                
    </tr:table>        
</tr:subform>

public void valuesChangeListener(ValueChangeEvent event) {
        if (event != null) {
            List<Integer> valores = (List<Integer>) event.getNewValue();
            data2Values.addAll(databaseDAO.search(valores));
            RowKeySet rks = new RowKeySetImpl();
            rks.clear();
            tableBinding.setSelectedRowKeys(rks);
            tableBinding.setValue(data2Values);
            for (int x = 0; x < tableBinding.getRowCount(); x++) {
                dataEntity row = (dataEntity) tableBinding.getRowData(x);
                tableBinding.setRowIndex(x);
                if (row.isTrue()) {
                    Object key = tableBinding.getRowKey();
                    rks.add(key);//tableBinding.getSelectedRowKeys().add(key);
                } else {
                    //do something
                }
            }
            tableBinding.setVar("item");
            tableBinding.setSelectedRowKeys(rks);
            FacesContext context = FacesContext.getCurrentInstance();
            context.renderResponse();
        }

    }    

Thanks!

  • 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-06-09T16:59:30+00:00Added an answer on June 9, 2026 at 4:59 pm

    Solved! I changed the valueChangeListener:

    public void valuesChangeListener(ValueChangeEvent event) {
            if (event != null) {
                List<Integer> valores = (List<Integer>) event.getNewValue();
                data2Values.addAll(databaseDAO.search(valores));
                tableBinding.getSelectedRowKeys().clear;
                tableBinding.setValue(data2Values);
                for (int x = 0; x < tableBinding.getRowCount(); x++) {
                    dataEntity row = (dataEntity) tableBinding.getRowData(x);
                    tableBinding.setRowIndex(x);
                    Object key = tableBinding.getRowKey();
                    if (row.isTrue()) {                    
                        tableBinding.getSelectedRowKeys().add(key);
                    } else {
                        tableBinding.getSelectedRowKeys().remove(key);
                    }
                }
                tableBinding.setVar("item");
                FacesContext context = FacesContext.getCurrentInstance();
                context.renderResponse();
            }
    
        }   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a table value function that returns a list of people you may
I have a table that looks like this: id value AGA 0.211 AGA 0.433
I have a table-value function that works correctly if I try the following query:
I have a table that stores a value that will be added to over
I have a h:dataTable that displays ProfileNotification like below: <h:dataTable value=#{myBean.profileNotifications} var=item rendered=#{myBean.renderProfileNotification}> <h:column>
I am using asp.net mvc and I have a table with value. When the
I have a table value function that returns a table with 5 columns that
I have a table-value function that takes an ID number of a person and
Lets Say i have a table like this WEB_LIST_TABLE KEY Value ---------------------------------------- 134 google.com
Let's say I have the following table: Value Time 0 15/06/2012 8:03:43 PM 1

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.