You need to sign in to do that
Don't have an account?

controller and apex:pageBlockTable
I apologize for my English. Let me explain the problem. I want to create a controller that does not use a database and work with it using the apex: pageBlockTable. For example: There are variables:
decimal a = 10;
decimal b = 20;
decimal c = 30;
I want to make a table using the apex: pageBlockTable.:
-------------------------
|variable one | 10 |
------------------------
| variable two | 20 |
------------------------
| variable three | 30 |
------------------------
How make?
you define properties (getters) for your decimal a, b, c like this:
public class DecimalController {
public DecimalController() {
this.decimal_a = 10;
this.decimal_b = 20;
this.decimal_c = 30;
}
public Decimal decimal_a {
get ; set';
}
public Decimal decimal_b {
get; set;
}
public Decimal decima_c {
get; set;
}
}
then you access if in apex page like this:
-------------------------
|variable one | {! decimal_a} |
------------------------
| variable two | {! decimal_b} |
------------------------
| variable three | {! decimal_c} |
------------------------
<apex:page controller="DecimalController" showHeader="false" sidebar="false">
<apex:pageBlock>
<apex:pageBlockSection>
<apex:form>
<apex:pageBlockTable value="*{!DecimalController}" var="pitem">
</apex:pageBlockTable>
</apex:form>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:page>
*What to write here?
if that's the case then you could do something like this:
sample page:
corresponding controller:
tukmol, thank you very much!