Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGrid getField returns null

    Hi,

    using SmartGWT EE 2.3 in FF, when i try to access a listGridField through getField() i get null pointer error. Any idea ?

    Code:
    ListGrid myLG = new ListGrid();
    myLG.setDataSource(DataSource.get("DataSource_Template"));
    myLG.setAutoFetchData(true);
    myLG.getField(1).getTitle();

    #2
    I don't believe you can access the fields of the LG until it is drawn. The fields are built lazily.

    Comment


      #3
      ok but if i check for myLG.isCreated then it returns true.

      Comment


        #4
        you are right. after calling draw() on the listGrid first, it works.
        Thanks.

        Comment


          #5
          There's also an method called "isDrawn()" where you can check the drawn-state of your element..

          Comment

          Working...
          X