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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:54:38+00:00 2026-06-01T02:54:38+00:00

The commandlink link2 does not have work after an ajax call is made to

  • 0

The commandlink link2 does not have work after an ajax call is made to render a panel group panel1. This was working when the whole page was relaoded instead of ajax call to display the modal.

Main.xhtml

<h:panelGroup id="panel1">
<ui:fragment rendered="#{downloadTo.showModal}">
    <ui:include src="modal.xhtml" />
</ui:fragment>  
</h:panelGroup>

<h:form>
  <h:commandLink id="link" value="download" action="#{backing.openModal()}">
    <f:ajax render="_panel1"/>
 </h:commandLink>       
</h:form>

modal.xhtml contains

 <h:form>
   <h:commandLink id="link2" value="download" action="#{backing.downloadData()}"/>
 </h:form>
  • 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-01T02:54:40+00:00Added an answer on June 1, 2026 at 2:54 am

    You need to make sure that the backing bean holding the condition for the rendered attribute is @ViewScoped. Otherwise the condition will be reinitialized to default on the ajax request. You also need to change the <f:ajax> render to explicitly include the client ID of any other <h:form> which is to be ajax-updated, otherwise it will lose its view state.

    E.g. in modal.xhtml

    <h:form id="downloadForm">
      <h:commandLink id="link2" value="download" action="#{backing.downloadData()}"/>
    </h:form>
    

    with this change in main.xhtml

    <h:form>
      <h:commandLink id="link" value="download" action="#{backing.openModal()}">
        <f:ajax render="_panel1 _downloadForm" />
     </h:commandLink>       
    </h:form>
    

    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

This does not work <h:form style=display: inline;> <h:outputLink value=#{title.link} > #{msg['g.readMore']} <f:ajax event=click immediate=true
My commandlink on menu.xhtml did not work. I have my menu.xhtml in template folder
I read on other threads that this does not work: <h:commandButton value=Create New Account
i have been struggling getting this to work for 2 weeks, I am trying
<h:commandLink id=#{id} value=#{value} action=#{actionBean.getAction} onclick=alert(this);/> In the previous simplified example, the 'this' keyword used
If you have a JSF <h:commandLink> (which uses the onclick event of an <a>
I have such structure in my jsp: <h:commandLink action=#{docbean.save}> <a4j:actionParam name=somename value=bill_all assignTo=#{billdoc.billType}/> <a4j:actionParam
Creating an installer for possible remote systems so that if they do not have
I have the following JQuery code which does similar functionality like Stackoverflow where the
I'd like to have modal panel in a page, but I would like 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.