• BartC
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Hi,

 

I have setup a customer portal and linked it with a site.  Everything is working except for 2 small things.

 

I show a visualforce page in the customer portal an it's displaying data in a <apex:pageblocktable and it's only showing a few rows by default (5).  Under this pageblocktable a have a <apex:commandlink .  When you click on this the controller is called and the rows limit is removed (from 5 to 0 so all records will become visible) using a pagereference method in the controller.  Sometimes this is working, sometimes i get an error Insufficient Privileges.

 

I also have a checkbox on that page that is communicating with the controller using actionSupport.  This checkbox will update a boolean field on the related account record.  Some problem here: sometimes it's working, sometime I get this error Insufficient Privileges.

 

BUT the record is always updated correctly.  So the problem must be in the Visualforce page (I think).

 

In the VisualForce page I also use rerender buet if I leave this out the problem is still ocurring

I also changed the API version to 18 (both for apex and vf) and to 19 and even 20.  Same result.

 

I always use the same customer portal user and in the controller I have many debug statements and no error is occurring there so the problem has to be on the page. 

 

I'm out of idea's.  So please HELP ! :)

 

Thank you.

 

Kind regards,

 

Bart

  • December 15, 2010
  • Like
  • 0

Hi,

 

I have setup a customer portal and linked it with a site.  Everything is working except for 2 small things.

 

I show a visualforce page in the customer portal an it's displaying data in a <apex:pageblocktable and it's only showing a few rows by default (5).  Under this pageblocktable a have a <apex:commandlink .  When you click on this the controller is called and the rows limit is removed (from 5 to 0 so all records will become visible) using a pagereference method in the controller.  Sometimes this is working, sometimes i get an error Insufficient Privileges.

 

I also have a checkbox on that page that is communicating with the controller using actionSupport.  This checkbox will update a boolean field on the related account record.  Some problem here: sometimes it's working, sometime I get this error Insufficient Privileges.

 

BUT the record is always updated correctly.  So the problem must be in the Visualforce page (I think).

 

In the VisualForce page I also use rerender buet if I leave this out the problem is still ocurring

I also changed the API version to 18 (both for apex and vf) and to 19 and even 20.  Same result.

 

I always use the same customer portal user and in the controller I have many debug statements and no error is occurring there so the problem has to be on the page. 

 

I'm out of idea's.  So please HELP ! :)

 

Thank you.

 

Kind regards,

 

Bart

  • December 15, 2010
  • Like
  • 0

After a lot of persistence I finally was able to get repeating header and footers when rendering a Visualforce page as a PDF. The key to this is the page2PDF support of CSS3. 

 

Here is the css I came up with:

 

<style type="text/css">

@page {

@top-center {

content: element(header);

}

}

div.header {

padding: 10px;

position: running(header);

}

</style>

 

In the visualforce page I have the header setup as a div with the class name "header" the position running command pulls the content in my div and repeats it at the top of every page. The key for some reason is to put your header and footer divs at the top before you put your content on the page.

 

Here is my page

 

<apex:page renderAs="pdf">

<head>

<style type="text/css" media="print">

@page {

@top-center {

content: element(header);

}

@bottom-left {

  content: element(footer);

}

}

 

div.header {

padding: 10px;

position: running(header);

}

div.footer {

display: block;

padding: 5px;

position: running(footer);

}

 

.pagenumber:before {

content: counter(page);

}

.pagecount:before {

content: counter(pages);

}

</style>

</head>

 

<div class="header">

<div>My Header Text</div>

</div>

 

<div class="footer">

<div>Page <span class="pagenumber"/> of <span class="pagecount"/></div>

</div>

 

<div class="content">

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec nulla turpis. Suspendisse eget risus sit amet lectus ornare varius. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean nec urna purus, adipiscing accumsan massa. Nullam in justo nulla, sed placerat mauris. In ut nunc eget libero posuere luctus. Donec vulputate sollicitudin ultrices. Nulla facilisi. Mauris in sapien arcu. Phasellus sit amet quam non mi ornare tincidunt ac quis lectus.</p>

</div>

</apex:page>

 

I cut the content text short for the purpose of this post. I am sure it will just take some more playing around.

 

Hope this helps someone avoid some late nights like I spent trying to figure this out. :smileyhappy:

 

 

Message Edited by JohnDS on 03-10-2010 07:34 PM