How to implement autosuggest feature for a!paragraphField

Hi team,

How to implement autosuggest feature for  a!paragraphField ,as we do not want to use the   a!pickerFieldCustom due to the small size of the text box.

Please suggest.

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Senior Developer
    in reply to bihitakd0002

    As Mike mentioned you need to reconsider this option or need to come up with some designs which would give similar feel and fulfill the requirement.

    I have tried using a textField which collects the info to filter the data using includes as the operator and a cardLayout with richtext in it in a loop which runs over the given input. 



    But again performance depends on the amount of data you have.


Children
  • can you please share the example code for the above.

  • 0
    Certified Senior Developer
    in reply to bihitakd0002

    Sure here!

    a!localVariables(
      local!variable: null,
      local!data: a!refreshVariable(
        value: a!queryRecordType(
          recordType:"your RecordType here",
          fields: {
            "Fields you will need"
          },
          filters: a!queryLogicalExpression(
            operator: "AND",
            filters: {
              a!queryFilter(
                field: "Your labels/Values",
                operator: "includes",
                value: local!variable
              )
            },
            ignoreFiltersWithEmptyValues: true
          ),
          pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 100)
        ).data,
        refreshAlways:true
      ),
      local!selection,
      {
        a!columnsLayout(
          columns: {
            a!columnLayout(
              width: "MEDIUM",
              contents: a!sectionLayout(
                label: "On Selection",
                contents: {
                  a!textField(
                    label: "Search Text",
                    labelPosition: "ABOVE",
                    value: local!variable,
                    saveInto: {
                      local!variable,
                      a!save(local!selection, null)
                    },
                    refreshAfter: "KEYPRESS",
                    validations: {}
                  ),
                  a!forEach(
                    items: local!data,
                    expression: {
                      a!cardLayout(
                        showWhen: a!isNotNullOrEmpty(local!variable),
                        link: a!dynamicLink(
                          saveInto: a!save(local!selection, fv!item)
                        ),
                        style:if(
                          a!isNotNullOrEmpty(local!selection),
                          if(fv!item = local!selection, "ACCENT", ""),
                          {}
                        ),
                        contents: {
                          a!richTextDisplayField(
                            value: {
                              a!richTextItem(
                                text: fv!item["use your value index by record"]
                              )
                            }
                          )
                        }
                      )
                    }
                  )
                }
              )
            )
          }
        )
        
        
        
      }
    )