1

I made a 3 page site using visual force. In my 1st page, it has input controlling field called System Size (Product_Brief__c.System_Size_SUB_2013__c). In my second page I have input field called “Product_Brief__c.SUF_BPCs__c”. It has been link in to the same controlling field. I can not put “Product_Brief__c.SUF_BPCs__c” in second page with out above controlling field and it should be in the same page. Otherwise I will get an error. But I don’t want to have it on my second page, and is there any way I can link my controlling field in to second page or pass same value without changing this tag. Your help will be highly appreciated. Thank you.

Page 1

apex:page standardController="Product_Brief__c" sidebar="true" showChat="true" extensions="wizardExtension"> apex:pageBlockSection title="Section 6: System Configuration" ollapsible="false" columns="2"> apex:inputField value="{!Product_Brief__c.System_Size_SUB_2013__c}" />
apex:inputField value="{!Product_Brief__c.Quantity_SUB_2013__c}"/>
apex:inputField value="{!Product_Brief__c.Stainless_Steel_Type__c}"/>
apex:inputField value="{!Product_Brief__c.Electrical_Cabinet_Placement__c}"/>
apex:inputField value="{!Product_Brief__c.RTD_Connection_SUF__c}"/>
apex:inputField value="{!Product_Brief__c.Loadcell_Kits__c}"/>
apex:inputField value="{!Product_Brief__c.Display__c}"/>
apex:inputField value="{!Product_Brief__c.Cable_Management_Tree_SUF__c}"/>
apex:inputField value="!Product_Brief__c.Condenser_Vent_Filter_Heater_Bracket__c}"/>
apex:inputField value="{!Product_Brief__c.Heating_Type__c}"/>

apex:pageBlockButtons >
apex:commandButton value="Next Page" action="{!page2}"/>
apex:pageBlockButtons>

Page 2 apex:pageBlockSection title="Section 9: BPC's, collapsible="false" columns="2" > apex:inputField value="{!Product_Brief__c.System_Size_SUB_2013__c}" />
apex:inputField value="{!Product_Brief__c.SUF_BPCs__c}"/>
apex:pageBlockSection>
apex:pageBlockSection columns="1">
apex:inputField value="{!Product_Brief__c.List_BPCs_Spare_Parts_and_Quantity__c}"/>

apex:pageBlockButtons >
apex:commandButton value="Pervios Page" action="{!page1}"/>
apex:commandButton value="Next Page" action="{!page3}"/>
apex:pageBlockButtons>

1 Answer 1

0

You can add a hidden input (of the controlling field) in your second page

<apex:inputField style="display:none;" value="{!Product_Brief__c.System_Size_SUB_2013__c}"/>

<apex:inputField value="{!Product_Brief__c.SUF_BPCs__c}"/>

You can pass parameter between pages like here

in your case, it will be something like:

public Pagereference page2()
{     
     PageReference pageRef = Page.page2;
     pageRef.getParameters().put('System_Size_SUB_2013',Product_Brief__c.System_Size_SUB_2013__c);
     return PageRef
}

and in the controller of page2 just put the value of the parameter in your constructor for example

public class page2Controller
{
Product_Brief__c.SUF_BPCs__c = System.currentPagereference().getParameters().get('System_Size_SUB_2013');
}
3
  • Thanks for the answer. But when the customer select the System_Size_SUB_2013__c from the 1st page does that value pass it to second page automatically. because <apex:inputField value="{!Product_Brief__c.SUF_BPCs__c}"/> this field entirely depend on controlling field. Jun 10, 2015 at 15:22
  • you can pass parameters between page and then set the value of the controlling field (see my edited post)
    – Akram G
    Jun 10, 2015 at 15:27
  • Thank you very much. I will try that. Appreciate your time to answer my question . Jun 10, 2015 at 15:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .