You need to sign in to do that
Don't have an account?
Jigar Trivedi
Hi,
I am facing very unusual and silly issue. I have a vf page with render as pdf based on a condition. The page contains two tables. I am hiding first table conditionally so that second table can generate with proper pdf format. Here is what should happen: On button click of first table a new tab should open and first table should be hidden and second table should be visible in pdf format. What happens is a new tab opens but first table does not get hidden as the condition (isRender remains false) remains true. Above is the code for more understanding.
Variable value with get and set gets re-initialised when constructor is called
<apex:page id="pg" sidebar="false" showHeader="false" standardStylesheets="false" applyHtmlTag="false" controller="MultipleSalarySlips" renderAs="{!if(isRender == true, "PDF", '')}"> <html> <head> </head> <apex:form id="frm"> <table style = "margin-left: 560px;border: 2px solid;padding: 19px;border-radius:5px;background-color:#f1d1bf;display:{!if(isRender == true, 'None','')}" id = "firstTable"> <!--Table 1 code--> </table> <table style="width:100%;margin-top: 50px;border-collapse: collapse;page-break-after:always;"> <!--Table 2 code with repeate--> </table>
public with sharing class MultipleSalarySlips { public String selectedToMonth{get;set;} public String selectedFromMonth{get;set;} public String selectedToYear{get;set;} public String selectedFromYear{get;set;} public List<Monthly_Salary_Details__c> monthlySalaryDetails{get;set;} public List<WrpSalaryDetail> wrpSalaryDetails{get;set;} public Monthly_Salary_Details__c msd{get;set;} public Boolean isRender{get;set;} public static Integer iq = 1; public MultipleSalarySlips(){ wrpSalaryDetails = new List<WrpSalaryDetail>(); msd = new Monthly_Salary_Details__c(); isRender = false; }
Hi,
I am facing very unusual and silly issue. I have a vf page with render as pdf based on a condition. The page contains two tables. I am hiding first table conditionally so that second table can generate with proper pdf format. Here is what should happen: On button click of first table a new tab should open and first table should be hidden and second table should be visible in pdf format. What happens is a new tab opens but first table does not get hidden as the condition (isRender remains false) remains true. Above is the code for more understanding.
This is how I did it. I used <apex:actionFunction> to call the method. This way it directly called the method.
VF Page
All Answers
Removed "!" before If condition. Check and let me know.
Thanks,
The problem is the 1st table is not hidden?
then change the display condition to display: {!if(isRender == true, '','None')}
This is how I did it. I used <apex:actionFunction> to call the method. This way it directly called the method.
VF Page