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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:26:30+00:00 2026-05-17T16:26:30+00:00

Using RichFaces 3.3.3, JSF 1.2 and Facelets. For some presentation purposes I need to

  • 0

Using RichFaces 3.3.3, JSF 1.2 and Facelets.

For some presentation purposes I need to wrap the contents of some divs with other divs to be able to style them a certain way.

I am using jQUery to do this as its cleaner when writing HTML and it can be controlled in one location, otherwise I have to hardcode the extra divs every place I want to use them.

eg. original JSF generated HTML:

<div id="j_id4:main-container">
    <div id="j_id4:j_id5:nav">...</div>
</div>

after using jQUery the HTML now looks like this:

<div id="j_id4:main-container">

    <div class="top"><div></div></div>

    <div class="middle">
            <div id="j_id4:j_id5:nav">...</div>
    </div>

    <div class="bottom"><div></div></div>

</div>

Can this cause problems? I am going against this rule from the jboss richfaces documentation which says:

Any Ajax framework should not append
or delete, but only replace elements
on the page. For successful updates,
an element with the same ID as in the
response must exist on the page. If
you’d like to append any code to a
page, put in a placeholder for it (any
empty element). For the same reason,
it’s recommended to place messages in
the “AjaxOutput” component (as no
messages is also a message).

If I can’t do this, what other approach would you suggest?

UPDATE 1:

I tried this on a page which has a rich:tabPanel control set to ajax mode, i made the first (default) one of the tab contents get the nested divs on dom ready via jQuery. it works fine the first time, but when i click the other tabs and come back to the first one the extra divs don’t appear. i think this is because the js is fired only once at dom ready and then on richfaces rerendering of tabPanel control it rerenders as if it was unaware of the extra divs. is there a way to avoid this?

  • 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-17T16:26:30+00:00Added an answer on May 17, 2026 at 4:26 pm

    As long as you aren’t disturbing the existing element ID’s, I don’t forsee any technical problems. The rule by RichFaces is probably just to put themselves safe for the case an enduser encounters problems with that, mainly when deleting elements or appending elements with the same ID. At least, they didn’t say “may not”, but just “should not”.

    As to the actual problem: JSF is of course not aware of the newly added HTML elements and doesn’t take them into account when re-rendering the HTML to the client side. You would need to write a callback function which “fixes” the HTML DOM structure after JSF’s re-rendering. Alternatively, if inserting those elements already in the view side (the XHTML page) isn’t an option, you may consider to write a custom renderer which renders the elements the way you want.

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

Sidebar

Related Questions

I'm using JSF (Mojarra 1.2) with Richfaces (3.3.2) within some facelets which are used
I'm making a website Using JSF and richfaces, but I need to do some
Using: JSF 1.2, Facelets 1.1.15, GateIn 3.1 GA, Richfaces 3.3.3 I have some common
Using Richfaces 3.3.0GA, jsf 1.2_14 and facelets. I have a richfaces ModalPanel with an
I'm using JSF 1.2 with Richfaces and Facelets. I have an application with many
I'd like to be able to make an Ajax call using JSF/Seam/RichFaces and have
I'm using Richfaces 3, Facelets (a pre-JSF 2 version), and Tomcat. I am working
I'm using RichFaces 3.3.1 with JSF RE 1.2 and facelets. I have a strange
Using jsf 1.2, hibernate, richfaces 3.3.0GA and facelets. I have this code in my
I'm using richFaces 3.3 and JSF 1.2. In my sample application I need 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.