Skip to Content

Problem when retrieving metadata in Additional Properties after the user binded a datasource

Hi guyz.

After a user binds a data source to a custom component, I have a function that is launched.

Inside this function, I'm doing a

datasource_metadata = that.callRuntimeHandler("getMetadataAsString");

To get the metadata from the component

this.getMetadataAsString = function() {

return JSON.stringify(that.resultSetOwner()); // returns the resultSet-typed property

}

The problem is that the getter seems to be faster than the setter.

So when this.getMetadataAsString is called, the metadata value has been not set yet inside the resultSetOwner property.

What can I do to go through this problem (no answer based on setTimeout please 😊).

PS : I read this post :

but in the example given, the developer seems to use hard-coded data in case of he got no metadata coming back.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Dec 05, 2014 at 04:46 PM

    what is the method "resultSetOwner" doing?

    as long there is no datasource assigned to the component, the data and metadata are not set, meaning undefined, this is why Mike sets some "dummy" values for this.

    Add a comment
    10|10000 characters needed characters exceeded

    • Thanks for your reply.

      It was the answer I feared, but eh 😭.

      I think I'll go for a 10 setInterval call I think, and thus if nothing is found, well I'll accept the fact that no data source has been bounded.

      Anyway, the matter of time before the set executes and the get retrieves the value is very short, if you delay the runtimeHandler for 0.5s, seems like the data are always already set (maybe it depends of the size of the data source).

      Imo, the component part misses a callRuntimeHandler that would work the same than APS, but in the other way around.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.