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
deepu.sandeepdeepu.sandeep 

Table with 4 rows and 3 columns

Hi There,

                  How can i display a table with 4 columns and 3 empty rows in a vf view page.

Anyone sugggest me how can i do that.

Navatar_DbSupNavatar_DbSup

Hi,

There is a row and column attribute in pageBlockTable we can specify the number of rows and columns want to display on a vf page.

 

Try the below code snippet as reference:

 

------ vf page----------

 

<apex:page controller="clscontact" >

  <apex:pageBlock >

      <apex:pageBlockTable value="{!con}" rows="3" columns="4" var="cc">

      <apex:column style="width:20px;"  ><apex:facet name="header">Name</apex:facet> {!cc.name}</apex:column>

        <Apex:column style="width:50px;"  ><apex:facet name="header">Email</apex:facet> {!cc.email}</apex:column>

          <Apex:column ><apex:facet name="header">Phone</apex:facet> {!cc.phone}</apex:column>

              <Apex:column ><apex:facet name="header">Account </apex:facet> {!cc.account.name}</apex:column>

      </apex:pageBlockTable>

 

  </apex:pageBlock>

</apex:page>

 

------------- Apex controller ----------

 

public class clscontact

{

public list<contact>con{get;set;}

public clscontact()

{

    con=[select name,email,phone,account.name from contact];

}

 

 

}

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

deepu.sandeepdeepu.sandeep

Hi,

     Actually this is my apex code i tried what ever u ha said but i am getinhg this error

 

Error: input1 Compile Error: Identifier name is reserved: end at line 3 column 36

 

public class input1 {
 public Endeavor_Reg_Form__c e{get; set;}
 public list<Endeavor_Reg_Form__C> end{get;set;}
  public input1()
  {
    end=[select College_University__c,Year_Granted__c,Degree_Granted__c,Major__c from Endeavor_Reg_Form__c];
    id id1 =  ApexPages.currentpage().getParameters().get('id');  
    if(id1<>null)
     {  
       e=[select id,name,city__c,Annual_budget_in_your_control_in_usd__c,Cell_Phone__c,College_University__c,Company__c,
            Company_Organization__c,Country__c,Country_of_Citizenship__c,Date_of_Birth__c,Degree_Granted__c,
            Email__c,Emergency_Contact_Name__c,Emergency_Contact_Phone__c,Emergency_Contact_Relationship__c,End_Date__c,
            Gender__c,Home_Address__c,Home_Address_Line_2__c,Home_Phone__c,Industry__c,Job_Title_at_Current_Employer_if_applic__c,
            Job_title_of_person_to_whom_you_report__c,Last_Family_Name__c,List_of_Language_s_in_which_you_are_flu__c,
            Major__c,Middle_Initial__c,Name_for_Identification_Badge__c,Number_of_people_you_manage_directly__c,
            Objectives__c,  Position__c,Responsibilities__c,Salutation__c,StartDate__c,Start_Date__c,State_Province_non_US__c,
            State_US__c,Year_Granted__c,Zip_Postal_Code__c from Endeavor_Reg_Form__c where id=:id1];
    
     }
    else
     {   
       e = new Endeavor_Reg_Form__c();    
     }
  }

 public pagereference save()
  {
   insert e;
   
   return new Apexpages.standardcontroller(e).view();

  }
 public pagereference edit()
  {
   update e;
   return new Apexpages.standardcontroller(e).edit();
  }
 
}

 

 

solve this issue and reply me

 

Navatar_DbSupNavatar_DbSup

Hi,

 

End is a reserve keyword in salesforce changes your list name from end to other (which is not a keyword).

 

More about reserve keyword follow the below link:

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_reserved_words.htm

 

 

deepu.sandeepdeepu.sandeep

Hi Navatar,

                    K its resolved i am getting rows but i am unable to enter a value on that rows how can i enter a value in row

Abhay AroraAbhay Arora

You have to use the Wrapper class for this

 

http://wiki.developerforce.com/page/Wrapper_Class

 

Use a wrapper class to get user input and then use the list of wrapper class to create instance of sObject and insert it

Ayesha MAyesha M
Hi All
want to generate pdf file in below format.Please can some one help me.I need to display all account records in org in below format.
Test 1Test 2Test 3
Address1:Address:Address:Test 
  • A
  • B
Location:Location:Location:Test
Location1:Location1:Location1:Test
Location2:Location2:Location2:Test
Location3:Location3:Location3: 
Location4:Location4:Location4: 
Address:Address:  
 SummaryText
NameText
Due DateText
StatusText
Next DateText