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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:34:48+00:00 2026-06-07T17:34:48+00:00

before I have been using render time tags(like a4j:repeat,ui:repeat), to create panels based on

  • 0

before I have been using render time tags(like a4j:repeat,ui:repeat), to create panels based on a collection of items. All of that changed and now I must use c:forEach instead.
On each panel I do a lot of AJAX calls and partial updates of the page. That’s why I’m using custom id’s in order to identify wich components I want to update. So my render attributes are like this:

#{cc.clientId}:pnlRepeat:#{row}:radioAplicar

Where pnlRepeat is the id attribute, and {#row} is the rowKeyVar attribute in the same tag. Now… none of them exists when using c:forEach, hence, I’m getting duplicated id exceptions. I know I could use the varStatus, and create a panel with the #{row} Id, but on the other hand. JSF doesn’t let id attributes to evaluate an EL expression. What would be a workaround?. Thanks a lot.

  • 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-07T17:34:50+00:00Added an answer on June 7, 2026 at 5:34 pm

    You should not be trying to base any of your ManagedBean logic or EL expressions on the generated IDs of repeating components like <ui:repeat> or <c:forEach>. Like you already mentioned the EL expression will not let you dynamically evaluate an Id expression, so the appropriate way to deal with these situations where an event is triggered by an individual item within a repeating component is to pass a uniquely identifying value in the form of the <f:attribute> tag.

    Using the <f:attribute> tag will put the specified value into the request attributes so that it can be retrieved in your action listener.

    <ui:repeat value="..." var="repeatedVar">
      <h:inputText id="newTxt" value="#{repeatedVar}" >
         <f:attribute name="unique_id" value="#{repeatedVar.uniqueId}" />
      </h:inputText>
    </ui:repeat>
    <h:commandButton actionListener="#{managedBean.someMethod}" ...
    

    And in the action method we can determine what the action or business logic is to be executed on by retrieving that dynamic components attribute.

    public void someMethod() {
        String uniqueId = (String) UIComponent.getCurrentComponent(FacesContext.getCurrentInstance()).getAttributes().get("unique_id");
        //Get the unique data object
        //Do some business logic and other stuff...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been looking at using JOGL to create some things and have been
I have been using UIWebView to render file formats such as Keynote, Pages, Numbers,
I have been working with databases recently and before that I was developing standalone
similar questions have been asked before but I cant find an exact match to
This may have been answered before, and if so, point me to the answer.
I think it might have been asked before but i was unable to find
This question may have been asked before, but I had trouble finding an answer,
This seems to have been asked before: rails decimal precision and scale But when
This has / may have been asked before, but, as far as I remember,
I am sure this would have been asked before but couldn't find it. Is

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.