cancel
Showing results for 
Search instead for 
Did you mean: 

ndc: BarcodeScannerButton not allowed to be placed in Form Content

Georgi
Explorer
250

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
Georgi
Explorer

Hi Noel,

 <core:Title id='inputSection1' text="Eingabefelder" />
                    <Label id='confLabel' text="{i18n>confirmationNumber}" />
                    <Input id="confInput"/>
                     <ndc:BarcodeScannerButton
                                id="confScan"
                                scanSuccess="onScanSuccess"
                                scanFail="onScanError"
                                inputLiveUpdate="onScanLiveupdate"
                                dialogTitle="{i18n>confirmationNumber}"
                            />
 
The error then in the console is:
Error: Element sap.ndc.BarcodeScannerButton#container-zppleanmes---MainView--confScan is not a valid Form content! Only use valid content in Element sap.ui.layout.form.ColumnLayout#container-zppleanmes---MainView--SimpleFormChangeColumn_twoGroups234--Layout
 
If I place it out of the Simple Form, I am able to see and use it as expected.