-1

Adding Form Container and Form Elements Dynamically in UI5

Hi All,

Am trying to create a form using below lines of code.

var proposalLayout = new sap.ui.layout.form.GridLayout("L2"); var proposalForm = new sap.ui.layout.form.Form("proposalForm",{ editable: true, layout: proposalLayout, formContainers: [ new sap.ui.layout.form.FormContainer({ //title: "Proposed Solution", formElements: [ new sap.ui.layout.form.FormElement({ label: "Solution Name", fields: [new sap.m.Input("solNameInput",{layoutData: new sap.ui.layout.form.GridElementData({hCells: "13"})})] }), new sap.ui.layout.form.FormElement({ label: "Prepared by", fields: [new sap.m.Input("preparedByInput",{ layoutData: new sap.ui.layout.form.GridElementData({hCells: "13"})})] }) ] }), new sap.ui.layout.form.FormContainer({ title: "Case Benefits", formElements: [ new sap.ui.layout.form.FormElement({ label: new sap.m.Label({text: "Cost"}), fields: [new sap.m.Input("costInput",{layoutData: new sap.ui.layout.form.GridElementData({hCells: "1"})})] }) ], layoutData: new sap.ui.layout.form.GridContainerData({halfGrid: true}) }), new sap.ui.layout.form.FormContainer({ formElements: [ new sap.ui.layout.form.FormElement({ label: new sap.m.Label({text: "Benefits"}), fields: [new sap.m.Input("benefitsInput",{layoutData: new sap.ui.layout.form.GridElementData({hCells: "1"})})] }) ], layoutData: new sap.ui.layout.form.GridContainerData({halfGrid: true}) }), ] });

Now again i need to regenerate the same form when i click on a Button.

Could any body please help me to acheive this functionality

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Apr 05, 2017 at 11:59 AM

    what's your problem?

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 06, 2017 at 05:35 AM

    Hi Junwu,

    When i click on PLUS Button again i need to get the below form need to be added on this page.

    Regards,

    Shekar.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 23, 2017 at 08:41 AM

    did you found the solution..??? Let me Know

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 06 at 10:07 AM

    I'm having this requirement as well. Any solution for this?

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 21 at 10:45 AM

    I too want to do the same thing. Did you found the solution? If yes,Let me Know.

    Thanks

    Add comment
    10|10000 characters needed characters exceeded

Skip to Content