This is my controller:
public with sharing class MyController {
public myObject__c myObj {get; set;}
public String myObjectId;
public Boolean one;
public Boolean two;
public Boolean three;
public MyController(ApexPages.StandardController standardController) {
myObjectId = standardController.getRecord().id;
}
public MyController() {
String query = 'SELECT id, one__c, two__c, three__c FROM myObject__c WHERE ID = :myObjectId LIMIT 1';
myObject__c obj = database.query(query);
one = plan.one__c;
two = plan.two__c;
three = plan.three__c;
}
}
I want to pass one of the Boolean values into an alert on this page:
<apex:page standardController="StandardController" extensions="MyController">
<script>
alert('{!one}')
</script>
</apex:page>
But Im getting the following error in Eclipse when I try to add the alert to me page:
Unknown Property: 'StandardController.one'
So it's looking in the StandarController for the value, when it should be looking in the extension.
Can anyone spot what I'm doing wrong here?
public Boolean one {get; set;}
.