• kamal24
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
I have installed viewpath 4.0 project management tool and performed the necessary step. But  I am not getting project tab for the viewpath_PM 4.0.
Please help me out. Thanks in advance.
My code is:-
Controller extension:
public class wrapController {
    public String typeValue{get;set;}
    public List<SelectOption> typeOptions{get;set;}
    public List<wrapAccount> wrapaccts{get;set;}
    
    public wrapController(ApexPages.StandardController stdController){
        typeOptions = new List<SelectOption>();
        typeOptions.add(new SelectOption('None','--None--'));
        Schema.DescribeFieldResult fieldResult = Account.Type.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistvalues();
        for(Schema.PicklistEntry p : ple){
            typeOptions.add(new SelectOption(p.getvalue(), p.getvalue()));
        }
        wrapaccts=new List<wrapAccount>();
        List<Account> accList = new List<Account>([SELECT Name, Phone, AccountNumber, Type FROM Account WHERE Type = :typeValue]);
        for(Account acc :accList){
            wrapaccts.add(new wrapAccount(acc));
        }
    }
    
    public class wrapAccount{
        public Boolean checkbox{get;set;}
        public Account ac{get;set;}
        public wrapAccount(Account a){
            this.ac=a;
            checkbox=false;
        }
    }
}

Page:
<apex:page standardController="Account" extensions="wrapController" id="pg">
    <apex:form id="fm">
        <apex:pageBlock title="Account Info" id="Account_List">
            <apex:pageBlockSection title="Accounts" id="pbs">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Account Type:"/>
                    <apex:selectList value="{!typeValue}" size="1">
                        <apex:selectOptions value="{!typeOptions}"/>
                        <apex:actionSupport event="onchange" reRender="fm"/>
                    </apex:selectList>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            
            <!--Account_List-->
            <apex:pageBlockTable value="{!wrapaccts}" var="wr" id="pbt">
                <apex:column headerValue="Select" > <apex:inputCheckbox id="cb"/> </apex:column>
                <apex:column value="{!wr.ac.Name}" headerValue="Account Name"/>
                <apex:column value="{!wr.ac.Phone}" headerValue="Phone Number"/>
                <apex:column value="{!wr.ac.AccountNumber}" headerValue="Account Number"/>                
                <apex:column value="{!wr.ac.Type}" headerValue="Account Type"/>                                
            </apex:pageBlockTable>      
        </apex:pageBlock>
    </apex:form>
</apex:page>
My code is:-
Controller extension:
public class wrapController {
    public String typeValue{get;set;}
    public List<SelectOption> typeOptions{get;set;}
    public List<wrapAccount> wrapaccts{get;set;}
    
    public wrapController(ApexPages.StandardController stdController){
        typeOptions = new List<SelectOption>();
        typeOptions.add(new SelectOption('None','--None--'));
        Schema.DescribeFieldResult fieldResult = Account.Type.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistvalues();
        for(Schema.PicklistEntry p : ple){
            typeOptions.add(new SelectOption(p.getvalue(), p.getvalue()));
        }
        wrapaccts=new List<wrapAccount>();
        List<Account> accList = new List<Account>([SELECT Name, Phone, AccountNumber, Type FROM Account WHERE Type = :typeValue]);
        for(Account acc :accList){
            wrapaccts.add(new wrapAccount(acc));
        }
    }
    
    public class wrapAccount{
        public Boolean checkbox{get;set;}
        public Account ac{get;set;}
        public wrapAccount(Account a){
            this.ac=a;
            checkbox=false;
        }
    }
}

Page:
<apex:page standardController="Account" extensions="wrapController" id="pg">
    <apex:form id="fm">
        <apex:pageBlock title="Account Info" id="Account_List">
            <apex:pageBlockSection title="Accounts" id="pbs">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Account Type:"/>
                    <apex:selectList value="{!typeValue}" size="1">
                        <apex:selectOptions value="{!typeOptions}"/>
                        <apex:actionSupport event="onchange" reRender="fm"/>
                    </apex:selectList>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            
            <!--Account_List-->
            <apex:pageBlockTable value="{!wrapaccts}" var="wr" id="pbt">
                <apex:column headerValue="Select" > <apex:inputCheckbox id="cb"/> </apex:column>
                <apex:column value="{!wr.ac.Name}" headerValue="Account Name"/>
                <apex:column value="{!wr.ac.Phone}" headerValue="Phone Number"/>
                <apex:column value="{!wr.ac.AccountNumber}" headerValue="Account Number"/>                
                <apex:column value="{!wr.ac.Type}" headerValue="Account Type"/>                                
            </apex:pageBlockTable>      
        </apex:pageBlock>
    </apex:form>
</apex:page>