Announcement

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

    DataSource custom properties

    Hi,

    Can I do something like a custom property on my datasource definition?

    Code:
    DataSource ds = DataSource.getDataSource(name);
    String myprop = ds.getAttribute("MyProp");
    where MyProp comes from the DS definition

    Code:
    <DataSource ID="biS" dropExtraFields="true" MyProp="abc">

    There are no getAttributes functions on com.smartgwt.client.data.DataSource, except for getAttributeAsMap?

    But also server side on com.isomorphic.datasource.DataSource there are no getAttribute or getProperty functions?

    #2
    Yes, you can use custom attributes.

    Remember to look at superclass APIs. getAttribute() exists in both cases (as well as on fields).

    Comment


      #3
      I've seen it indeed on the superclass of DataSource, but since those methods are protected, you can't use them directly on a DataSource object:

      Code:
      BaseClass::protected native Boolean getAttributeAsBoolean(String property)

      Comment


        #4
        Protected has visibility in subclasses outside the package,

        The protected modifier specifies that the member can only be accessed within its own package (as with package-private) and, in addition, by a subclass of its class in another package. source:http://download.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html

        Comment


          #5
          These API's will be made public in the next nightly.

          Comment

          Working...
          X