• Deepak Chouhan 9
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 1
    Replies
Hi All,

I have crate opportunity in custom VF page. I want to show all the information in somewhere into document. document page is 10. i need some suggestions of its functionality. cau you help.
I am trying to write a wrapper class for contact with pagination. when i click on checkbox. records are not selecting. can u help me out.


public List contactListWrapper{get;set;}
public Boolean allContact {get;set;}
public Pattern nonAlphanumeric = Pattern.compile('[^a-zA-Z0-9 -]');

public List getContactRecords(){
   String qryStrContact = 'Select ID,Name,Email from Contact where Email !=null AND ID NOT IN (SELECT Book_Contact__c FROM Book__c WHERE Book_Subscription_of_Contact__c=TRUE AND Book_Contact__c !=NULL ) ORDER By Name ';
  qryStrContact+= ' limit :limitSize offset :offsetSize';
contactListWrapper = new List();
List listContact = Database.Query(qryStrContact);
if(listContact.size() > 0) {
for(Contact c : listContact){
if(!nonAlphanumeric.matcher(c.Name).find())
contactListWrapper.add(new contactWrapperClass(c));
}
}else{ ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO,'No records found!')); } return contactListWrapper; }
//method for select all contact records public void selectAllContact() { if(allContact) { for(contactWrapperClass w : contactListWrapper) { w.checked = true; } } else { for(contactWrapperClass w : contactListWrapper) { w.checked = false; } } }
//----- Contact Wrapper Class public class contactWrapperClass { public Boolean checked {get;set;} public Contact con{get;set;} public contactWrapperClass(Contact con) { this.con= con; } }
Hi Friends,
I have problem in my code. i have created a pageblockTable with pagination. it's work fine.
issue is i want to update all pageblocktable active__c(checkbox) fields onchange apex:inputcheckbox.
i was trying with constructor so all active__c fields changed but pagination not working.

pls help me out....

<apex:page standardController="Contact" extensions="ExtensionEWorkbookForm">
    <apex:form id="IdFrm" >
        <apex:pageBlock id="IdPB" title="Subscription Details">  
            <!--page block button for update or cancel the records--------->
            <apex:pageBlockButtons >
                <apex:commandButton action="{!updateList}" value="Update"/>
                <apex:commandButton action="{!cancel}" value="Cancel"/>
            </apex:pageBlockButtons>
            <apex:messages />
            <apex:pageBlockSection title="Non-Subscriber Contacts" collapsible="false">
                <apex:inputcheckbox value="{!selectAllSubscribers}" label="Select All Subscribers">    
                <apex:actionSupport event="onchange" rerender="IdPBT" action="{!selectDeselectAllsubscribers}"/>    
            </apex:inputcheckbox>
            </apex:pageBlockSection>
            <!-----------------------------------Contact list record show in page block table-->
            <apex:pageblockTable id="IdPBT" value="{!contactList}" var="con">
                <apex:column >
                    <apex:facet name="header">Subscribe</apex:facet>
                    <apex:inputField value="{!con.Active__c}"/>    
                </apex:column>
                <apex:column >            
                    <apex:facet name="header">Name</apex:facet>
                    <apex:commandLink value="{!con.name}" action="{!URLFOR($Action.Contact.View,con.id)}"/>
                </apex:column>
                <apex:column >            
                    <apex:facet name="header">Mobile</apex:facet>
                    <apex:outputLabel value="{!con.mobilephone}"/>
                </apex:column>
                <apex:column >            
                    <apex:facet name="header">Email</apex:facet>
                    <apex:outputLabel value="{!con.email}"/>
                </apex:column>
                <apex:column >            
                    <apex:facet name="header">Phone</apex:facet>
                    <apex:outputLabel value="{!con.phone}"/>
                </apex:column>
                <apex:column >            
                    <apex:facet name="header">City</apex:facet>
                    <apex:outputLabel value="{!con.MailingCity}"/>
                </apex:column>
                <apex:column >            
                    <apex:facet name="header">State</apex:facet>
                    <apex:outputLabel value="{!con.MailingState}"/>
                </apex:column>                                
                <apex:column >            
                    <apex:facet name="header">Country</apex:facet>
                    <apex:outputLabel value="{!con.MailingCountry}"/>
                </apex:column>
            </apex:pageblockTable>                
        <!---------Navigation page button section------------------>
        <apex:commandButton value="First Page" rerender="IdFrm" action="{!firstPage}" disabled="{!previous}"/>
            <apex:commandButton value="Previous" rerender="IdFrm" action="{!previousPage}" disabled="{!previous}"/>
            <apex:commandButton value="Next" rerender="IdFrm" action="{!nextPage}" disabled="{!next}"/>
            <apex:commandButton value="Last Page" rerender="IdFrm" action="{!lastPage}" disabled="{!next}"/>
        </apex:pageBlock>            
    </apex:form>
</apex:page>

public with sharing class ExtensionEWorkbookForm {
    public List<Contact> contactListUpdate = new List<Contact>();
    private integer totalRecs = 0;
    private integer offsetSize = 0;
    private integer limitSize= 3;
    public Boolean selectAllSubscribers{get;set;}
    //Standard Controller Constructor
    public ExtensionEWorkbookForm (ApexPages.StandardController controller) {
        Initialization();
    }

    //Initializ data on page load
    public void Initialization(){
        totalRecs = [select count() from contact];                      
    }
    
    public List<Contact> getContactList(){
        contactListUpdate = Database.Query('Select Email,Active__c,MailingStreet,MailingCity,MailingState,MailingPostalCode,MailingCountry,MobilePhone,Name,Phone from Contact where Active__c=false limit :limitSize offset :offsetSize');
        return contactListUpdate ;
    }    
    
    public PageReference updateList() {
        PageReference pR= new PageReference('/003/o');
        if(contactListUpdate.size()>0){
            try{
                update contactListUpdate;
                return pR;
            }catch(Exception e){
               
                return null;
            }
        }else{
            return pR;
        }
    }    
    //
    public PageReference selectDeselectAllsubscribers(){    
         if(selectAllSubscribers){
             for(Contact c:contactListUpdate){
                c.Active__c=true;
             }
         }
         else{
                for(Contact c:contactListUpdate){
                c.Active__c=false;
             }
             
         }
         return null;
    }
    //Action Method for Datatabel First Page Btn  
    public void firstPage(){
        offsetSize = 0;
    }    
    
    //Action Method for Datatable Previous page Btn
    public void previousPage(){
        offsetSize = offsetSize - limitSize;
    }    
    
    //Action Method for Datatable Next Page Btn
    public void nextPage(){
        offsetSize = offsetSize + limitSize;
    }
    
    //Action Method for Datatable Last Page Btn
    public void lastPage(){
        offsetSize = totalRecs - limitSize;
    }
    
    //Property  for Datatable Previous Btn
    public boolean getprevious(){
        if(offsetSize == 0)
            return true;
        else
            return false;
    }
    
    //Property for Datatable Next Btn
    public boolean getnext(){
        if((offsetSize + limitSize) > totalRecs-1)
            return true;
        else
            return false;
    }
 
    
}






 
Hi,
i want to write a trigger for 2 objects.
object_1 contain information about male and female.
object_2 contain relevant  question for male and female.
i want to write a trigger for male profile match to female profile then shift both name into third object_3.
 
Hi,

i have created visualforce page. i am getting some user information like name,mobile, email, company etc.
i want to validation on filed with popover message on perticular field.
pls help me.
Hi All,

I have crate opportunity in custom VF page. I want to show all the information in somewhere into document. document page is 10. i need some suggestions of its functionality. cau you help.