• Enrico dev
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 7
    Replies
I m trying to access a the apex Map named  "resultsMap" with javascript, I would like to get contact last name using contact id.
public class AccessMapJS {
	public Map<ID, Contact> resultsMap{get;set;} 
	public String JsonMap{get;set;} 
	
	public AccessMapJS(){
		resultsMap = new Map<ID, Contact>([SELECT Id, LastName FROM Contact limit 3]);
		JsonMap=JSON.serialize(resultsMap); 
	}
}

VF page:
<apex:page controller="AccessMapJS" >
<script>
// Access here resultsMap: get contact last name using contact id

</script>
  {!resultsMap}
</apex:page>

Do you know hoe to accomplish that ?
Thanks in advantage for any advice.
 
This is my VF Page:
<apex:page standardcontroller="account" doctype="html-5.0">
<apex:form >
   <apex:inputfield value="{!account.Forecast_Account__c}" html-autocomplete="off"/>  
</apex:form>
</apex:page>


I would like to remove the "My recent items" tooltip for lookup field "FAccount__c" :

User-added image

I know that i can remove "Recent items" suggestions fro a specific object from Setup->Search Settings, but i would like to remove this feature only for this specific VF page.

Is there some way to accomplish this using JS or Visual force?
Following is my VF page:
<apex:page controller="ctrlInactivetest"> 
 <apex:form id="form">
        <apex:pageBlock id="block">
          <apex:pageBlockButtons id="buttons">
            <apex:actionStatus id="mySaveStatus1">
             <apex:facet name="stop">
                    <apex:commandButton value="Save" action="{!save}" rerender="pm" status="mySaveStatus1"/> 
             </apex:facet>
             <apex:facet name="start">
                 <apex:outputPanel >
                       <apex:image value="/img/loading32.gif" style="height: 15px;"/>
                       <apex:commandButton value="Processing..." status="mySaveStatus1" disabled="true"/>
                   </apex:outputPanel>
               </apex:facet>
            </apex:actionStatus>            
            </apex:pageBlockButtons>  
        </apex:pageBlock>
     </apex:form>            
</apex:page>

Controller:
public  class ctrlInactivetest {

    public ctrlInactivetest(){
    }
    public PageReference Save(){
        system.debug('RecordCreated');  
        return null;
    }
}

In order to avoid multiple records created after multiple clicks on "Save" command button, i ´ve implemented above logic.

It seems to work but in production environment i've found record duplicates created by users. Duplicated records have only 3 seconds of difference looking at records´creation date.

Is this issue related to same page delay or have i some error in the vf page?

Will be better to make inactive the button using javascript after first click?

Thanks in advantage for any advice.
Following is my code:
VF PAGE:
<apex:page standardController="account" extensions="ForecastHierarchyEditExtension" tabStyle="Account" sidebar="false"  standardStylesheets="false">                            
    <c:ForecastHierarchyEdit recordId="{!account.id}"/>  
</apex:page>

VF COMPONENT used in above page:
<apex:component Controller="ForecastHierarchyController" extensions="ForecastHierarchyEditCompExtension">
    <apex:attribute name="recordId" description="Record Id" type="id" assignTo="{!record_Id}" required="true"/>
    <apex:form >
        <apex:selectList value="{!ForecastCustomerToDelete}" multiselect="false">
            <apex:selectOptions value="{!ForecastCustomers}"/>  
        </apex:selectList>
    </apex:form>
</apex:component>

COMPONENT CUSTOM CONTROLLER:
public class ForecastHierarchyController { 

    public account acc{get;set;}
    public id record_Id;
    public id getrecord_Id(){
         return record_Id; 
    } 

    //Following is the solution for record_Id null in the constructor
    public void setrecord_Id(id s){
        if (s!=null){
          record_Id = s;
          GetData();
        }
   }


    public ForecastHierarchyController() { 
          /*Since the constructor is called before the setter
          record_Id will always be null when the constructor is called.*/                      
          system.debug('record_Id '+record_Id);      
    }

    public void GetData(){
        acc=[select Id
            from account
            where id=:record_Id];
        system.debug('Component Controller acct '+acc);
    }
}

COMPONENT EXTENSION CONTROLLER:
public class ForecastHierarchyEditCompExtension {
    public id ForecastCustomerToDelete { get; set; }
    private final ForecastHierarchyController myReference;   
    private final Account acct;


