• Nikita Dhamal 4
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Global objective picklist is controlling picklist, upon which some child column values are shown and the records that satisfies the column condition should be displayed and depending upon status of that values corresponding color values are assigned to that records in table.

Here is sample snapshot for User-added imagethe requirement. Please give some hint / solution how to achieve this functionality.
VVisualforcepage:
<apex:page controller="Paginationtesttrial" docType="html-5.0" sidebar="false" standardStylesheets="false">
<apex:form >
<apex:actionFunction name="landingPage" action="{!refreshPage}"/>
<html lang="en">

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta charset="utf-8"/>
<title>Metronic | Dashboard 2</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="https://c.eu6.visual.force.com/resource/1456381571000/jquery_min_js"></script>

<script>
jQuery.noConflict();
function proxyHideItem(accId){
//uncomment this to hide via jquery, currently hiding via actionFunction
//jquery selector using the class, which is accountId for each row
//jQuery("."+accId).hide();
hideItem(accId);
}
</script>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script type="text/javascript" src="https://c.eu6.visual.force.com/resource/1456381571000/jquery_min_js"></script>
<script>
jQuery.noConflict();
function proxyHideItem(accId){
//uncomment this to hide via jquery, currently hiding via actionFunction
//jquery selector using the class, which is accountId for each row
//jQuery("."+accId).hide();
hideItem(accId);
}
</script>
<script>
function SubmitFrm(){
alert('in SubmitFrm !!');
window.open('https://www.facebook.com/');
}
function show()
{
landingPage();
}
</script>
<apex:pageBlock title="Lead List" id="Details">
<apex:pageblockbuttons location="top">
<apex:commandbutton action="{!saveAccounts}" value="Save" id="saveButton" />
</apex:pageblockbuttons>
<apex:pageBlockTable value="{!accounts}" var="a" rowClasses="oddrow,evenrow" styleClass="fontfamily" id="Details1">
<apex:dataTable value="{!accountList}" var="a">
//notice how the styleClass is the accountId, to select using Jquery
<apex:column rendered="{!a.Visible}">
<apex:facet name="header"><b>Hide</b></apex:facet>
<apex:outputPanel onclick="proxyHideItem('{!acc.accId}');" >Hide</apex:outputPanel> &nbsp;&nbsp;
</apex:column>
<apex:column value="{!a.Date_Time_first_visit__c}" rendered="{!a.Visible}">
<apex:facet name="header">
<apex:commandLink action="{!ViewData}" value="Date / Time{!IF(sortExpression=='Date_Time_first_visit__c',IF(sortDirection='ASC','▼','▲'),'')}">
<apex:param value="Date_Time_first_visit__c" name="column" assignTo="{!sortExpression}" ></apex:param>
</apex:commandLink>
</apex:facet>
</apex:column>
<apex:column headerValue="Company" rendered="true">
<apex:outputField value="{!a.Lead__c}">
<apex:inlineEditSupport showOnEdit="saveButton" event="ondblclick"/>
<apex:commandLink action="{!ViewData}" value="{!IF(sortExpression=='Lead__c',IF(sortDirection='ASC','▼','▲'),'')}">
<apex:param value="Lead__c" name="column" assignTo="{!sortExpression}" ></apex:param>
</apex:commandLink>
</apex:outputField>
</apex:column>
</apex:pageBlockTable>
</apex:pageblock>
</body>
</html>
</apex:form>
</apex:page>

Controller:
public with sharing class  Paginationtesttrial {

    public String acc { get; set; }

    public PageReference search() {
        return null;
    }

    Public Integer noOfRecords{get; set;}
    Public Integer size{get;set;}
    Decimal totalcount =0;
    public decimal percentage{get;set;}
    public boolean test = false;
    Public List<Lead_Inspector__c> getLeads{get;set;}
    public Date startDate{get;set;}
    public Date endDate{get;set;}
    public string searchstring {get;set;}
    public List<SelectOption> countrieLst {get;set;}
    public String selectedCountry{get;set;}
    public String selectedValues {get;set;}
    private List<Lead_Inspector__c> accounts;
    private String sortDirection = 'ASC';
    private String sortExp = 'name';
    public Date datename{ get; set; }
    public String val1 {get; set;}
    public user currentuser{get;set;}
    
 Map<Id,AccountWrapper> accMap = new Map<Id,AccountWrapper>();

public List<AccountWrapper> getAccountList(){
    if (accMap == null || accMap.isEmpty()){
        for(Lead_Inspector__c acc : [Select Id, Name from Lead_Inspector__c LIMIT 25]){
       // System.debug('****************************888888888888888888888888888888888888888888'+a);
        
            accMap.put(acc.Id, new AccountWrapper(acc));
        } 
    }
    return accMap.Values();
}

//this method is invoked via the action function
public PageReference hideAccount (){

Id accToHide = (Id)ApexPages.currentPage().getParameters().get('accToHide');
System.debug('**************************** Hiding ' + accToHide);
if(accToHide != null)
accMap.get(accToHide).visible = false;

//here is where you can bolt on behaviour to store the Lead_Inspector__c  hide event
//either a field on Lead_Inspector__c  if hide is global for all users, or a dedicated
//hide object, if the hiding is user specific
return null;
}

public class AccountWrapper{

public Lead_Inspector__c  at {get; set;}

public Id aId {get { return at.Id ; }}

public String aName {get { return at.Name ;} }

public boolean visible { get; set; }

public AccountWrapper(Lead_Inspector__c  acc){

this.visible = true;
this.at = acc;

}
}
}
vf code:
<apex:page standardController="Lead" action="{!convertLead}" extensions="ControllerLeadConvertView"> </apex:page>
controller:
public class ControllerLeadConvertView {
  public Id leadId;
    public String convertedAccountId ;
    public ControllerLeadConvertView(ApexPages.StandardController stdController){
        leadId = ApexPages.CurrentPage().getParameters().get('id');
        
    }

     
    public PageReference convertLead(){
    try
    {
    lead leadobj=new Lead();
    leadobj = [select id,MobilePhone,Company from lead where id =:leadId];
    Account a = new Account();
    a.Name =leadobj.Company;  
    insert a;
    PageReference newocp= new PageReference('/'+ a.Id);

     newocp.setRedirect(true);

           return newocp;

     }   
               
    catch(Exception e)
    {
            System.Debug('Error - ControllerLeadConvertView.convertLead - Exception [' + e.getMessage() + ']');
            return null;
    }     
}
}

 
vf code:
<apex:page standardController="Lead" action="{!convertLead}" extensions="ControllerLeadConvertView"> </apex:page>
controller:
public class ControllerLeadConvertView {
  public Id leadId;
    public String convertedAccountId ;
    public ControllerLeadConvertView(ApexPages.StandardController stdController){
        leadId = ApexPages.CurrentPage().getParameters().get('id');
        
    }

     
    public PageReference convertLead(){
    try
    {
    lead leadobj=new Lead();
    leadobj = [select id,MobilePhone,Company from lead where id =:leadId];
    Account a = new Account();
    a.Name =leadobj.Company;  
    insert a;
    PageReference newocp= new PageReference('/'+ a.Id);

     newocp.setRedirect(true);

           return newocp;

     }   
               
    catch(Exception e)
    {
            System.Debug('Error - ControllerLeadConvertView.convertLead - Exception [' + e.getMessage() + ']');
            return null;
    }     
}
}