Hello,
I am currently working on migration from 1.5 to 2.0.
In the past, I created QR code input field. With help of javascript component and composite component I created reusable input. It uses javascript library for QR code scanning.
I was using approaches mentioned in:
https://demo.jmix.io/sampler/#main/0/sample?id=java-script-component-time-picker
https://docs.jmix.io/1.x/jmix/1.5/ui/custom-components/js-component.html
Code is:
qr-code-scanner.xml
<composite xmlns="http://jmix.io/schema/ui/composite">
<cssLayout id="qrCodeScannerRootBox" width="100%" stylename="qr-code-scanner">
<popupView id="scannerPopup" hideOnMouseOut="false" >
<vbox width="600px">
<jsComponent id="qrCodeScannerJsComponent" initFunctionName="com_generalbytes_dnameter_html5qrcode_init">
<dependencies>
<dependency path="vaadin://html5-qrcode/html5-qrcode-connector.js" type="JAVASCRIPT"/>
<dependency path="vaadin://html5-qrcode/html5-qrcode.min.js" type="JAVASCRIPT"/>
</dependencies>
</jsComponent>
</vbox>
</popupView>
</cssLayout>
</composite>
QrCodeScanner.kt
@CompositeDescriptor("qr-code-scanner.xml")
class QrCodeScanner: CompositeComponent<PopupView>(), CompositeWithHtmlDescription, CompositeWithContextHelp {
private lateinit var scannerPopup: PopupView
private lateinit var qrCodeScanner: JavaScriptComponent
private var valueConsumer: Consumer<String>? = null
...
}
Now I am trying to do same thing in JMIX 2.0, but I didnt find any mentions about javascript components in docs. Any hint how to proceed?
Thank you very much