as far as I can see there is no way to find ID of a DOM object that backs up specific ThinWire Java object as method getComponentId() of
WindowRenderer has package scope (and, additionaly, it is not clear how to obtain WindowRenderer object itself).
In my opinion, this information is desperatly needed if someone tries to integrate ThinWire with external JavaScript libraries that provide features unavailable in the ThinWire at the moment. E.g. hints, "vector" graphic etc.
Regards,
Oleksandr
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Component tf = new TextField().setBounds(100, 25, 5, 5);
app.getFrame().getChildren().add(tf);
//Get the component id
Integer id = app.getComponentId(tf);
//Get the component from an id
Component tfFromId = app.getComponentFromId(tfFromId);
Additionally, it's possible to add a RenderStateListener to WebApplication so that you receive a call back when the component is actually rendered. This is helpful if you don't know for sure when the rendering will occur. Keep in mind though, you must remove the RenderStateListener within the callback or at some point in the future, otherwise it will linger.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for response, I has overlooked that WebApplication had this method as well, sorry :(
But what to do in the latest (and forthcomig) builds?
I need this functionality mostly to integrate with external JS libraries. There are a lot of them and some provide functionality that is absent in ThinWire and is not likely to be included soon (if ever).
Regards,
Oleksandr
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
as far as I can see there is no way to find ID of a DOM object that backs up specific ThinWire Java object as method getComponentId() of
WindowRenderer has package scope (and, additionaly, it is not clear how to obtain WindowRenderer object itself).
In my opinion, this information is desperatly needed if someone tries to integrate ThinWire with external JavaScript libraries that provide features unavailable in the ThinWire at the moment. E.g. hints, "vector" graphic etc.
Regards,
Oleksandr
No longer true in the latest builds:
WebApplication app = (WebApplication)Application.current()
Component tf = new TextField().setBounds(100, 25, 5, 5);
app.getFrame().getChildren().add(tf);
//Get the component id
Integer id = app.getComponentId(tf);
//Get the component from an id
Component tfFromId = app.getComponentFromId(tfFromId);
Additionally, it's possible to add a RenderStateListener to WebApplication so that you receive a call back when the component is actually rendered. This is helpful if you don't know for sure when the rendering will occur. Keep in mind though, you must remove the RenderStateListener within the callback or at some point in the future, otherwise it will linger.
Thank you for response, I has overlooked that WebApplication had this method as well, sorry :(
But what to do in the latest (and forthcomig) builds?
I need this functionality mostly to integrate with external JS libraries. There are a lot of them and some provide functionality that is absent in ThinWire and is not likely to be included soon (if ever).
Regards,
Oleksandr
Hello,
thank you. I would try.
Regards,
Oleksandr