1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    64
    Vote Rating
    0
    Kalle1985 is on a distinguished road

      0  

    Default Problem with getting value from grid-model

    Problem with getting value from grid-model


    Hello,

    i`m wondering why my grid doesn`t display data after callback.

    I found out a problem in my column id. The model looks like:

    Code:
    @SuppressWarnings
    
    ("serial") public class GridResultModel extends BaseModel {
    public static final String TE_ID = "te-id";
    public GridResultModel() { }
    public GridResultModel(String teId) { super();
    set(TE_ID, teId); }
    public void setTeId(String teId) { set(TE_ID, teId);
    public String getTeId() { return get(TE_ID);
    }
    @BEAN(GridResultModel.class) public interface GridResultBeanModel extends BeanModelMarker { } }
    When i read the content of a selected row, i get different column ids:
    Istaead of "te-id" i get "teId"...

    Code:
    resultGrid.addListener(Events.RowClick, new Listener<GridEvent<GridResultModel>>() {
     
    
    @Override publicvoid handleEvent(GridEvent<GridResultModel> be) {
    ModelData model = (ModelData) be.getModel();
    System.out.println(model.get(GridResultModel.TE_ID)); [...]
    The output of println is always "null" !!!

    Help pls!

  2. #2
    Software Architect
    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


    Code:
    @BEAN(GridResultModel.class) 
    
    public interface GridResultBeanModel extends BeanModelMarker {  
    }
    
    }
    This is not needed if using BaseModel. Have you tried to reproduce your code in a small, standalone example implementing EntryPoint?

  3. #3
    Sencha User
    Join Date
    Jul 2009
    Posts
    64
    Vote Rating
    0
    Kalle1985 is on a distinguished road

      0  

    Default


    When i leave this part out, i get this error:

    java.lang.AssertionError: No BeanModelFactory found for class de.bitmarck.bi.hzv.tnp.client.modelData.GridResultModel

    Have you tried to reproduce your code in a small, standalone example implementing EntryPoint?
    No, i have copied and modified these parts of my project.

  4. #4
    Software Architect
    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


    Somewhere in your code you than use a BeanModelReader, which you dont need for this.

  5. #5
    Sencha User
    Join Date
    Jul 2009
    Posts
    64
    Vote Rating
    0
    Kalle1985 is on a distinguished road

      0  

    Default


    thanks a lot!

  6. #6
    Software Architect
    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


    So it is working now?

Similar Threads

  1. Problem when loading a model
    By jedihua in forum Sencha Touch 1.x: Discussion
    Replies: 4
    Last Post: 16 Oct 2010, 7:26 PM
  2. Rendering Column model Problem..
    By yagi in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 29 Sep 2010, 2:25 AM
  3. Problem With Adding children to Model
    By bsmithny in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 4 Dec 2009, 7:03 AM
  4. problem w/ grid column model widths, screenshot
    By illuminum in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 22 Jun 2008, 6:57 PM

Thread Participants: 1