apex:datatable> Datatable in Visualforce
-- Visualforce--
<apex:page controller="mydatatable">
<apex:form >
<apex:pageBlock >
<apex:dataTable value="{!data}" var="dat" cellpadding="10" cellspacing="30" >
<apex:column >
<apex:facet name="header"> Ids</apex:facet>
<apex:facet name="footer"> Ids</apex:facet>
<apex:outputText > {!dat.id}</apex:outputText>
</apex:column>
<apex:column >
<apex:facet name="header">names</apex:facet>
<apex:outputText > {!dat.name}</apex:outputText>
<apex:facet name="footer">names</apex:facet>
</apex:column>
</apex:dataTable>
</apex:pageBlock>
</apex:form>
</apex:page>
-- Controller --
public class mydatatable {
public List<Account> data { get; set; }
public List<Account> getData() {
return null;
}
public mydatatable(){
data=[select id,name from account];
system.debug(data);
}
}
<apex:page controller="mydatatable">
<apex:form >
<apex:pageBlock >
<apex:dataTable value="{!data}" var="dat" cellpadding="10" cellspacing="30" >
<apex:column >
<apex:facet name="header"> Ids</apex:facet>
<apex:facet name="footer"> Ids</apex:facet>
<apex:outputText > {!dat.id}</apex:outputText>
</apex:column>
<apex:column >
<apex:facet name="header">names</apex:facet>
<apex:outputText > {!dat.name}</apex:outputText>
<apex:facet name="footer">names</apex:facet>
</apex:column>
</apex:dataTable>
</apex:pageBlock>
</apex:form>
</apex:page>
-- Controller --
public class mydatatable {
public List<Account> data { get; set; }
public List<Account> getData() {
return null;
}
public mydatatable(){
data=[select id,name from account];
system.debug(data);
}
}
Thank You and I have a tremendous give: How To Design House Renovation home addition builders near me
ReplyDelete