0

When I try to add error message to my Visualforce page by using <apex:pageMeassages/> tag, my style not working when renderAs="pdf".

This is my Visualforce page:

<apex:page standardController="ConsumersClaim__c"  extensions="ConsumerBillController" recordSetVar="ConsumerBillController" renderAs="{!renderas}" applyBodyTag="false" showHeader="false" sidebar="false" showChat="false" >
<apex:pageMeassages/>
<apex:repeat var="consumercl" value="{!consumerClaimList}" >
<head>
  <style>
    my style
  </style>
</head>
<body>
 html code here
</body>
</apex:repeat>
</apex:page>
4
  • If you want to thank the answerer up vote their answer. If it is the correct one then mark it as solved. – Eric Dec 9 '15 at 0:28
  • I will you the vote when I verify that the answer is correct. now I try to do as his suggestion. – minhnv Dec 9 '15 at 0:40
  • Apologize, your comment made it sound like what was suggested worked "this is what I wanna do" – Eric Dec 9 '15 at 0:42
  • ohh , sorry @Eric , make you confusing , but that comment I thank for his help to edited my post. – minhnv Dec 9 '15 at 1:01
2

In my test I found apex:pagemessage don't display properly. So

I would suggest use a boolean variable and set this to true based on requirement.

And add css or html for message in VF page and display that.

<apex:outputpanel rendered="{!isDisplay}" >
  My page message
</apex:outputpanel>
3
  • I will try with boolean variable – minhnv Dec 9 '15 at 0:18
  • It's working !! thanks again – minhnv Dec 9 '15 at 5:00
  • @minhnv Most welcome. – Ratan Paul Dec 9 '15 at 5:00
1

thank for your help @Ranta
I found that I was put my apex:pagemessages in wrong position
this my code

<apex:page standardController="ConsumersClaim__c"  extensions="ConsumerBillController" recordSetVar="ConsumerBillController" renderAs="{!renderas}" applyBodyTag="false" showHeader="false" sidebar="false" showChat="false" >
<head>
  <style>
    my style
  </style>
</head>
<body>
<apex:pageMeassages/>
<apex:repeat var="consumercl" value="{!consumerClaimList}" >
 html code here
</apex:repeat>
</body>
</apex:page>

now it`s working well
any way thank you ! nice guy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.