question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What's wrong with form?

See original GitHub issue
`{
  "schema": {
  "type": "object",
  "properties": {
    "name": {
		"type": "string"
    },
	"Objects": {
	 "type": "array",
	  "items": {
		"type": "object",
		"properties": {
		  "object": {
			"type": "object",
			"properties": {
			  "objectId": {
				"type": "string"
			  },
			  "attributes": {
				"type": "array",
				"items": {
				  "type": "object",
				  "properties": {
					"attributeId": {
						"type": "string"
					},
					"attrbuteName": {
						"type": "string"
					},
					"value": {
					  "type": "string"
					}
				  }
				}
			  }
			}
		  }
		}
	  }
	}
  }
},
  "form": [
      "name",
      {
          "key" :"Objects",
          "items": [
              {
                "key":"Objects[].object",
                "items": [
                    "objectId",
                    {
                        "key": "attributes",
                        "items": [
                            "attributes[].attributeId",
                            "attributes[].attrbuteName",
                            "attributes[].value"
                            ]
                    }
                    ]
              }
              ]
      }
]
}`

Why I don’t see “attributeId”, “attrbuteName” and “value”?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:22

github_iconTop GitHub Comments

1reaction
catullcommented, Mar 14, 2018

The keyword is htmlClass.

The schema: part is only about data types: string, number, required etc.

The layout: part is all about presentation, in HTML. What colour the field has, how wide is it, which HTML class has to be used/applied.

So, the answer is, put it in the layout: part.

Just out of curiosity, is this a student assignment ?

1reaction
catullcommented, Mar 14, 2018

Sorry about the error on schemaform.io, there is a small mistake in the payload, take this one:

{
    "schema": {
        "type": "object",
        "properties": {
            "name": {
                "type": "string"
            },
            "Objects": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "object": {
                            "type": "object",
                            "properties": {
                                "objectId": {
                                    "type": "string"
                                },
                                "attributes": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "attributeId": {
                                                "type": "string"
                                            },
                                            "value": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "form": [
        {
            "key": "name"
        },
        {
            "key": "secname"
        },
        {
            "key": "Objects",
            "type": "array",
            "items": [
                {
                    "key": "Objects[].object",
                    "items": [
                        {
                            "key": "Objects[].object.objectId",
                            "htmlClass": "col-md-6"
                        },
                        {
                            "key": "Objects[].object.objectName",
                            "htmlClass": "col-md-6"
                        },
                        {
                            "key": "Objects[].object.attributes",
                            "type": "array",
                            "items": [
                                {
                                    "type": "section",
                                    "htmlClass": "row",
                                    "items": [
                                        {
                                            "items": [
                                                {
                                                    "key": "Objects[].object.attributes[].attributeId"
                                                }
                                            ],
                                            "htmlClass": "col-md-6"
                                        },
                                        {
                                            "items": [
                                                {
                                                    "key": "Objects[].object.attributes[].attrbuteName",
                                                    "condition": "",
                                                    "readonly": "true"
                                                }
                                            ],
                                            "htmlClass": "col-md-6"
                                        }
                                    ]
                                },
                                {
                                    "key": "Objects[].object.attributes[].value"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is the Problem of Form? - Biology Worthy of Life
The power of transformation is, in a puzzling manner, holistic. The part is caught up within the whole and moves toward its new...
Read more >
Blog - Why forms are hard | vbu.tech
In this article I will try to shed some light on why forms usually turn out to quite difficult to get right. The...
Read more >
10 Form Mistakes You Need to Fix Now | Muscle & Fitness
Learn how to fix your form and build bigger muscles by avoiding these top 10 exercise mistakes.
Read more >
The Top 8 Complaints Users Make About Online Forms
In this article, we lay out the top complaints people make about online forms. These are quick wins that can dramatically affect your ......
Read more >
5 Contact Forms that Went Horribly Wrong and How to Fix Them
Your Form is Not Responsive Across Handheld Devices​​ In a nutshell, if you have a contact form, then make sure it works everywhere....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found