You need to sign in to do that
Don't have an account?
VRK
how to pass values from one VF page to another VF page
Hi all,
Scenaio : How to pass values from one VF page to another VF page.
I have 2 VF pages. emp VF page and DetailVFpage
i have values firstname, lastname,email, phone in empVFPage and need to pass values to DetailVFpage.
PageReference pageRef= new PageReference('/apex/DetailVFpage');
i can able to naviage to 2nd VF page(DetailVFPage) after click on link in empVFPage....But values are not passing
when click on Verification page link, i can able to see Detail VF page..But the values not passing ..
see screenshot the Result page not showing values of VF page firstname, lastname....
Anyone have idea on htis
Scenaio : How to pass values from one VF page to another VF page.
I have 2 VF pages. emp VF page and DetailVFpage
i have values firstname, lastname,email, phone in empVFPage and need to pass values to DetailVFpage.
PageReference pageRef= new PageReference('/apex/DetailVFpage');
i can able to naviage to 2nd VF page(DetailVFPage) after click on link in empVFPage....But values are not passing
when click on Verification page link, i can able to see Detail VF page..But the values not passing ..
see screenshot the Result page not showing values of VF page firstname, lastname....
Anyone have idea on htis
There are multiple ways to pass value from one page to another.
- User same controller in both the VF page so that data is accessible on both.
- Pass values in URL parameter.
Below link will help you on URL parameter passing:https://salesforce.stackexchange.com/questions/87704/passing-visualforce-value-to-another-visualforce
You can use this to put all values in a pageReference object.
pageReference.put(key',value);
and on the detail page, you can get them in constructor As
ApexPages.currentPage().getParameters().get('key');
You can put multiple parameters with a unique key and get them.
Also, you can use the same controller with getter and setter method.
Thanks,
Arpit vijayvergiya
thanks for your quick replay.. but its not suitable for my requirement
Scenaio : How to pass values from one VF page to another VF page.
i have 2 VF pages searchPage and Detail Page.
in search Page i can able to display results...But in Detail page i am unable to popullate same values....can you please help on this.
SearchPage code :
------------------------------------
<apex:pageBlockTable value="{!results}" var="c" rendered="{!NOT(ISNULL(results))}">
<apex:column value="{!c.FirstName}" id="fname"/>
<apex:column value="{!c.LastName}" />
</apex:pageBlockTable>.
Detail Page Code :
--------------------------------
<table>
<tr>
<th><font size="2" >First Name</font></th><td><span style="margin-left:150px"> </span></td>
<th><apex:outputText value=" {!FirstName} "/></th><td><span style="margin-left:150px"> </span></td>
</table>
Controller same for both VF pages:
-----------------------------------------------------
public String FirstName{get;set;}
public PageReference search() {
results= (List<Contact>)[FIND :searchText RETURNING Contact(id,name,email,FirstName,LastNamePhone,Birthdate)][0];
}
I can able to display firstname, last name in SearchPage , but i am unable to display same value for first name and last name in Detail page....
could you please check on this