Announcement

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

    DataSource.getTableName has disappeared in 5/11 nightly

    There used to be a DataSource.getTableName function. From the docs:

    -----------
    For DataSources using the 'Smart GWT SQL engine' for persistence, what database table name to use. The default is to use the DataSource ID as the table name.
    -----------

    This function has disappeared between 5/7 and 5/11 nightly builds.
    Is this intended? Where can I get the same information now?

    #2
    It's intentionally a server-side only API but accidentally appeared in the client API too. The client doesn't need this information and should not know it by default from an information leakage perspective. If you want to convey something like this client-side, make up an attribute of your choosing and use getAttribute().

    Comment


      #3
      I see.

      I presume the same is true for DataSource.getServerType, then.

      Comment


        #4
        Using Smart GWT 3.0 nightly builds.

        I'm on my *client-side* trying to determine the sql table source for a Smart GWT datasource.

        I see above that the DataSource.getTableName property was removed. My question is why doesn't getAttribute("tableName") work on the client-side when other 'getAttribute' calls do work:

        These WORK:
        Code:
        String serverType = DataSource.get("myDS").getAttribute("serverType");
        String ID = DataSource.get("myDS").getAttribute("ID");
        boolean dropExtraFields = DataSource.get("myDS").getAttributeAsBoolean("dropExtraFields");
        This DOES NOT WORK:
        Code:
        String tableName = DataSource.get("myDS").getAttribute("tableName");
        Here's a specific example:
        Code:
        String serverType = getGrid().getDataSource().getAttribute("serverType");
        String ID = getGrid().getDataSource().getAttribute("ID");
        boolean dropExtraFields = getGrid().getDataSource().getAttributeAsBoolean("dropExtraFields");
        String tableName = getGrid().getDataSource().getAttribute("tableName");
        			
        System.out.println(serverType + " " + ID + " " + dropExtraFields);
        System.out.println(tableName);
        Here's the output:
        Code:
        sql interfaces true
        null
        Is Smart GWT specifically blocking the ability to get the tablename attribute? Seems to me it shouldn't care since everything is an XML attribute or in JS.

        It would make sense to me if all the above DID or DIDN'T work. But to have some work and some not is confusing.

        I guess the solution is to add some 'custom' attribute onto the datasource defintion (.ds.xml) file but why if I already have an attribute that supplies me the property value I need?

        Comment

        Working...
        X