    public ForecastHierarchyEditCompExtension (ForecastHierarchyController ForecastHierarchyCtrl) {
         this.myReference = ForecastHierarchyCtrl;
          System.debug('myReference: ' + myReference);
          acct=myReference.acc;
    }   


    public List<SelectOption> ForecastCustomers{
        get {
            List<SelectOption> ForecastCustomers = new List<SelectOption>(); 
            //here acct=null
            system.debug('Component Controller Extension acct '+acct);
            if (acct!=null){
                if (acct.id!=null){             
                    for (account acc :[select id,Name from account where Forecast_Account__c=: acct.id]){
                        ForecastCustomers.add( new SelectOption( acc.id, acc.Name ) ); 
                    }        
                } 
            }     
            return ForecastCustomers;
        }
        private set;
    } 

}

User-added image

I know that we cannot access the attribute record_Id in the constructor of the VF component controller (null value) so i m setting it with
public void setrecord_Id(id s){
How can i pass record_Id to the component extension controller ? I mean to ForecastHierarchyEditCompExtension constructor.

I would like to get populate myReference.acc or myReference.record_Id so that also List ForecastCustomers will be populated.

Actually List is not populated because acct is null.

Thanks in advantage for any advice.
 
I would like to create a lookup field in a visual force page. 

User-added image
User-added image

Problem is that i don ´t have a lookup field "Customer" on my custom object to add into VF page: i don t need to store the value of this lookup but i need it just for an update operation. For example i would like to link this lookup field to an apex controller property.

Do you know how to accomplish this?

Thanks in advantage for any advice.
Following is what i´ m trying to accomplish:
User-added image

and on change picklist:
User-added image

Switching between picklist values should update the Person in the chart: I got this working with following code:

VF Component:
<apex:component Controller="ForecastHierarchyController">
    <apex:includeScript value="https://www.google.com/jsapi"/>
    <script>
        google.load('visualization', '1', {packages:['orgchart']}); 
        google.setOnLoadCallback(drawChart);

        function drawChart() {
            var data = new google.visualization.DataTable();
            data.addColumn('string', 'Name');
            data.addColumn('string', 'Parents');
            data.addColumn('string', 'Type');
            data.addRows([
                // All data rows are calculated in Apex controller
                // and returned as a string with line endings CR+LF
                {!accRows}
            ]);
			
            var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));
			

                
            chart.draw(data, {allowHtml:true,
                              size:'medium',
                              allowCollapse:true});
                       
        }
    </script>
    
    
     <apex:form >
        <apex:selectList value="{!FilterType}" multiselect="false" size="1">
              <apex:selectOption itemLabel="PersonOne" itemvalue="PersonOne"/>
               <apex:selectOption itemLabel="PersonTwo" itemvalue="PersonTwo"/>
               <apex:actionSupport event="onchange" action="{!CreateChartData}" onsubmit="drawChart();"/>
        </apex:selectList>
	 </apex:form>  

	 <apex:outputPanel id="chart">
	    <div id='chart_div'>
		</div>
     </apex:outputPanel>
</apex:component>



Controller:
public class ForecastHierarchyController { 
	private account acc;
	public String FilterType {get;set;}
	public String accRows {get;set;}
	
    public ForecastHierarchyController() {
    	FilterType='PersonOne';
    	CreateChartData();
    } 
    
    public void CreateChartData(){   	
        system.debug('####FilterType'+FilterType);    	
     	accRows= '';
     	if (FilterType=='PersonOne'){
	        accRows+=            '[{v:\''    + 'PersonOne'+ 
		                         '\', f:\''  + 'PersonOne' + 
		                         '\'},\''    + '' +
		                         '\',\''     + '' + 
		                         '\'],\r\n';	
     	}
     	else{
	        accRows+=            '[{v:\''    + 'PersonTwo'+ 
		                         '\', f:\''  + 'PersonTwo' + 
		                         '\'},\''    + '' +
		                         '\',\''     + '' + 
		                         '\'],\r\n';	     	    
     	}   		
     
     	accRows+= '[\'\',\'\',\'\']';
     	system.debug('accRows'+accRows);
    }


}

There is only one problem: on change picklist value all the page is refreshed (picklist+ chart). Instead,on change person, i would like to refresh only the chart and not the whole page.

