Announcement

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

    Is the documented "DSRequest.outputs" property really available?

    Hi all,
    I'm trying to see if I can use any existing mechanism to control - from client side - which fields the server should populate for every record sent to the client (cause some of them are very expensive to calculate and hence the client should request them only when the user enables the relevant grid columns).
    I'm using SmartGWT 3.0 at client side, while at the server side I have my custom REST services embedded into a legacy application.

    I've seen the documentation suggests there is a DSRequest outputs attribute that should dictate the fields list, i.e. they says
    Note that this will be applied in addition to any specified {@link com.smartgwt.client.data.DSRequest#getOutputs outputs}.
    but that method/property doesn't seem to exist in SmartGWT... I also gave a quick look at the latest SmartClient 8.2 nightly builds SDK sources (I thought that maybe it was accessible via JSNI) but I haven't found any outputs property exposed, even if it is documented in other places, like:
    * OperationBinding.outputs
    * ListGridField.includeFrom
    and others.
    I guess I could set OperationBinding.outputs via JSNI: it should be reflected into a DSRequest when the server communication is triggered... but I would like to change that list on a DataBoundComponent per-request basis (provided that the datasource instance would serve only visual databound components aware of that field list). BTW I'd like to avoid reimplementing my proprietary way of passing that info if there's a standard one it is even worth to adapt to.

    So is there a predefined protocol to instruct the server on which fields it should populate on responses? (apart from DSRequest.additionalOutputs and DSRequest.exportFields which seem appropriate for other scenarios)

    I'm using SmartGWT 3.0 - SmartClient Version: SC_SNAPSHOT-2011-12-05/LGPL Development Only (built 2011-12-05)

    #2
    All the documentation you're referring to basically describes how the SmartGWT server supports dsRequest.outputs.

    It's not something that other DataSource types will automatically send to the server (including RestDataSource). You would need to add it.

    Comment


      #3
      Solved

      I've posted a snippet with the solution I've obtained.
      Many thanks to Isomorphic.

      Comment

      Working...
      X