Table key lookup field in smartUi widget

Hi I have question. I need to create widget with tkl fields in it but i don't know how. I tried to use lib/src/csui/controls/form/fields/tklfield.view.js but I can't get it work. I am new to development in smartUI and opentext if some one have some tip how to do it I would really appreciate it thanks.

Comments

  • Ferdinand Prantl
    Ferdinand Prantl E Community Moderator

    Field views are created by their Alpaca wrappers, when a form is constructed. There is no example for creating a field view independently on a form.

    I recommend you creating a form schema with the TKL fields and then creating a form view with that schema. If you want to learn how a schema of a TKL field looks like, configure a category with it in Classic UI, prepare a node with that category applied and open Properties of that node in Smart UI. You will find the form schema in the response of /api/v1/forms/nodes/update.

    This is an example of a form with a single boolean field:

    // Backbone   - csui/lib/backbone
    // Marionette - csui/lib/marionette
    // FormView   - csui/controls/form/form.view
    
    formModel = new Backbone.Model({
      "data": {
        "reoccuring": true
      },
      "schema": {
        "properties": {
          "reoccuring": {
            "title": "Reoccurring",
            "type": "boolean"
          }
        }
      },
      "options": {
        "fields": {
          "reoccuring": {
            "type": "checkbox"
          }
        }
      }
    })
    
    formView = new FormView({
      model: formModel,
      mode: 'create',
      context: context
    })
    
    formRegion = new Marionette.Region({ el: "#form" })
    formRegion.show(formView)
    
  • Thank you very much for help.

  • Hi! Did you have success in applying TKL in a separate form view? Could you share an example?