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
ssssssss 

problem with dataTable in visual force page

Hi every one,

 

I am facing the problem with datatable in visual force with apex.In my application i want to display the table as three fields with coreesponding values.But here i am getting 3 tables.How to make it as single table.

 

Here my code is as follows.

 

VFPage

 

<apex:page standardController="CAF_Charge__c" extensions="popupwindow">
<apex:form >
<apex:dataTable value="{!DesCharge}" var="a" cellPadding="4" border="1" >
<apex:column headervalue="Charge header information">
<apex:commandLink action="{!filltextval1}">
<apex:param name="name1" value="{!a.Charges_Head__c}"/>
{!a.Charges_Head__c}</apex:commandLink></apex:column>
</apex:dataTable>
<apex:dataTable value="{!DesCharge}" var="a" cellPadding="4" border="1" >
<apex:column headervalue="Description of charge">
<apex:commandLink action="{!filltextval1}">
<apex:param name="name1" value="{!a.Description_Of_Charges__c}"/>
{!a.Description_Of_Charges__c}</apex:commandLink></apex:column>
</apex:dataTable>

<apex:dataTable value="{!DesCharge}" var="a" cellPadding="4" border="1">
<apex:column headervalue="Percentage">
<apex:commandLink action="{!filltextval1}">
<apex:param name="name1" value="{!a.Percentage__c}"/>
{!a.Percentage__c}</apex:commandLink></apex:column>
</apex:dataTable>

</apex:form>
</apex:page>

 

Apex Class

 

public class popupwindow
{

    public popupwindow(ApexPages.StandardController controller) {

    }
  

    Public string chargeshead{get;set;}
    Public string doc{get;set;}
    Public string percentage{get;set;}
   

   
    public List<chiranjeevi__CAF_Charge__c> getDesCharge()
    {
     List<chiranjeevi__CAF_Charge__c> descharge=[select chiranjeevi__Charges_Head__c,chiranjeevi__Description_Of_Charges__c,chiranjeevi__Percentage__c  from chiranjeevi__CAF_Charge__c  limit 10];
     return descharge;
    }


    Public void filltextval1()
    {
    chargeshead= apexpages.currentpage().getparameters().get('name1');
    }
   
   
}

 

Thanks,

Manu..

Rahul456Rahul456

Hello,

 

       You have used apex data table thrice thats the reason you are seeing 3data tables in your VF page.

 

        Use only one apex data table  and inside of it put as many apex columns as you want to see as columns in your table.

 

 

Em boss chirnajeevi fan aa..........