Skip to main content
October 21, 2021
Question

form layout problems

  • October 21, 2021
  • 8 replies
  • 0 views

I am trying to combine different interfaces into one interface, However it keeps return with error with "The contents field on a column layout cannot contain a form layout. Received a form layout at index 1.".

What is the problem, by the way, if there is a rule input boolean value with pending true or false, then how should i fill in the rule!(????). Anyone tell me?

    8 replies

    stewart.burchell
    October 21, 2021

    A Form Layout is in effect the outermost container for a user interface for Start or Task forms. Therefore you cannot have a form layout inside any other interface layout component. It seems like you have a form layout in the contents attribute of a column layout (this is what the message is telling you).

    I don't understand your second point, could you elaborate please?

    October 21, 2021

    a!localVariables(
      local!chooseValue:1,
      local!buttonChoice,
      local!backupuserauditcasttype:rule!KONE_Development_BACKUP_USER_AUDIT_castType(),
      local!userrolecasttype:rule!KONE_Development_USER_ROLE_castType(),
      a!formLayout(
        label:choose(local!chooseValue,"KONE Maintenanence System","Registration System","Update System","Delete System"),
        contents:{
          a!radioButtonField(
            label: "Please Choose",
            labelPosition: "COLLAPSED",
            choiceLabels: {"Registration", "Update","Delete"},
            choiceValues: {"Registration", "Update","Delete"},
            value:local!buttonChoice,
            saveInto: {a!save(target:local!buttonChoice,value:save!value),
                      if(local!buttonChoice="Registration",
                      a!save(target:local!chooseValue,value:2),
                      if(local!buttonChoice="Update",
                      a!save(target:local!chooseValue,value:3),
                      if(local!buttonChoice="Delete",
                      a!save(target:local!chooseValue,value:4),
                      {}
                      )
                      )
                      ) 
                      },
            choiceLayout: "STACKED",
            validations: {}
          ),
        a!imageField(
          label: "Image",
          labelPosition: "COLLAPSED",
          images: {
            a!documentImage(
              document: cons!KONE_IMAGE01
            )
          },
          showWhen:local!chooseValue=1,
          size: "LARGE",
          isThumbnail: false,
          style: "STANDARD"
        ),
        
          rule!KONE_Development_Insert_Interface(backupuseraudit:local!backupuserauditcasttype, userrole:local!userrolecasttype,
          submit:true(),
          )
        }
      ),
    )

    Though i didn't a!formLayout inside contents but it is still report. The second one is what shall I put inside the interface rule!KONE_Development_insert_Interface() bracket? The submit as boolean value processed through inside the interface, no one know whether it is true or false, then how should i do?

    stewart.burchell
    October 21, 2021

    If rule!KONE_Development_Insert_Interface() contains an a!formLayout() then this is why you are getting the message. Referencing code in another rule is like having copied/pasted that code into your current code, so that's almost certainly why you are getting the validation message.

    Without looking inside your contained rule I cannot comment ion what it is doing with the submit: true() value you are passing to it.

    October 21, 2021

    Only the main interface should use a!formLayout(). The sub-interfaces should use a!columnsLayout() or a!sectionLayout() or a!cardLayout() or a!boxLayout() depending on the requirememt