You need to sign in to do that
Don't have an account?
davidjbb
Get InputField and Apex Class
Hi Community,
I'm looking to get a Apex Input Field on a VF page called, ex Page1
<apex:inputFieldid="fromDate"value="{!Workorder__c.Start_Date__c}"required="true"/>
and use it for whatever I want in an Apex Class then output that Input field on Page 2
I'm not sure how to setup the Apex Class to grab the Input Field from Page one, manipulate the Input Field in the Apex Class, and then Display it on Page 2
All Answers
Use the same Controller and Extensions in both pages, and your data will automatically transport itself between pages when you use a PageReference. Check the manual for details.
Edit:
Example!
Hi Sfdcfox,
Thanks for your quick reply.
What if I want to store the Input Field in page1 in a variable that is declared in the Controller then print that variable (the controller variable) into another visualforce page.
Just use the same Controller for both pages, and the value will automatically transfer over. It's the same as I demonstrated, but the variable is held in the controller instead of a record.
Sorry, but i'm a bit new in development, do you mind providing example.
I think I got you confused.
in the first page i want myobj_value
and in the second page i want myValue