I called the value of the field with this code

          <apex:column headerValue="Teacher"  id="tname"   value=" {!schedule.tlname}, {!schedule.tfname}" />

now how can I get the value of that field using the id "tname" in the controller. Thanks in advance

  • 1
    You want to get value in page or in controller ? Feb 12 '16 at 7:46
  • @ashishcloud i need to use the value of that field in the controller Feb 12 '16 at 7:46
  • What is the type of the field? are you changing this field value from page? Feb 12 '16 at 7:47
  • @ashishcloud the field is textfield. its values came from 2 different fields in salesforce. Feb 12 '16 at 7:48
  • Well in this case, when you submit your values to your class ,you will get updated value in the same field, tname. do you want to know how to send the updated value? Feb 12 '16 at 7:50

Best way by using Wrapper class we can hold the updated field values in controller.


public list<wrapSchedule> lstSchedule  {get;set;}

public classController(){
   // collect the Schedule object records in lstSchedule
   // lstSchedule.add(new wrapSchedule(Schedule record));

public class wrapSchedule{
    public schedule objSch {get;set;}
    public String strTName {get;set;}

    public wrapSchedule(schedule  objSched){
       this.objSch = objSched;
       this.strTName = objSched.tlname+','+schedule.tfname;


VF Page
<apex:column headerValue="Teacher"  id="tname"   value=" {!schedule.strTName}" />

Try this, let me know if this helps for you


You need to bind VisualForce and Controller.

< apex:column headerValue="Teacher" id="tname" value=" {!schedule.fullName}" />

Here schedule is var of apex:pageBlockTable.

In controller you create a field as below: public String fullName {get; set;}

This way field "fullName" map with VF page and Controller. This helps you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.