cancel
Showing results for 
Search instead for 
Did you mean: 

ndc: BarcodeScannerButton not allowed to be placed in Form Content

Georgi
Explorer
255

Hello everyone, 
I am using a Smart Form where the user should enter a couple of details and 2 of them he/she should be able to scan. Unfortunaltey when I place the BarcodeScannerButton next to the Input field, I get an Error that the BarcodeScannerButton is not allowed to be placed in the Form Content. 

Is there any workaround on this issue? I don't like to nest multiple Flex/Vbox/Hbox layouts just to show my data as in a Simple Form. 

Can I disable this check with some property?

@qmacro @OliverGraeff 

Noel_Hendrikx
Active Contributor
0 Kudos
Hi Nusch, could you share some code please?
View Entire Topic
Noel_Hendrikx
Active Contributor
0 Kudos
I also have a SimpleForm with a Label, Inputfield and custom control. It does not complain about it is not allowed. How did you specify your SimpleForm?

    <Label id='confLabel' text="{i18n>confirmationNumber}" />
    <Input id="confInput">
        <layoutData>
            <l:GridData span="L5 M5 S5" />
        </layoutData>
    </Input>
    <ndc:BarcodeScannerButton id="confScan"
        scanSuccess="onScanSuccess"
        scanFail="onScanError"
        inputLiveUpdate="onScanLiveupdate"
        dialogTitle="{i18n>confirmationNumber}">
        <layoutData>
            <l:GridData span="L1 M1 S1" />
        </layoutData>
    <ndc:BarcodeScannerButton>
Georgi
Explorer
0 Kudos
Nothing special on the specification of the simple form:
Noel_Hendrikx
Active Contributor
0 Kudos
Did you try the <layoutData> <l:GridData span="L1 M1 S1" /> </layoutData>
Georgi
Explorer
0 Kudos
I guess, that the issue is caused by the ndc:BarcodeScannerButton not implementing the form Content interface: https://sapui5.hana.ondemand.com/#/api/sap.ui.core.IFormContent
Noel_Hendrikx
Active Contributor
0 Kudos
My custom component does not implement it as well and it works...
Georgi
Explorer
0 Kudos

Which ui5 library version are you using?
Is you custom component inheriting from or extending a standard component?

Noel_Hendrikx
Active Contributor
0 Kudos
I am using 1.71.x and my custom component extends from sap/ui/core/Control
Georgi
Explorer
0 Kudos
This is a way too lower version. I think the Eslint is much more strict since 1.xx. Furthermore the Barcodescanner is also not available on 1.71, but thanks anyway!
Noel_Hendrikx
Active Contributor
0 Kudos
If it works for 1.71.x it should work for higher versions as well (unless it is deprecated)