Multiple Checkboxes in Editable Grid

Hi,

For my requirement, I'm using Editable Grid it contains multiple check boxes. I'm passing the local variable into the values. But for a single check box selection I am able to save the value, whereas if i'm trying to select multiple check boxes at a time, I am unable to save values. I want to check multiple values ​​and save all of them values.

 

  Discussion posts and replies are publicly visible

Parents
  • Hi ,
    Share your code snipped it would help us understand the issue.

    Regards,
    Sachin
  • 0
    A Score Level 1
    in reply to Sachin
    load(
    local!data: {},
    local!items: {
    {
    SiteName: "",
    SiteCountry: "",
    ManufacturingSteps: ""
    }
    },
    with(
    local!mfgsite: rule!CMP_qryMfgSitedetails(),
    local!mfgcountry: rule!CMP_qryCountryDetails(
    countryode: 1
    ),
    a!sectionLayout(
    label: "Supply Chain Details",
    isCollapsible: "True",
    isInitiallyCollapsed: "True",
    divider: "BELOW",
    contents: {
    a!gridLayout(
    label: "Site Information",
    headerCells: {
    a!gridLayoutHeaderCell(
    label: "Site Name"
    ),
    a!gridLayoutHeaderCell(
    label: "Site Country"
    ),
    a!gridLayoutHeaderCell(
    label: "Manufacturing Steps"
    )
    },
    rows: {
    a!forEach(
    items: local!items,
    expression: a!gridRowLayout(
    contents: {
    a!dropdownField(
    label: "SiteName" & fv!index,
    choiceLabels: local!mfgsite.name,
    choiceValues: local!mfgsite.name,
    placeholderLabel: "--Select Site--",
    value: fv!item.SiteName,
    saveInto: fv!item.SiteName
    ),
    a!dropdownField(
    label: "SiteCountry" & fv!index,
    choiceLabels: local!mfgcountry.name,
    choiceValues: local!mfgcountry.name,
    placeholderLabel: "--Select Country--",
    value: fv!item.SiteCountry,
    saveInto: fv!item.SiteCountry
    ),
    a!checkboxField(
    label: "Manufacturing Steps" & fv!index,
    choiceLayout: "COMPACT",
    choiceLabels: cons!DFC_Sites,
    choiceValues: cons!DFC_Sites,
    value: fv!item.ManufacturingSteps,
    saveInto: {
    fv!item.ManufacturingSteps
    }
    )
    }
    )
    )
    },
    addRowLink: a!dynamicLink(
    label: "Add site",
    value: {
    SiteName: "",
    SiteCountry: "",
    ManufacturingSteps: {}
    },
    saveInto: a!save(
    local!items,
    append(
    local!items,
    save!value
    )
    )
    ),
    shadeAlternateRows: true
    ),
    a!textField(
    readOnly: true,
    value: local!items.ManufacturingSteps
    ),
    a!buttonLayout(
    primaryButtons: a!buttonWidgetSubmit(
    label: "Submit",
    style: "PRIMARY",
    confirmHeader: "Warning!",
    confirmMessage: "Steps will be added to the Database.
    Please Click Yes to Proceed",
    saveInto: a!writeToDataStoreEntity()
    )
    )
    }
    )
    )
    )
  • Hi,

    You can save multiple value in single type variable, here fv!item.ManufacturingSteps is single type variable.

    you can join the checkbox values with some special characters,

    Note: the data type should be TEXT

    try the below code.

     

     

    a!checkboxField(
    label: "Manufacturing Steps" & fv!index,
    choiceLayout: "COMPACT",
    choiceLabels: cons!DFC_Sites,
    choiceValues: cons!DFC_Sites,
    value:if(
           isnull(fv!item.ManufacturingSteps),
            null,
            touniformstring( split(fv!item.ManufacturingSteps,"#") )
          ),
    saveInto: {
    
      a!save(
        fv!item.ManufacturingSteps,
         if(
            isnull(save!value),
              null,
              joinarray(save!value,"#")
          )
    
        )
    
     }
    )

     

    Thanks

    Vinay

Reply
  • Hi,

    You can save multiple value in single type variable, here fv!item.ManufacturingSteps is single type variable.

    you can join the checkbox values with some special characters,

    Note: the data type should be TEXT

    try the below code.

     

     

    a!checkboxField(
    label: "Manufacturing Steps" & fv!index,
    choiceLayout: "COMPACT",
    choiceLabels: cons!DFC_Sites,
    choiceValues: cons!DFC_Sites,
    value:if(
           isnull(fv!item.ManufacturingSteps),
            null,
            touniformstring( split(fv!item.ManufacturingSteps,"#") )
          ),
    saveInto: {
    
      a!save(
        fv!item.ManufacturingSteps,
         if(
            isnull(save!value),
              null,
              joinarray(save!value,"#")
          )
    
        )
    
     }
    )

     

    Thanks

    Vinay

Children
No Data