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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:30:24+00:00 2026-05-27T09:30:24+00:00

I have a list represented by a ui:repeat, where each item is a div

  • 0

I have a list represented by a ui:repeat, where each item is a div with some data. What I want is to show the item detail by clicking on the div.

I made it with a button refreshing the form but can’t make it work with onclick event on panelGroup.

<h:panelGroup styleClass="container" layout="block">
        <ui:repeat value="#{bean.model}" var="item">

            <h:panelGroup styleClass="item_data" layout="block">
                ID: #{item.id}
                <h:commandButton action="#{bean.select}" value="Select item">
                    <f:param name="itemId" value="#{item.id}"/>
                    <f:ajax render="@form"></f:ajax>
                </h:commandButton>
            </h:panelGroup>

            <h:panelGroup styleClass="detail"
                layout="block" 
                rendered="#{item eq bean.selected}">
                value: #{bean.selected.value}
            </h:panelGroup>

        </ui:repeat>
    </h:panelGroup>
  • 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-27T09:30:24+00:00Added an answer on May 27, 2026 at 9:30 am

    If I understand you correctly, you just want to show the detail section without re-rendering the whole form? If so, then wrap it in a component which is always rendered in the HTML DOM tree, give it an id and refer it instead:

    <ui:repeat value="#{bean.model}" var="item">
        <h:panelGroup styleClass="item_data" layout="block">
            ID: #{item.id}
            <h:commandButton action="#{bean.select}" value="Select item">
                <f:param name="itemId" value="#{item.id}"/>
                <f:ajax render="detail" />
            </h:commandButton>
        </h:panelGroup>
    
        <h:panelGroup id="detail">
            <h:panelGroup styleClass="detail"
                layout="block" 
                rendered="#{item eq bean.selected}">
                value: #{bean.selected.value}
            </h:panelGroup>
        </h:panelGroup>
    </ui:repeat>
    

    See also:

    • Communication in JSF 2.0 – Ajax rendering of content which is by itself conditionally rendered

    Update: as per the comments, you actually want to invoke JSF ajax action by <h:panelGroup onclick> no, that’s not possible as it doesn’t support onclick attribute. You could use a <div> with jsf.ajax.request() function, but cleaner would be to use a <h:commandLink> with CSS display: block so that it spans the entire div.

        <h:panelGroup styleClass="item_data" layout="block">
            <h:commandLink action="#{bean.select}" value="ID: #{item.id}" styleclass="detailLink">
                <f:param name="itemId" value="#{item.id}"/>
                <f:ajax render="detail" />
            </h:commandLink>
        </h:panelGroup>
    

    with e.g.

    .detailLink {
        display: block;
        color: black;
        text-decoration: none;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have List I want to sort Desc by Priority, which is int and
i have list of rows that user select and i want to delete them,
I have list of catalog paths and need to filter out some of them.
I have a list of colors represented in hex - I need to sort
I have a list of bookmarks stored in NSUserDefaults. For each bookmark entry I
Suppose I have a list of strings where each string is exactly 4 characters
Let's say I have a list of IDs and I want to see if
If you have a list such as this in Haskell: data TestType = A
I have a list box that contains items that are represented by a single
I have a list of items that can be represented like this: ClientNo Name

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.