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
Sudip Mondal 2001Sudip Mondal 2001 

Passing parameters from one VF page to another

Hi All,
I have a requirement where I need to send value from one VF page to another. I have digged out a few examples but none of them helped serving my needs.
Here goes the requirements in details:
I have used the <apex:repeat> tag to display the search results and whenever one of the returned result is clicked, the ID of the record should be transferred to a different visualforce page. Below is the code segment.
<apex:repeat var="u" value="{!usr}" >
						<div class="col-lg-4 col-md-4  col-xs-12  col-sm-6 resultItem" style="margin-top: 1%;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;display: inline-block;" onclick='cloneDetails("{!u.id}");'>
                           <a href="{!$Page.CloneThisUser}?Id={!u.Id}&q={!users}" class="list-group-item centerRow screenWidth" style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;width:100%;">
                           <span class="itemTitle">{!u.Name}</span><br/>
						   {!u.id}<br/>
                           {!u.UserName}<br/>
                           {!u.Profile.Name}<br/>
                           {!IF(u.UserRole.Name != '', u.UserRole.Name, '')}<br/>
                           {!u.Profile.UserLicense.Name}<br/>                  
                           {!IF(u.isActive, 'Active', 'Inactive')}
                           </a>
                       </div>
                   </apex:repeat>
I have created a JS function cloneDetails(id) that will do the sending to another page job.

The controllers of both the pages are different and merging them would be a big headache and hence we cannot take that as a solution. :(
 
Nitin SharmaNitin Sharma
Use template tag for showing one vf page to another
<apex:composition template="xyz"> where"xyz " is vf page name

Thanks,
Nitin
Sudip Mondal 2001Sudip Mondal 2001
Hello Nitin,
Thank you for your time in this. 
The <apex:composition> template tag works just like a frame in the same page. So, it can be used instead of redirecting using pagereference but how does the values get transferred from one page to another? Being a newbie, I am unable to get onto a resolution. Kindly help me with an explanation