Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9164

Dynamic Form with Model-> nested Controls

$
0
0

hi all,

 

first i will explain what i want to do: (the screenshot is my "goal").

 

 

but it should not be static: i have an array of objects:


{    "charac": [        {            "MERKNR": 10,            "CHAR_DESCR": "Size",            "AUSWAHLMGE": "REDCOLOR",            "KTEXTAM": "Rotfarben / Red tones",            "CODEGRUPPE": "COLOR",            "KTEXTGR": "Farbe",            "CODE_TAB": [                {                    "CODE": "10",                    "KURZTEXT": "Braun"                },                {                    "CODE": "11",                    "KURZTEXT": "Hellrot"                },                {                    "CODE": "12",                    "KURZTEXT": "Mittelrot"                },                {                    "CODE": "13",                    "KURZTEXT": "Dunkelrot"                }            ],            "SCOPE": 1        },               {            "MERKNR": 30,            "CHAR_DESCR": "Lenght",            "KTEXTAM": ">= 94,00 mm",            "SCOPE": 3,            "CHAR_RESULT": [                {                    "VALUE": "95,000",                    "VALUATION": "A"                },                {                    "VALUE": "98,000",                    "VALUATION": "A"                },                {                    "VALUE": "102,000",                    "VALUATION": "A"                }            ],            "MEAN_VALUE": "98,333",            "MEAS_UNIT": "mm",            "RESULT_VALUATION": "A"        },        {            "MERKNR": 40,            "CHAR_DESCR": "Width",            "KTEXTAM": ">= 560,00 mm",            "SCOPE": 1,            "MEAS_UNIT": "mm"        }    ]
}

the 3 types which could be:

the first object (Merknr=10) should be an select dropdown - sap.m.Select -  because CODE_TAB exists. CODE_TAB should also be the available values in the dropdown.

the second object (Merknr=30) should be a range of input fields(CHAR_RESULT) + one calculated value(MEAN_VALUE).

and the third object merknr=40 should be an single input field -> only one value "MEAN_VALUE".

 

also, have all objects VALUATION, which should be the ok or not ok sign on the side of the fields.

 

  • so is it possible in the view to program: if this object,use this control template( select, single, multiinput).
  • i have started with the following code: why does the title binding in "formContainers"-Element not work?:
var formContainers = new sap.ui.layout.form.FormContainer({            title: "{PRUEFMerkmale>/CHAR_DESCR}"        });        var gridLayout = new sap.ui.layout.form.ResponsiveGridLayout({            labelSpanL: 4,            labelSpanM: 4,            emptySpanL: 4,            emptySpanM: 4,            columnsL: 1,            columnsM: 1        });        var form = new sap.ui.layout.form.Form({            formContainers: {                path: "PRUEFMerkmale>/charac",                template: formContainers            },// formContainer,            layout: gridLayout        });        var hBox = new sap.m.HBox({            justifyContent: "Center",            items: [ok]        });        var grid = new sap.ui.layout.Grid({            defaultSpan: "L12 M12 S12",            width: "auto",            content: [form, hBox]        });                form.setModel(sap.ui.getCore().getModel("PRUEFMerkmale"));        return [grid];

thanks for your help, maybe you can explain which way would be the best to program for this example?

 

 

br Alex


Viewing all articles
Browse latest Browse all 9164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>