I´ ve tried adding rerender attribute to actionSupport tag:
<apex:actionSupport event="onchange" action="{!CreateChartData}" onsubmit="drawChart();" rerender="chart" />
but it doesn´t work,on change picklist value chart isn´t showed anymore.

Do you know how can i refresh only the chart and not the whole page?

Thanks in advance for any advice.
Following is my VF page:
<apex:page standardController="Case" extensions="ctrlClaim"> 
<!--read-->
<style>
 .customPopup{
            background-color: white; 
            border-style: solid;
            border-color: #1797c0;
            border-width: 2px;
            left: 50%;
            padding:10px;
            position: absolute; 
            z-index: 9999;
            /* These are the 3 css properties you will need to tweak so the pop 
            up displays in the center of the screen. First set the width. Then set 
            margin-left to negative half of what the width is. You can also add 
            the height property for a fixed size pop up.*/
            width: 500px;
            margin-left: -250px;

}
</style>
  <apex:form >

    <apex:pageBlock title="Case Detail">

      <apex:PageMessages escape="false"/>

        <!-- Selection PopUp -->
           <apex:outputPanel id="popup">
             <apex:outputPanel styleClass="customPopup" rendered="{!displayPopUp}">
                 <apex:pageBlock > 
                    <apex:pageBlockButtons location="bottom">
                     <apex:actionRegion >
                       <apex:commandButton value="Select" action="{!closePopUp}"/>  
                       <apex:commandButton value="Cancel" action="{!closePopUpCancel}"  rerender="popup"/>   
                     </apex:actionRegion>   
                    </apex:pageBlockButtons>                
                    <apex:pageBlockSection title="Production Order Number Selection" collapsible="false" columns="3">                             

                         <apex:pageBlockSectionItem >
                            <apex:selectList value="{!ProductionOrderNumber}" multiselect="false" >
                                <apex:selectOptions value="{!ProductionOrderNumbers}"/>                          
                            </apex:selectList>
                         </apex:pageBlockSectionItem>
                         <apex:pageBlockSectionItem />
                    </apex:pageBlockSection>
                 </apex:pageBlock>  
            </apex:outputPanel>
           </apex:outputPanel>
        <!-- end PopUp -->


        <apex:pageBlockSection title="Order Information"  columns="3">    
            <apex:inputfield value="{!case.Loading_ID__c}" id="loadingID"/>       
            <apex:commandButton action="{!FindProductionOrderNumber}" image="/img/func_icons/ispan12.gif" title="Search Production Order Numbers" immediate="true" rerender="popup"/>            
        </apex:pageBlockSection>   

    </apex:pageBlock>
  </apex:form>
</apex:page>
Apex controller:
public class ctrlClaim {
    public Boolean productCase { get; set; }
    public Boolean locked { get; set; }

    private Case claim;
    private String recordType;
    private String sfdcOverride;
    public String ProductionOrderNumber { get; set; }
    public String InsertedLoadingID { get; set; }
    public List<SelectOption> ProductionOrderNumbers { get; set; }
    public boolean displayPopUp { get; set; }



    public class OrderQueryException extends Exception {}

    public ctrlClaim( ApexPages.StandardController stdCtrl ) {
        claim = ( Case ) stdCtrl.getRecord();
        recordType = ApexPages.CurrentPage().getParameters().get( 'RecordType' );
        sfdcOverride = ApexPages.CurrentPage().getParameters().get( 'sfdc.override' );
        if ( sfdcOverride == '1' && recordType != null ) claim.RecordTypeId = recordType;
        productCase = ( claim.RecordTypeId == Schema.SobjectType.Case.getRecordTypeInfosByName().get( 'Product Case' ).getRecordTypeID() );
        locked = false; 
    }


      public PageReference FindProductionOrderNumber(){
        system.debug('claim'+claim);
        system.debug('loadingID'+claim.Loading_ID__c); 
        if (claim.Loading_ID__c!=null){
                system.debug('HERE');
                if (claim.Loading_ID__c=='1')            
                    ProductionOrderNumbers.add(new SelectOption('1','1'));
                else
                    ProductionOrderNumbers.add(new SelectOption('2','2'));       
       }

        displayPopUp = true;
        return null;
      }


      public void closePopUp(){
        displayPopUp = false;
      }


      public void closePopUpCancel(){
        displayPopUp = false;
      }   

      public PageReference ClonePreparation(){
        return null;
      }

}

