function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ali AbdullatifAli Abdullatif 

How to pass values between two pages? (I'm new)

I have a page that searches an object for names and shows a list that has been made according to this tutorial http://blog.jeffdouglas.com/2010/04/07/easily-search-and-edit-records-with-visualforce/
I've added a button column to the resulting list and I want that button to redirect me to another page where I can edit the selected result 
I've searched but I can only find redirection via adding the &id= to the url but the problem is that the second page uses a custom controller which appearently can't use the &id= refferal 
thank you very much

All Answers

Ali AbdullatifAli Abdullatif

I found this way useful http://www.forcetree.com/2009/06/passing-parameters-to-visualforce-page.html 
and now I have a string that has the wanted id inside of it
Public string messageofid = System.currentPagereference().getParameters().get('msg');

but now I want to use this id in my second page to show fields of this id like name and phone
it doesn't seem to work
public class Ticket_Form_class {
    
    Public string messageofid = System.currentPagereference().getParameters().get('msg');
    public Dh__c dhinfo {get;set;}
	public Vp__c vpinfo {get;set;}
   
    
    public Ticket_Form_class(){
          dhinfo = new Dh__c();
          vpinfo = new Vp__c();
		  
          messageofid = dhinfo.Id;
          dhinfo = Ticket_Form_class.getRecord();
             }
     
}
 
<apex:page Controller="Ticket_Form_class" sidebar="false" showheader="false">
<apex:form >
<apex:pageBlock title="Ticket Form">
            <apex:pageBlockSection columns="2">
     			
     			<center><apex:outputText value="{0,date,dd/MM/yyyy}">Form Date: <apex:param value="{!NOW()}" /></apex:outputText></center>

                <apex:inputField value="{!dhinfo.name}" Label="Full Name"/>

               	<apex:inputField value="{!dhinfo.Phone_Number__c}" Label="Mobile Phone"/> 

<apex:inputField value="{!dhinfo.Location2__c}" Label="Location"/>
</apex:pageBlock>
    
        
        
        
        </apex:form>

</apex:page>