Fill the demo data in SAIL on click of a Button.

Certified Senior Developer

Hi,

we have requirement like on Button Click entire SAIL form(many fields) has to fill with some demo data. this will save a lot of time while giving the demo to client.

will it be possible to fill the data on click of a button?

Can you provide some thoughts on this, if possible some sample form.

We don't want to send the data from Process because we don't want to fill the form with default data.

Thanks in advance.

-Ram

  Discussion posts and replies are publicly visible

Parents
  • Hi Ram,
    You can still pass the data from the process and on click of a button you can fill those data across the form fields -OR- you can simply use a local variable and simply define the value inline.
    First you need to create a local variable that is used to fill out the form and assign the process variable (option#1) or defined local variable (option#2) to the local variable (used to fill out the form) in the saveInto of the buttonWidget.

    Here is how the form definition should look like for option#1.

    load(
    local!formData,

    a!formLayout(
    label: "Registration form",
    contents: {
    a!textField(
    label: "Name",
    value: local!formData.name,
    saveInto: local!formData.name
    ),
    a!textField(
    label: "DoB",
    value: local!formData.dob,
    saveInto: local!formData.dob
    )
    },
    buttons: a!buttonLayout(
    primaryButtons: {
    a!buttonWidget(
    label: "Fill",
    style: "PRIMARY",
    submit: false,
    saveInto: {
    a!save(
    local!formData,
    ri!cdt
    )
    }
    )
    }
    )
    )
    )

Reply
  • Hi Ram,
    You can still pass the data from the process and on click of a button you can fill those data across the form fields -OR- you can simply use a local variable and simply define the value inline.
    First you need to create a local variable that is used to fill out the form and assign the process variable (option#1) or defined local variable (option#2) to the local variable (used to fill out the form) in the saveInto of the buttonWidget.

    Here is how the form definition should look like for option#1.

    load(
    local!formData,

    a!formLayout(
    label: "Registration form",
    contents: {
    a!textField(
    label: "Name",
    value: local!formData.name,
    saveInto: local!formData.name
    ),
    a!textField(
    label: "DoB",
    value: local!formData.dob,
    saveInto: local!formData.dob
    )
    },
    buttons: a!buttonLayout(
    primaryButtons: {
    a!buttonWidget(
    label: "Fill",
    style: "PRIMARY",
    submit: false,
    saveInto: {
    a!save(
    local!formData,
    ri!cdt
    )
    }
    )
    }
    )
    )
    )

Children
No Data