Problem is that ,after inserted Loading_ID__c and pressed the button,i get null value for Loading_ID__c in the controller method FindProductionOrderNumber(). Do you know why?

Thanks in advantage for any advice
This is my VF page:
<apex:page standardController="Account">
<apex:relatedList list="Contacts" />
</apex:page>
I would like to show number of records in the related list. I´ve tried, without success, with:
{!Account.Contacts.size}


How can i accomplish this?

Thanks in adavantage for any advice
This is my VF page "TestPage":

<apex:page standardController="Account">
<c:TestComponent recordId="{!account}" />
</apex:page>

Visual Force component "Test Component":
<apex:component controller="Taccount">
<apex:attribute name="recordId" description="Record Id to show field history for." type="sobject"  assignTo="{!record}" required="true"/>
<apex:relatedList list="Opportunities"/>
<apex:relatedList list="record.Opportunities"/>
</apex:component>


Problem is that  <apex:relatedList list="Opportunities"/> or   <apex:relatedList list="record.Opportunities"/> is not showed in the main page"TestPage".

Do you know how can i show, in the main page, a related list added in a component?

Thanks in advance for any advice.
 I want to implement the following setup:

public class Outer{
      public Map<string,string> PackageTransportUnitType { get; set; }
      public Outer(){
          PackageTransportUnitType=new Map<string,string>();
          Inner MyInner=new Inner();
          system.debug('My Map'+PackageTransportUnitType);
     }



                      public class Inner{
                                public Inner(){
                                 //NOT POSSIBLE TO ACCESS PackageTransportUnitType 
                                    PackageTransportUnitType.put('test','test')
                                }
                      }
}
I want to share the map "PackageTransportUnitType " between inner and outer class in this way:

-Outer: create and use map

-Inner: Fill values in the map

I' ve tried the above way but the map is not visible in the inner class. How can accomplish this?

Thanks in advantage for any advice.
I m trying to access a the apex Map named  "resultsMap" with javascript, I would like to get contact last name using contact id.
public class AccessMapJS {
	public Map<ID, Contact> resultsMap{get;set;} 
	public String JsonMap{get;set;} 
	
	public AccessMapJS(){
		resultsMap = new Map<ID, Contact>([SELECT Id, LastName FROM Contact limit 3]);
		JsonMap=JSON.serialize(resultsMap); 
	}
}

VF page:
<apex:page controller="AccessMapJS" >
<script>
// Access here resultsMap: get contact last name using contact id

</script>
  {!resultsMap}
</apex:page>

Do you know hoe to accomplish that ?
Thanks in advantage for any advice.
 
Following is my code:
VF PAGE:
<apex:page standardController="account" extensions="ForecastHierarchyEditExtension" tabStyle="Account" sidebar="false"  standardStylesheets="false">                            
    <c:ForecastHierarchyEdit recordId="{!account.id}"/>  
</apex:page>

VF COMPONENT used in above page:
<apex:component Controller="ForecastHierarchyController" extensions="ForecastHierarchyEditCompExtension">
    <apex:attribute name="recordId" description="Record Id" type="id" assignTo="{!record_Id}" required="true"/>
    <apex:form >
        <apex:selectList value="{!ForecastCustomerToDelete}" multiselect="false">
            <apex:selectOptions value="{!ForecastCustomers}"/>  
        </apex:selectList>
    </apex:form>
</apex:component>

COMPONENT CUSTOM CONTROLLER:
public class ForecastHierarchyController { 

    public account acc{get;set;}
    public id record_Id;
    public id getrecord_Id(){
         return record_Id; 
    } 

    //Following is the solution for record_Id null in the constructor
    public void setrecord_Id(id s){
        if (s!=null){
          record_Id = s;
          GetData();
        }
   }


    public ForecastHierarchyController() { 
          /*Since the constructor is called before the setter
          record_Id will always be null when the constructor is called.*/                      
          system.debug('record_Id '+record_Id);      
    }

    public void GetData(){
        acc=[select Id
            from account
            where id=:record_Id];
        system.debug('Component Controller acct '+acc);
    }
}

COMPONENT EXTENSION CONTROLLER:
public class ForecastHierarchyEditCompExtension {
    public id ForecastCustomerToDelete { get; set; }
    private final ForecastHierarchyController myReference;   
    private final Account acct;


