How to arrange two input fields side by side

  • Fulya
        3 years ago #24181

        Hi,

        I use the ui_layout_form_SimpleForm1 to create a floating form. But I want to have two input fields next to each other in some places (please see the example in attachement). I have tried the following: Set the width (dimension) of Label1 + Input1 to 30% and the width (dimension) of Label2 + Input2 to 70% but the inputs are not placed side by side and I don’t know how to do that. (I set the dimension of the layout itself to 50% and maxContainerCols = 0)

        I would be glad about a help.

        Fulya

         

        Attachments:
        You must be logged in to view attached files.
        Jennifer Häfner
            Has successfully completed the online course Intermediate (200)
            Has successfully completed the online course Advanced (300)
            Has successfully completed the online course Basics (100)
            Has successfully completed the online course Advanced (310)
            Has successfully completed the online course Advanced (320)
            Has successfully completed the Intermediate Certification
            Has successfully completed the Advanced Certification
          3 years ago #24295
          Up
          0
          Down
          ::

          Hi Fulya,

          in a SimpleForm, a Label always starts a new line. So if you want to have two input fields next to each other, you can implement your SimpleForm like in this example: https://sapui5.hana.ondemand.com/#/entity/sap.ui.layout.form.SimpleForm/sample/sap.ui.layout.sample.SimpleFormToolbar

          simple form - two inputs

          Or you can set the SimpleForm’s property ‘layout’ to ‘ColumnLayout’, so all labels/inputs are arranged in columns (implemented in this example: https://sapui5.hana.ondemand.com/#/entity/sap.ui.layout.form.SimpleForm/sample/sap.ui.layout.sample.SimpleForm_Column_oneGroup234)

          simple form - columns

          Fulya
              3 years ago #24391
              Up
              0
              Down
              ::

              Hello Jennifer,

              all right, thank you for the answer!

            Viewing 3 posts - 1 through 3 (of 3 total)

            You must be logged in to reply to this topic.