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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:45:25+00:00 2026-06-07T04:45:25+00:00

My question is a bit complex, I have a managed bean, possibly A session

  • 0

My question is a bit complex, I have a managed bean, possibly A session scoped one, Now In this bean I retrieve information stored in a database about some elements(their width, their height, their X,Y coordinates..etc), But these elements’number are dynamically stored, meaning they don’t have a certain number, And the other thing is they also might have another element nested inside.

Like storing a div’s position and coordinates, and the p elements inside it with thier information as well, then now i want to use managed beans to create elements accordingly.

1- What should I use ? (now I am using JSF 2 Facelets and Javascript/jQuery).

2- What would be the right way to do it using the tools that you recommend.

I am looking for something that would act like this in the JSF page

Can this be done using jsf and javascript/jquery ??

for(every i in elements.div)
{
     create a div element
    then
     for(every i in div.p )
     create a p element in that div
     width of p element = p.width
    .
    .
    .
    load all element info 
}
  • 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-07T04:45:26+00:00Added an answer on June 7, 2026 at 4:45 am

    You can use component binding. On your JSF page you refer your backing bean, which provides prepared JSF tree components.

    <p>Here comes a dynamic content</p>
    <h:panelGroup binding="#{myBackingBean.generatedElements}"/>
    

    In your backing bean you create and nest elements as you wish

    ...
    public class MyBackingBean {
    ...
    
    private HtmlPanelGroup generatedElements = new HtmlPanelGroup();
    
    public void init() {
         for (Element e : myElements) {
             // Take any element type you want
              HtmlOutputText subElement = new HtmlOutputText();
              subElement.setValue(e.getText());
              generatedElements.getChildren().add(subElement);
         }
    }
    

    You can also use subElement.setValueExpression method to build components with dynamic attributes defined by JSF expressions. For example for internationalization.

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

Sidebar

Related Questions

Sorry if this question seems a bit complex but I think its all related
I have a question for which I suspect the answer is a bit complex.
This is a bit complex so I hope I word this right. I have
This question is simple, but the set-up's a bit complex. Please bear with me...
first question from me and it's a bit of a complex one, so do
Bit support question. Apologies for that. I have an application linked with GNU readline.
This question is a bit of a two parter for .Net data services. This
This question is a bit open ended as I'm not sure it's possible or
This question is a bit of a two-parter. First, the title question. Here's what
Sorry if this question is a bit open ended, but I'm pretty new to

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.