I got an error in my vf page.
Unknown property 'namespace.boardUtil.boardObject.Name'
Here is the code
<apex:page readOnly="true"
controller="PDFController"
applyHtmlTag="false"
sidebar="false"
showHeader="false"
cache="true"
renderAs="advanced_pdf"
docType="html-5.0">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<style type="text/css">
@page {
size: A4 landscape; /* Changed to portrait mode by removing 'landscape' */
padding-left: 0px;
padding-right: 0px;
}
.header {
text-align: left;
font-size: 20px; /* Adjust the size as needed */
font-weight: bold;
margin-bottom: 5px; /* Space between the header and the underline */
}
.sub-header {
font-size: 15px; /* 25% smaller than the header font size */
color: black;
text-align: left;
margin-top: 5px; /* Adjust spacing between header and sub-header as needed */
}
.underline {
margin-top: 5px;
height: 5px;
background-color: green;
width: 100%;
}
</style>
</head>
<div class="header">{!data.Name}</div>
<div class="sub-header">Folder : {!data.folderName}</div>
<div class="underline"></div>
</apex:page>
controller
public class PDFController {
private final String recordId;
public boardUtil.boardObject data { get; set; }
public PDFController() {
recordId = ApexPages.currentPage().getParameters().get('id');
data = boardUtil.getboardDataBasedOnId(recordId);
}
}
boardUtil
public with sharing class boardUtil {
public class boardObject {
public Id boardId;
public String Name;
public String folderName;
public List<ComponentObject> components;
public boardObject() {
this.boardId = null;
this.Name = null;
components = new List<ComponentObject>();
}
public boardObject(Id boardId, String Name, String folderName) {
this.boardId = boardId;
this.Name = Name;
this.folderName = folderName;
components = new List<ComponentObject>();
}
}
public class ComponentObject {
public Id componentId;
public Boolean isImage;
public String type;
public String imageUrl;
public String value;
public String title;
public String footer;
public String Subtitle;
List<object> breakPoints;
public ComponentObject() {
this.componentId = null;
this.type = '';
this.isImage = null;
this.imageUrl = '';
this.title = '';
this.footer = '';
this.Subtitle = '';
this.breakPoints = new List<object>();
}
public ComponentObject(
Id componentId,
String type,
String imageUrl,
String title,
String footer,
String Subtitle,
List<object> breakPoints
) {
this.componentId = componentId;
this.type = type;
this.isImage = type != 'Metric' && type != 'FlexTable';
this.imageUrl = imageUrl;
this.title = title;
this.footer = footer;
this.Subtitle = Subtitle;
this.breakPoints = breakPoints;
this.value = '';
}
public Id getClassicComponentId() {
String id = (string) this.componentId;
return id.substring(0, id.length() - 3);
}
}
public static boardObject getboardDataBasedOnId(Id recordId) {
// code
}
}
boardobject
variablename
needs a{get; private set;}
. BTW - Class names should be InitialCap.