I created Apex class with static field. I would like to use it as a value in on my custom visualforce page. On that page I use my custom controller as well. How can i access this field?
<apex:outputText value="{!Company.total_amount__c}" />
This piece of code is not allowed because it doesn't understand total_amount__c field which is defined in Company class, not controller.
Thanks in advance
EDIT:
My class with static field:
public class Company{
public String name = 'BazuBazu';
public static Decimal total_amount = 6;
}
My controller class:
public class opportunityList2Con {
public Decimal total_amount { get; set; }
public Decimal getTotalAmount(){
return Company.total_amount;
}
}
My custom page:
<apex:page controller="opportunityList2Con">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!employees}" var="o" >
<apex:column value="{!o.Name}"/>
<apex:column value="{!o.Email__c}"/>
<apex:column value="{!o.Annual_salary__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
<apex:commandButton action="{!view}" value="View" id="theViewButton" />
<apex:commandButton action="{!edit}" value="Edit" id="theEditButton"/>
<apex:outputLabel >Total amount of bill </apex:outputLabel>
<apex:outputText value="{!total_amount}" />
</apex:form>
</apex:page
The field's value doens't display on a page