Announcement

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

    Retrieve value of listGridField from selected record

    I am using a databound listGrid in SGWTEE. I would like to retrieve the value of a field in the currently selected record in a listgrid so that I can assign it to the foreign key of a related record I am adding. I am having trouble figuring out the best way to do this as I am not finding a getFieldValue or the like in the ListGrid javadoc. What is the best way to do this. An example or a pointer where to look would be much appreciated.

    Thank you.

    #2
    Code:
    ListGrid.getSelectedRecord().getAttribute("myFieldName");
    Use getAttribute*() and the names of the fields. See the Javadocs since there are all sorts of getAttributeAs* functions, the example will return the value as a string.

    Comment


      #3
      Thank you svjard. . . that helps enormously.

      Comment


        #4
        See the Javadocs since there are all sorts of getAttributeAs* functions, the example will return the value as a string.
        Hi Svjard, I'm having difficulty finding where in the javadocs to find this info. . Could you point me in the right direction.

        Thanks

        Comment


          #5
          See http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/core/DataClass.html, ListGridRecords derive from this class, it is just a bunch of helper functions to return back to your the value as a paritcular object.

          Comment

          Working...
          X