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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:02:35+00:00 2026-06-11T22:02:35+00:00

I am calling a page from another with a prerender view event in an

  • 0

I am calling a page from another with a prerender view event in an f:metadata element.

If I navigate to page using <h:link> it works and calls the listener method.

However if I navigate to the page using an outcome from the action method of a managed bean belonging to the calling page, the listener designated in the prerenderview doesn’t get called (as it does if called by a link). It does navigate to the second page, just no listener call.

I would really prefer to call from the action method because I use it to do some work and place a variable in the session map for the called page to use. I’m not sure how to achieve the same thing using a link. The object can be rather large… kb not Mb but still not something I want to put in the request.

I’ve tried making the managed bean of the calling page request scoped and view scoped.

Is it not possible to get a prerenderview to fire if it is called from a managed bean outcome? As I said, I got it to work from a link.

<body>
    <ui:define name="metadata">
        <f:view>
            <f:metadata>
                <f:event type="preRenderView" listener="#{businessBean.init}" />
            </f:metadata>
        </f:view>
    </ui:define>
    <ui:composition template="#{navigationprops.soulard_2col_uprefs_template}">
  • 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-11T22:02:36+00:00Added an answer on June 11, 2026 at 10:02 pm

    ui:composition tag trim everything outside it, so facelets compiler doesn’t have the chance to read the code. Instead, you should use ui:decorate, but remember f:metadata tag only works on the top level page, not inside the template client. For example:

    <ui:composition 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core">
    <f:metadata>
        <f:viewParam name="hotid" 
           value="#{hotelBooking.hotelId}" 
           converter="javax.faces.Long"/>
        <f:event type="preRenderView" listener="#{hotelBooking.selectHotel}"/>
    </f:metadata>
    <ui:decorate template="template.xhtml">
       <ui:define name="content">
       <!-- ... -->
       </ui:define>
    </ui:decorate>
    </ui:composition>
    

    See This example for details.

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

Sidebar

Related Questions

I'm using fsockopen() to request a value from a page on another server. The
I am calling a Javascript function in my html page from a Flash movie
I am calling .ashx file for download excel file from Master page menu item.
I have an Employee class object that I am calling from my Login.aspx page's
The problem in the code below is calling one function from another - the
I have a page in which i m calling another popup by window.open method.
When calling a function from a page in javascript, is there a way to
I loaded a colorbox modal with contents from another page of the website (AJAX
I am calling a Servlet from index.jsp using Ajax. If the result is false,
I want to call some public method of the page from another page Here

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.