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

  • Home
  • SEARCH
  • 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 7757865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:12:20+00:00 2026-06-01T13:12:20+00:00

Currently we’re trying to move to JSF 2.0 from JSF 1.2 and one of

  • 0

Currently we’re trying to move to JSF 2.0 from JSF 1.2 and one of the problem we’ve faced is that it’s impossible to rerender part of the page that contains form. Like this (rerender outerDiv or forms themselves):

<h:panelGroup id="outerDiv">
    <h:form id="form1">...</h:form>
    <h:form id="form2">...</h:form>
</h:panelGroup>

I mean that if i update outerDiv everything is updated but the form (or forms) itself becomes broken and behaves strangely, at least ajax calls either don’t work when first time triggered or instead of calling some bean’s method they create new instance of that bean and do nothing (either with destroying previous with every call or just creating new one on first call and then do nothing). The problem can be solved by rerendering only components inside form, like this (update innerDiv1 and innerDiv2):

<h:panelGroup id="outerDiv">
   <h:form id="form1">
       <h:panelGroup id="innerDiv1">...</h:panelGroup>
   </h:form>
   <h:form id="form2">
       <h:panelGroup id="innerDiv2">...</h:panelGroup>
   </h:form>
</h:panelGroup>

but we have a lot of places where we include some page with ui:include and it’s not very convenient to look inside that page and update certain components there. Besides we’ll have to modify all these pages as many of them don’t have common wrapper div inside forms and update each component separately will be very cumbersome and error prone.
So, is it possible to make JSF 2.0 correctly update part of page with 1-st approach like it was in JSF 1.2?


EDIT: it looks like the issue with form rendering is richfaces 4.2 issue as i use a4j:ajax (successor of a4j:support that was used with richfaces 3.3.3) and custom buttons based on rich:commandButton. When i substituted them with native jsf’s f:ajax forms seems to be refreshed correctly. But issue with outer div is still actual

  • 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-01T13:12:22+00:00Added an answer on June 1, 2026 at 1:12 pm

    This is related to partial state saving. If you ajax-update a component which in turn contains a form as one of its children, then its view state will get lost. Every 1st ajax request inside that form will fail because there’s no view state. But if that ajax request is re-rendering the form itself, then it will work.

    To fix this, you need to explicitly include the ID of the other form(s) in ajax render/update attribute next to outerDiv whenever it’s invoked from another form.

    E.g.

    <h:form>
        <h:commandButton value="Update other forms">
            <f:ajax render="outerDiv form1 form2" />
        </h:commandButton>
    </h:form>
    <h:panelGroup id="outerDiv">
        <h:form id="form1">...</h:form>
        <h:form id="form2">...</h:form>
    </h:panelGroup>
    

    No, this will not result in an ajax response with duplicate components. It will just trigger JSF to prepare and save the state of those other forms.

    See also:

    • Communication in JSF 2.0 – Ajax rendering of content which contains another form
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have two projects that are separate from one another. The first is
Currently I have an ActionFilter that gets the current users name from HttpContext and
currently I am trying to make it so that I can get access to
I am currently running into a problem where an element is coming back from
Currently, I am writing a MiddleWare application that synchronizes information between and accounting application
Currently I'm starting a new Activity and calling finish on a current one. Is
Currently working with converting SQLException error messages into messages that are more useful for
Currently I am trying to use a bunch of custom perl modules, test.pm as
Currently I'm experiencing a little logical problem. Assume I have an object where I
Currently I am looking to develop an application for mobile devices that would be

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.