1. #1
    Ext User
    Join Date
    Jan 2009
    Posts
    6
    Vote Rating
    0
    surendra is on a distinguished road

      0  

    Default ListView Item text not displayed

    ListView Item text not displayed


    Help me, ListView not displaying the item text. It displays blank item. Following is the code

    ContentPanel listPanel = new ContentPanel();

    listPanel.add(getEntityListView());

    private ListView<EntityBeanModel> getEntityListView(){
    if(entityListView == null){
    entityListView = new ListView<EntityBeanModel>();
    entityListView.setDisplayProperty("name");
    entityListView.setSimpleTemplate("{name}");
    entityListView.setStore(getEntitiesStore());
    }
    return entityListView;
    }

    private ListStore<EntityBeanModel> getEntitiesStore(){
    if(entitiesStore == null){
    entitiesStore = new ListStore<EntityBeanModel>();
    entitiesStore.add(new EntityBeanModel("Entity 1"));
    entitiesStore.add(new EntityBeanModel("Entity 2"));
    entitiesStore.add(new EntityBeanModel("Entity 3"));
    }
    return entitiesStore;
    }



    public class EntityBeanModel extends BeanModel{

    private String name;

    public EntityBeanModel(String name){
    this.name = name;
    }

    public String getName(){
    return name;
    }

    public void setName(String name){
    this.name = name;
    }
    public String toString(){
    return name;
    }

    }

  2. #2
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Your BeanModel is incorrect. You need to use BeanModelTag for example http://www.sencha.com/blog/2008/07/1...-with-ext-gwt/

    Where did you find this code?

Similar Threads

  1. ListView.select doesn't work before ListView is displayed for the first time
    By Erich Kitzmueller in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 21 Apr 2010, 12:59 PM
  2. ListView items are not displayed
    By Kalle1985 in forum Ext GWT: Discussion
    Replies: 7
    Last Post: 29 Mar 2010, 6:19 AM
  3. How to add an item to a Listview?
    By poyo in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 4 Sep 2009, 11:05 PM
  4. how can I add checkbox in ListView's each item?
    By zzsnake in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 6 Aug 2009, 6:19 AM

Thread Participants: 1

Tags for this Thread