Closed gspinaci closed 3 years ago
data='{"msg": "{{bindings}}"}
. I think you misunderstood the way it works: /**
* Data that will be sent to all targets instead of the original event's data
*/
data?: object;
You don't need to use data
attribute here.
semantic-table
doesn't send the actual result with Component.Loaded event, see https://github.com/researchspace/researchspace/blob/master/src/main/web/components/semantic/table/SemanticTable.ts#L256Try to change that to something like:
const loading = this.querying
.map(SparqlClient.select(props.query, { context: context.semanticContext }))
.onValue((res) => {
if (this.props.id) {
trigger({ eventType: BuiltInEvents.ComponentLoaded, source: this.props.id, data: {result: res} });
}
this.setState({ data: res, isLoading: false })
})
.onError((error) => this.setState({ isLoading: false, error }));
{{log this}}
anywhere in the client-side template and see what is available in current scope in the browser console. https://handlebarsjs.com/guide/builtin-helpers.html#logBrilliant, it is working!
I wasn't thinking of passing data when within the trigger function like this. Also, I spent some time trying to understand how to handle it from the end of the stream.
Thank you very much!
Hello!
I am using the
<mp-event-proxy>
element to capture the Component.Loaded event when a<semantic-*>
component (in my specific case a<semantic-table>
, but I will most certainly use a<semantic-map>
component in the next iterations).My Intention is to pass the result of the query to an external element, namely
<mp-event-target-template-render>
.This is my configuration:
This is working, but the only data I'm able to pass are strings.
See the result here:
I have also tried front-end debugging with Google Chrome and Firefox, but I'm not finding any clue about variable names or how to handle it.
Is there something I'm missing right now?
P.S. I have also tried with
<mp-event-trigger>
specifying the event type as Component.Loaded, but it is not working.