Hi,
I'm new to GXT and apologize in advance if my question is a repeat( I couldnt any similar questions though).
I'm trying to build a listfield of Approvers, but want to display in the format "LastName,FirstName".
Here is my Approver stub:
Code:
/** *
*/
package com.peoplenet.OrderEntry.client;
import com.extjs.gxt.ui.client.data.BaseModelData;
/**
* @author sajjan sarkar
*
*/
public class Approver extends BaseModelData{
private static final String userID = "userID";
private static final String firstName = "firstName";
private static final String lastName = "lastName";
public Approver()
{
super();
}
public int getUserID() {
return get(userID);
}
public void setUserID(int userID) {
set(Approver.userID,userID);
}
public int getFirstName() {
return get(firstName);
}
public void setFirstName(int firstName) {
set(Approver.firstName,firstName);
}
public int getLastName() {
return get(lastName);
}
public void setLastName(int lastName) {
set(Approver.lastName, lastName);
}
}
And here is my listfield code:
Code:
....
approversListField = new ListField<Approver>();
approversListField.setEmptyText("employee last name");
approversListField.setTemplate("{lastName},{firstName}");
approversListField.setDisplayField("lastName");
approversListField.setFieldLabel("Approvers *");
approversListField.setId("approvers");
approversListField.setStore(dataStores.getApprovers());
- When I remove the setTemplate call I can see the LastNames of the employees, so I do have the data.
Please let me know what I'm missing out!
Thanks a lot!
......