+ Start a Discussion
ssssssss 

How to get values from one page to another page

Hi Everyone,

 

I want to populate the data table record value to inputtext field.it means dataTable is one page and input text field in another page.

 

Plz tell me the way through which concept we can achieve this.

 

Thanks ,

Manu..

DodiDodi

All fields in SFDC have an id associated with it. To pass values to the new page, you must identify the field id int he page you are going to.

 

Try going to the page and search on the field label name, next to it should be the 18 char sfdc id for the field. Apply this in the url request and the fields will be populated.

 

Thanks

 

Fahd

rubixtiousrubixtious

If you are using VF pages then you can use the same controller/controller extension across pages. 

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_wizard.htm

ssssssss

Thanks for ur reply,

 

In my appliction one object is having 3 fields.i.e CAF charge is having Charges Head,Description of charges,Percentage.

and beside charges head one Search link is there.when i click on search link it dispalys a new window with all these three field values as records in table.

 

My problem when we click on record value its automatically populate that value in coresponding filed.i was unable to do this.

 

Plz help me with code.

 

My code is as follows:

 

VF parent window:

 

m_parent_caf

 

<apex:page standardController="CAF_Charge__c" extensions="popupwindow">
<h1> CAF Charge Detail </h1>
<apex:form >
<table>
 <tr>
  <td>
    <apex:outputText value="Charges Head"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <apex:inputtext value="{!chargeshead}"/>
    <apex:commandLink value="search" onclick="popup('/apex/m_child_caf')"/><br/>
  </td>
 </tr>
 <tr>
  <td>
    <apex:outputText value="Description Of Charges"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <apex:inputtext value="{!doc}"/>
  </td>
 </tr>
 <tr>
  <td>
    <apex:outputText value="Percentage"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <apex:inputtext value="{!percentage}"/>  
  </td>
 </tr>
<tr>
   <td>
    <apex:commandButton action="{!save}" value="Save"  />
    <apex:commandButton value="New"  />
   </td>
</tr> 
</table>


<script>
function popup(url)
{
    newwindow=window.open(url,'name','width=400,height=400,top=0,toolbar=no,personalbar=no,location=no,directories=no,statusbar=no,menubar=no,status=no,re sizable=yes,left=60,screenX=60,top=100,screenY=100');
    if (window.focus)
    {
     newwindow.focus()
    }
}
</script>

</apex:form>
</apex:page>

 

m_child_caf

 

<apex:page standardController="CAF_Charge__c" extensions="popupwindow">
<apex:form >
<apex:dataTable value="{!DesCharge}" var="a" cellPadding="4" border="1" >

<apex:column headervalue="Charge header information">
<apex:commandLink action="{!filltextval1}">
<apex:param name="name1" value="{!a.Charges_Head__c}"/>
{!a.Charges_Head__c}</apex:commandLink></apex:column>

<apex:column headervalue="Description of charge">
<apex:commandLink action="{!filltextval1}">
<apex:param name="name1" value="{!a.Description_Of_Charges__c}"/>
{!a.Description_Of_Charges__c}</apex:commandLink></apex:column>

<apex:column headervalue="Percentage">
<apex:commandLink action="{!filltextval1}">
<apex:param name="name1" value="{!a.Percentage__c}"/>
{!a.Percentage__c}</apex:commandLink></apex:column>

</apex:dataTable>

</apex:form>
</apex:page>

 

Controller:

 

public class popupwindow
{

    public popupwindow(ApexPages.StandardController controller) {

    }
  
    Public string chargeshead{get;set;}
    Public string doc{get;set;}
    Public string percentage{get;set;}
      
    public List<chiranjeevi__CAF_Charge__c> getDesCharge()
    {
     List<chiranjeevi__CAF_Charge__c> descharge=[select chiranjeevi__Charges_Head__c,chiranjeevi__Description_Of_Charges__c,chiranjeevi__Percentage__c  from chiranjeevi__CAF_Charge__c  limit 10];
     return descharge;
    }

    Public void filltextval1()
    {
    chargeshead= apexpages.currentpage().getparameters().get('name1');
    }
   
   
}

 

Plz help me.

 

Thanks,

manu..