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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:47:05+00:00 2026-06-02T00:47:05+00:00

I want to print one div with primefaces printer (primefaces 3.2 with myfaces 2.0).

  • 0

I want to print one div with primefaces printer (primefaces 3.2 with myfaces 2.0).

My faces code is like:

            <div id="page">
                <!-- SIDEBAR -->
                <div id="sidebar"
                    class="ui-widget-content ui-corner-all ui-helper-clearfix ui-shadow sidebar">
                    <ui:insert name="sidebar"></ui:insert>
                    <p:commandButton value="Print" type="button">
                        <p:printer target="content" />
                    </p:commandButton>
                </div>

                <!-- CONTENT -->
                <div id="content">
                        <ui:insert name="content">...</ui:insert>
                </div>
                <div style="clear: both;">&nbsp;</div>
            </div>

But I get a FacesException:

 javax.faces.FacesException: Cannot find component content in view.

Is this possible with primefaces printer or is there another way to do this.

Best Regards Veote

  • 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-02T00:47:06+00:00Added an answer on June 2, 2026 at 12:47 am

    p:printer expects an id of the component, but ui:insert defines a logical section which is going to be inserted by the client. You could try to wrap the content you wish to print in p:outputPanel like so:

    <p:outputPanel id="content">
      <ui:insert name="content" />
    </p:outputPanel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently my AJAX is working like this: index.php <a href='one.php' class='ajax'>One</a> <div id=workspace>workspace</div> one.php
My page structure is like <html> <body> <a href=#one>One</a> <a href=#two>Two</a> <a href=/ onClick=window.print();>Print
I have a HTML page with a CSS print layout where I want one
i want to read characters from the console and print them one after another
I want to print values of all the types like char, long... so on
I have some code that generates bills for multiple customers on one web page.
I want to print numbers 1 to 4 one by one following is my
I'm having some slight problems with fading one div into another, here's my code
I am using the following JavaScript code to print a <div> . I have
I would like to open a web page that simply contains one of three

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.