    public ForecastHierarchyEditCompExtension (ForecastHierarchyController ForecastHierarchyCtrl) {
         this.myReference = ForecastHierarchyCtrl;
          System.debug('myReference: ' + myReference);
          acct=myReference.acc;
    }   


    public List<SelectOption> ForecastCustomers{
        get {
            List<SelectOption> ForecastCustomers = new List<SelectOption>(); 
            //here acct=null
            system.debug('Component Controller Extension acct '+acct);
            if (acct!=null){
                if (acct.id!=null){             
                    for (account acc :[select id,Name from account where Forecast_Account__c=: acct.id]){
                        ForecastCustomers.add( new SelectOption( acc.id, acc.Name ) ); 
                    }        
                } 
            }     
            return ForecastCustomers;
        }
        private set;
    } 

}

User-added image

I know that we cannot access the attribute record_Id in the constructor of the VF component controller (null value) so i m setting it with
public void setrecord_Id(id s){
How can i pass record_Id to the component extension controller ? I mean to ForecastHierarchyEditCompExtension constructor.

I would like to get populate myReference.acc or myReference.record_Id so that also List ForecastCustomers will be populated.

Actually List is not populated because acct is null.

Thanks in advantage for any advice.
 
Following is what i´ m trying to accomplish:
User-added image

and on change picklist:
User-added image

Switching between picklist values should update the Person in the chart: I got this working with following code:

VF Component:
<apex:component Controller="ForecastHierarchyController">
    <apex:includeScript value="https://www.google.com/jsapi"/>
    <script>
        google.load('visualization', '1', {packages:['orgchart']}); 
        google.setOnLoadCallback(drawChart);

        function drawChart() {
            var data = new google.visualization.DataTable();
            data.addColumn('string', 'Name');
            data.addColumn('string', 'Parents');
            data.addColumn('string', 'Type');
            data.addRows([
                // All data rows are calculated in Apex controller
                // and returned as a string with line endings CR+LF
                {!accRows}
            ]);
			
            var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));
			

                
            chart.draw(data, {allowHtml:true,
                              size:'medium',
                              allowCollapse:true});
                       
        }
    </script>
    
    
     <apex:form >
        <apex:selectList value="{!FilterType}" multiselect="false" size="1">
              <apex:selectOption itemLabel="PersonOne" itemvalue="PersonOne"/>
               <apex:selectOption itemLabel="PersonTwo" itemvalue="PersonTwo"/>
               <apex:actionSupport event="onchange" action="{!CreateChartData}" onsubmit="drawChart();"/>
        </apex:selectList>
	 </apex:form>  

	 <apex:outputPanel id="chart">
	    <div id='chart_div'>
		</div>
     </apex:outputPanel>
</apex:component>



Controller:
public class ForecastHierarchyController { 
	private account acc;
	public String FilterType {get;set;}
	public String accRows {get;set;}
	
    public ForecastHierarchyController() {
    	FilterType='PersonOne';
    	CreateChartData();
    } 
    
    public void CreateChartData(){   	
        system.debug('####FilterType'+FilterType);    	
     	accRows= '';
     	if (FilterType=='PersonOne'){
	        accRows+=            '[{v:\''    + 'PersonOne'+ 
		                         '\', f:\''  + 'PersonOne' + 
		                         '\'},\''    + '' +
		                         '\',\''     + '' + 
		                         '\'],\r\n';	
     	}
     	else{
	        accRows+=            '[{v:\''    + 'PersonTwo'+ 
		                         '\', f:\''  + 'PersonTwo' + 
		                         '\'},\''    + '' +
		                         '\',\''     + '' + 
		                         '\'],\r\n';	     	    
     	}   		
     
     	accRows+= '[\'\',\'\',\'\']';
     	system.debug('accRows'+accRows);
    }


}

There is only one problem: on change picklist value all the page is refreshed (picklist+ chart). Instead,on change person, i would like to refresh only the chart and not the whole page.

I´ ve tried adding rerender attribute to actionSupport tag:
<apex:actionSupport event="onchange" action="{!CreateChartData}" onsubmit="drawChart();" rerender="chart" />
but it doesn´t work,on change picklist value chart isn´t showed anymore.

Do you know how can i refresh only the chart and not the whole page?

