You need to sign in to do that
Don't have an account?
DennoP
How can I pass a inputfield value into a controller variable and query.
I am trying to use the code below to assign the value from an
inputfield into a variable within my controller to then use that value
in a query. Please could someone tell me what I need to enter to
assign that data
Page
<apex:inputField value="{!emp2.Paynumber__c}" id="PaySearch" /> <p/>
Controller
public class EmployeeList {
String PayN = '15154';
public PageReference update1() {
PayN = {!$component.PaySearch);
return null;
}
Page
<apex:inputField value="{!emp2.Paynumber__c}" id="PaySearch" /> <p/>
Controller
public class EmployeeList {
String PayN = '15154';
public PageReference update1() {
PayN = {!$component.PaySearch);
return null;
}
So when you click on the command button the first thing it does is call the emp2 setter, which will update all of the fields (in this case, just paynumber__c) on that object. Then your action method gets called, and you can just access the field directly off of the emp2 object.