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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:24:56+00:00 2026-06-04T07:24:56+00:00

I have this JSF table: <h:dataTable id=itemsTable value=#{SelectionBean.selectedItems} var=item > <f:facet name=header> <h:outputText value=Items

  • 0

I have this JSF table:

<h:dataTable id="itemsTable" 
    value="#{SelectionBean.selectedItems}" var="item"  >

<f:facet name="header">
  <h:outputText value="Items" />
</f:facet> 
<h:column>
  <f:facet name="header">
    <h:outputText value="Select" />
  </f:facet>
  <h:selectBooleanCheckbox value="#{item.selected}" />
</h:column>
<h:column>
  <f:facet name="header">
    <h:outputText value="name" />  
  </f:facet> 
    <h:outputText value="#{item.name}"></h:outputText>
</h:column>
</h:dataTable>

I want to highlight the row of the table when it’s clicked. Is there a way JavaScript code to highlight the rows only if the checkbox is clicked?

  • 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-04T07:24:57+00:00Added an answer on June 4, 2026 at 7:24 am

    The above code you have show is a plain Java Server Faces(XHTML) code.So eventually it renders as HTML. In HTML if datatable renders at , with the help of jquery you could easily highlight it with the help of ID specified or selecting using the tag name. if you need help further with jquery on highlighting this link might be useful jQuery highlight table row.

    If you are using Rich faces by any chance you could use the rich:jquery tag to achieve the same instead of using a external javascript file.

    P.S if you are using jquery using an external file with rich faces try to make use of the jquery.noconflict() method in your code as prototype.js in JSF may conflict with your code.

    Good Luck!


    Update

    May be this code snippet could be helpful for you

    <script type="javascript">
    
    if($('.checkboxClass').attr('checked','checked')){
    
      $('tr').css('background-color','yellow');
    
     }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JSF h:datatable with rows of data: <h:dataTable id=dataTable value=#{SessionsController.dataList} binding=#{table} var=item>
I have a JSF datatable like this one: <h:form id=productsBox> <h:dataTable var=product value=#{categoriesBean.category.products} id=productsTable>
jsf: <rich:dataTable id=files styleClass=table headerClass=header value=#{file} var=fileRecord rendered=#{file.rowCount>0} rowClasses=even,odd onRowMouseOver=this.style.backgroundColor='#F1F1F1' onRowMouseOut=this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'> <rich:column> precondition: have
I have a h:dataTable that displays ProfileNotification like below: <h:dataTable value=#{myBean.profileNotifications} var=item rendered=#{myBean.renderProfileNotification}> <h:column>
I have this JSF table. I want to add row numbers. <?xml version=1.0 encoding=UTF-8?>
I have this JSF table which is used to display data. I want to
I have JSF code like: <h:inputText id=from value=#{fromToMBean.fromName}/> I would like to get this
I am using rich faces data table tag in my jsf: <r:dataTable id=dataTable var=user
I have this JSF table: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML
I have this JSF table with pagination. <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC

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.