Issue with dropdown field

Hi to everyone,

I've tried to create a very simple form with a dropdwon field with a default value, but something doesn't work.

My objective is to create a dropdownw field with a default value specified in the local variable defaultValue, I'm expecting that if the user don't touch the dropdown and simply click on the "Submit" button the value svaed on the ri! is the default value, but it doesn't save anything why??? the cons declared on the code is a multiple text one with value: 01:00AM;01:30AM;02:00AM;02:30am;03:00AM;03:30AM;04:00AM;04:30AM;05:00AM;05:30AM;06:00AM;06:30AM;07:00AM;07:30AM;08:00AM;08:30AM;09:00AM;10:00AM;10:30AM;11:00AM;11:30AM;12:00AM;01:00PM;01:30PM;02:00PM;02:30PM;03:00PM;03:30PM;04:00PM;04:30PM;05:00PM;05:30PM;06:00PM;06:30PM;07:00PM;07:30PM;08:00PM;08:30PM;09:00PM;10:00PM;10:30PM;11:00PM;11:30PM;12:00PM

=load(
local!defaultValue: "09:00AM",
a!formLayout(
label: "Apac Test",
firstColumnContents: {
a!dropdownField(
label...

OriginalPostID-189720

OriginalPostID-189720

  Discussion posts and replies are publicly visible

Parents
  • Hi Marco - I would set a local variable in the load with the default value, and then work with the local variable throughout the form. Then at the end, save into the ri!date. Try something like this:

    = load(
    local!dropdownValue: "09:00AM",
    a!formLayout(
    label: "Apac Test",
    firstColumnContents: {
    a!dropdownField(
    label: "Dropdown with default value",
    labelPosition: "ABOVE",
    choiceLabels: cons!Date_AM_PM,
    choiceValues: cons!Date_AM_PM,
    value: local!dropdownValue,
    saveInto: local!dropdownValue,
    required: false,
    validations: {}
    )
    },
    buttons: a!buttonLayout(
    primaryButtons: {
    a!buttonWidgetSubmit(
    label: "Submit",
    style: "PRIMARY",
    saveInto: {a!save(ri!date, local!dropdownValue)}
    )
    },
    secondaryButtons: {
    a!buttonWidgetSubmit(
    label: "Cancel",
    style: "NORMAL",
    value: true,
    saveInto: ri!cancel,
    skipValidation: true
    )
    }
    ),
    validations: {}
    )
    )
Reply
  • Hi Marco - I would set a local variable in the load with the default value, and then work with the local variable throughout the form. Then at the end, save into the ri!date. Try something like this:

    = load(
    local!dropdownValue: "09:00AM",
    a!formLayout(
    label: "Apac Test",
    firstColumnContents: {
    a!dropdownField(
    label: "Dropdown with default value",
    labelPosition: "ABOVE",
    choiceLabels: cons!Date_AM_PM,
    choiceValues: cons!Date_AM_PM,
    value: local!dropdownValue,
    saveInto: local!dropdownValue,
    required: false,
    validations: {}
    )
    },
    buttons: a!buttonLayout(
    primaryButtons: {
    a!buttonWidgetSubmit(
    label: "Submit",
    style: "PRIMARY",
    saveInto: {a!save(ri!date, local!dropdownValue)}
    )
    },
    secondaryButtons: {
    a!buttonWidgetSubmit(
    label: "Cancel",
    style: "NORMAL",
    value: true,
    saveInto: ri!cancel,
    skipValidation: true
    )
    }
    ),
    validations: {}
    )
    )
Children
No Data