You need to sign in to do that
Don't have an account?
Invoke a class variable in a VisualForce page
Hi,
i am currently trying to get some insight into developing for SalesForce with VisualForce and Apex.
I have built a VisualForce calendar which is still very static at the moment.
What i would like to do:
The calendar consists of 8 columns, one of those is a column for custom text, the others are the columns for the days.
Every day now has a static number of rows, which should represent special products.
I want to write a <apex:repeat> for that, so that there is a row for every product.
There is the first problem: How do i invoke the result of a SOQL Query i wrote in a method of the controller? I created a variable in which the number products are stored.
I tried the following (with no success):
<apex:repeat value="{!count}" var="anzahl" id="foreachanz">
In this case, "count" is the name of the variable with the number of products.
The method which counts the entries is the following:
public Integer Anzahl() { Integer anz = [select count() from Leihanlage__c]; return anz; }
How do i reference the variable in the apex:repeat?
I would suggest you to look into the apex:dataTable and apex:column tags for this purpose. Here an short example, in this case just to display a list of contacts.
All Answers
I would suggest you to look into the apex:dataTable and apex:column tags for this purpose. Here an short example, in this case just to display a list of contacts.
That was exactly the hint that i needed.
Thanks!