Wednesday 20 June 2012

How to pass 3 list values to new list?

I have three list with same size with values in it, i want to pass these three list values to new list

VFP Page


{!list1}
{!list2}
{!list3}
{!list4}


Class

public with sharing class TEZ_AC_listString{
    
    List list1 ;
    List list2 ;
    List list3 ;
    List list4 ;
    public List getList1() {
        list1 = new List();
        list1.add(string.valueof(1));
        list1.add(string.valueof(2));
        list1.add(string.valueof(3));
        list1.add(string.valueof(4));
        list1.add(string.valueof(5));
        return list1 ;
    }
    public List getList2() {
        list2 = new List();
        list2.add(string.valueof(11));
        list2.add(string.valueof(12));
        list2.add(string.valueof(13));
        list2.add(string.valueof(14));
        list2.add(string.valueof(15));
        return list2 ;
    }
    public List getList3() {
        list3 = new List();
        list3.add(string.valueof(21));
        list3.add(string.valueof(22));
        list3.add(string.valueof(23));
        list3.add(string.valueof(24));
        list3.add(string.valueof(25));
        return list3 ;
    }
    
    public List getList4() {
        list4 = new List();
        for(Integer i=0; i < list1.size() ;i++){
            String str = list1.get(i)+','+list2.get(i)+','+list3.get(i);
            list4.add(str);
        }
        return list4 ;
    }
}


Creating Tabs In VF Pages

VFP Page

<apex:page id="page" controller="TEZ_AC_pageblocktablecolumn" >
    <style>
        .activeTab 
        {
        background-color: #236FBD; color:white; 
        background-image:none
        }
        
        .inactiveTab 
        { 
        background-color: lightgrey; color:black; 
        background-image:none
        }
    </style>
    
    
    <apex:form id="frm" >
        <apex:tabPanel id="tabpanel1" switchType="client" selectedTab="name1" activeTabClass="activeTab" inactiveTabClass="inactiveTab" >
            <!-- Tab 1-->
            <apex:tab label="One" name="name1" id="tabOne">
                <apex:pageBlock id="pageblock" >
                    <apex:pageBlockTable id="pgtable" value="{!con}" var="cc" >
                        <apex:column value="{!cc.name}" />
                    </apex:pageBlockTable>
                </apex:pageBlock>
            </apex:tab>
            <!-- Tab 2-->
            <apex:tab label="Two" name="name2" id="tabTwo">
                <apex:pageBlock id="pageblock2" >
                    <apex:pageBlockTable id="pgtable" value="{!con}" var="cc" >
                        <apex:column value="{!cc.id}" />
                    </apex:pageBlockTable>
                </apex:pageBlock>
            </apex:tab>
            <!-- Tab 3-->
            <apex:tab label="Three" name="name3" id="tabThree">
                <apex:pageBlock id="pageblock3" >
                    <apex:pageBlockTable id="pgtable" value="{!con}" var="cc" >
                        <apex:column value="{!cc.name}" />
                    </apex:pageBlockTable>
                </apex:pageBlock>
            </apex:tab>
        </apex:tabPanel>
    </Apex:form>
</apex:page>

Class

public class TEZ_AC_pageblocktablecolumn{
    public list<contact> con{get;set;}
    public TEZ_AC_pageblocktablecolumn (){
        con=[select id, name from contact limit 1000];
    }
}

Wednesday 13 June 2012

OFFSET Added to SOQL

Use OFFSET to specify the starting row offset into a query’s result set. OFFSET is helpful for paging into large result sets and quickly jumping to a particular subset rows in large results. For example, the following SOQL query returns a result set that skips the first 100 rows of the full query results:

SELECT Name FROM Merchandise__c WHERE Price__c > 5.0 ORDER BY Name LIMIT 50 OFFSET 100

The resulting set of 50 records begins with the 101st record in the query result set.

Summer 12

New Release in Salesforce : Summer 12 Go through this link : http://developer.force.com/releases/release/Summer12