function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
xpatxpat 

Help for Table in apex page

Hi,
 
Can we create this in apex page?
 

 

Tasks

 

Status

 

Current year

Task 1

planned

J

F

M

A

M

J

J

A

S

O

N

D

Task 2

Failed

J

F

M

A

M

J

J

A

S

O

N

D

I tried the code below but doesn't give me what I want.

Do you have any idea on how I can achieve this?

Thanks

Pat

Code:
<apex:pageBlock title="Practice Management">
<table class ="list" border ="0" cellspacing = "0"  cellpading="0">
<tr class="hearderRow"><th scope="col" class="">Tasks</th><th scope="col" class="">Status</th><th scope="col" class="">This year</th><th scope="col" class="">Next year</th></tr>
  <tr><td scope="col">{!pr.Task_1__c}</td><td scope="col" class="">{!pr.Status__c}</td><td scope="col" class="">{!pr.month__c}</td><td scope="col" class="">{!pr.Month__c}</td><td scope="col" class="">{!pr.Month__c}</td></tr>
 <tr><td scope="col">{!pr.Task_2__c}</td><td scope="col" class="">{!pr.Status__c}</td><td scope="col" class="">{!pr.Month__c}</td></tr>

 </table>
  
   </apex:pageblock>


 

MohanaGopalMohanaGopal

Hi..

yes.. U can do this...

Code:
<apex:page standardcontroller="Account">
   <apex:pageBlock title="Practice Management">
 <table class ="list" border ="1" cellspacing = "0"  cellpading="0">
<tr class="hearderRow"><th scope="col" class="" bgcolor="#c0c0c0">Tasks</th><th scope="col" class="">Status</th><th scope="col" class="">This year</th><th scope="col" class="" colspan="2">Next year</th></tr>
  <tr><td scope="col">{!Account.Name}</td><td scope="col" class="">{!Account.Name}</td><td scope="col" class="">{!Account.Name}</td><td scope="col" class="">{!Account.Name}</td><td scope="col" class="">{!Account.Name}</td></tr>
 <tr><td scope="col">{!Account.Id}</td><td scope="col" class="">{!Account.Id}</td><td scope="col" class="">{!Account.Id}</td></tr>
 </table>
   </apex:pageblock>
</apex:page>


I think this is small question... Is this useful..?

U can easily achieve this..

If my understand is wrong let me know...

xpatxpat

Thanks for your answer, I think I didn't really explain what I wanted. Sorry.

I have an object with task and status, Month and Year. In this object I have 16 possible tasks. for each task I have a status field, a month and a year field (picklist).

I built an apex page (account plan) and I want to display on the apex page a table with:

Task + status + the list of the month jan, feb etc...

for task1 I will have: task1 - status1 - jan - feb - mar etc.... if the month for the given task is set as Jan in the object, will have a checkbox checked near Jan.

Don't know if it's clear :(

MohanaGopalMohanaGopal
Hi..
 
        Yes .. It is possible.. U can use either wrapper class or datamodel for it...
 
Wrapper class link. http://wiki.apexdevnet.com/index.php/Wrapper_Class :
 
 
Lot of posts available in forum regarding wrapperclass and datamodel...
 
I hope it will  help u...
xpatxpat
I thought Wrapper class works only for a list. In my case, I only have a custom object with picklist fields.
 
When I check the box for Jan , will select Jan value for my field... Will see if it works
 
Thanks for the direction...
MohanaGopalMohanaGopal

Hi..

       Do u have a month checkboxes in ur object.. If u have there is no need for wrapper class here...

U can set picklist value based on ur checkbox selection using setter method..

 

If u havent checkbox filed in ur object then u have to write wrapper class...