How do I get a connector from a connectorId in a javascript component?


I have a JavaScript component, which I pass a reference to another javascript component in the shared state.

In a JavaScript component it just passed the ID of the connector.

I can then use that to get the Element using the connector Id, but I cannot get the component or state of the component.

How do I go about accessing another component from a JavaScript component? It doesn’t seem to be mentioned in any documentation.

Thanks :slight_smile:

I see only getConnectorId(), getElement(connectorId) and getParentId(connectorId). It seems to me that the com.vaadin.client.JavaScriptConnectorHelper::getConnector is not exposed to JS

Maybe someone with deeper knowledge can correct me if I’m wrong

I ended up just sharing the connectors using the “element”. So I assign it in componentA, then in componentB I get the element for connectorA then get the connector from the element. It just means I have to watch the order in which it happens.

I’m really surprised this isn’t inbuilt!