+ Start a Discussion

Unable to load data from custom object into "apex:inputText" field


I need help with an issue I am having with my VisualForce page.  When I display the Title as an inputText I am unable to get the data to refresh from the apex code.  The outputText works and changes when the data on the server side changes but for some reason the data in the inputText will not change.  Any and all help in this matter is appreciated.


Here is the VisualForce code:

<apex:outputText value="{!SELEMP.firstName}" />
<apex:outputText value="{!SELEMP.lastName}" />
<apex:inputText id="titleId" value="{!SELEMP.title}" />

Here is the apex code:

myEmployee = [SELECT e.id, e.Last_Name__c, e.First_Name__c,
e.Title__c, e.UP_Contact_Number__c,
e.Responsibility_Center__c FROM Employee__c e where Id =:theEmp Limit 1];
selemp = new objEmployee(
myEmployee.id, '', myEmployee.First_Name__c, myEmployee.Last_Name__c, myEmployee.Title__c,
myEmployee.UP_Contact_Number__c, myEmployee.Responsibility_Center__c,'','',
'', false);





that could be something behind the objEmployee class... but I can only guess... unless you post the code...

Which code would you like me to post?

Here is the code for the objEmployee:


public class objEmployee
public string employeeId {get; set;}
public string name {get; set;}
public string firstName {get; set;}
public string lastName {get; set;}
public string title {get; set;}
public string phone {get; set;}
public string responsibilityCenter {get; set;}
public string userInfo {get; set;}
public string responsibilitycenterName {get; set;}
public string indexValue {get; set;}
public Boolean duptsMember {get; set;}
public objEmployee(string employeeId, string name, string firstName, string lastName,
string title, string phone, string responsibilityCenter, string userInfo,
string responsibilitycenterName, string indexValue, Boolean duptsMember)
this.employeeId = employeeId;
this.name = name;
this.firstName = firstName;
this.lastName = lastName;
this.title = title;
this.phone = phone;
this.responsibilityCenter = responsibilityCenter;
this.userInfo = userInfo;
this.responsibilitycenterName = responsibilitycenterName;
this.indexValue = indexValue;
this.duptsMember = duptsMember;


the objEmployee looks fine.


how do you refresh the VF page to reflect the changes?


based on your code, title is an inputText. chances are it's getting posted back to SELEMP.



I am refereshing on the change event of a dropdown list :

<apex:selectList id="TheDpi" multiselect="false" onchange="doMore(this);" value="{!Utility_Permit__c.District_Permit_Inspector__c}" size="1" label="District Permit Inspector :" >
<apex:selectOptions value="{!DPI}" id="emp" ></apex:selectOptions>

Here is the code for the doMore function:

function doMore(sel)

Here is the code with the myFunc:

<apex:actionFunction name="myFunc" reRender="Panel, pbsNotification,titleId" action="{!getEmployee}" status="status" immediate="true">
<apex:param name="empInfo" assignTo="{!theEmp}" value=""/>


Please let me know if you need anything more.