Thanks in advance for any advice.
Following is my VF page:
<apex:page standardController="Case" extensions="ctrlClaim"> 
<!--read-->
<style>
 .customPopup{
            background-color: white; 
            border-style: solid;
            border-color: #1797c0;
            border-width: 2px;
            left: 50%;
            padding:10px;
            position: absolute; 
            z-index: 9999;
            /* These are the 3 css properties you will need to tweak so the pop 
            up displays in the center of the screen. First set the width. Then set 
            margin-left to negative half of what the width is. You can also add 
            the height property for a fixed size pop up.*/
            width: 500px;
            margin-left: -250px;

}
</style>
  <apex:form >

    <apex:pageBlock title="Case Detail">

      <apex:PageMessages escape="false"/>

        <!-- Selection PopUp -->
           <apex:outputPanel id="popup">
             <apex:outputPanel styleClass="customPopup" rendered="{!displayPopUp}">
                 <apex:pageBlock > 
                    <apex:pageBlockButtons location="bottom">
                     <apex:actionRegion >
                       <apex:commandButton value="Select" action="{!closePopUp}"/>  
                       <apex:commandButton value="Cancel" action="{!closePopUpCancel}"  rerender="popup"/>   
                     </apex:actionRegion>   
                    </apex:pageBlockButtons>                
                    <apex:pageBlockSection title="Production Order Number Selection" collapsible="false" columns="3">                             

                         <apex:pageBlockSectionItem >
                            <apex:selectList value="{!ProductionOrderNumber}" multiselect="false" >
                                <apex:selectOptions value="{!ProductionOrderNumbers}"/>                          
                            </apex:selectList>
                         </apex:pageBlockSectionItem>
                         <apex:pageBlockSectionItem />
                    </apex:pageBlockSection>
                 </apex:pageBlock>  
            </apex:outputPanel>
           </apex:outputPanel>
        <!-- end PopUp -->


        <apex:pageBlockSection title="Order Information"  columns="3">    
            <apex:inputfield value="{!case.Loading_ID__c}" id="loadingID"/>       
            <apex:commandButton action="{!FindProductionOrderNumber}" image="/img/func_icons/ispan12.gif" title="Search Production Order Numbers" immediate="true" rerender="popup"/>            
        </apex:pageBlockSection>   

    </apex:pageBlock>
  </apex:form>
</apex:page>
Apex controller:
public class ctrlClaim {
    public Boolean productCase { get; set; }
    public Boolean locked { get; set; }

    private Case claim;
    private String recordType;
    private String sfdcOverride;
    public String ProductionOrderNumber { get; set; }
    public String InsertedLoadingID { get; set; }
    public List<SelectOption> ProductionOrderNumbers { get; set; }
    public boolean displayPopUp { get; set; }



    public class OrderQueryException extends Exception {}

    public ctrlClaim( ApexPages.StandardController stdCtrl ) {
        claim = ( Case ) stdCtrl.getRecord();
        recordType = ApexPages.CurrentPage().getParameters().get( 'RecordType' );
        sfdcOverride = ApexPages.CurrentPage().getParameters().get( 'sfdc.override' );
        if ( sfdcOverride == '1' && recordType != null ) claim.RecordTypeId = recordType;
        productCase = ( claim.RecordTypeId == Schema.SobjectType.Case.getRecordTypeInfosByName().get( 'Product Case' ).getRecordTypeID() );
        locked = false; 
    }


      public PageReference FindProductionOrderNumber(){
        system.debug('claim'+claim);
        system.debug('loadingID'+claim.Loading_ID__c); 
        if (claim.Loading_ID__c!=null){
                system.debug('HERE');
                if (claim.Loading_ID__c=='1')            
                    ProductionOrderNumbers.add(new SelectOption('1','1'));
                else
                    ProductionOrderNumbers.add(new SelectOption('2','2'));       
       }

        displayPopUp = true;
        return null;
      }


      public void closePopUp(){
        displayPopUp = false;
      }


      public void closePopUpCancel(){
        displayPopUp = false;
      }   

      public PageReference ClonePreparation(){
        return null;
      }

}

Problem is that ,after inserted Loading_ID__c and pressed the button,i get null value for Loading_ID__c in the controller method FindProductionOrderNumber(). Do you know why?

Thanks in advantage for any advice
This is my VF page:
<apex:page standardController="Account">
<apex:relatedList list="Contacts" />
</apex:page>
I would like to show number of records in the related list. I´ve tried, without success, with:
{!Account.Contacts.size}


How can i accomplish this?

Thanks in adavantage for any advice