Build dynamic forms using JET! — Part 3/5

Checkout part 1 and part 2 if you haven’t . In this post i will cover form html generation aka rendering the form.

Photo by Branko Stancevic on Unsplash

I part 2 we saw how forms could be described using json metadata and in part one we saw how oj-bind-for-each and oj-bind-if could be used for rendering html dynamically. In this post we will see how they all come together and help us render the form.

The below JS function is responsible for inserting each field into the DOM. Field is inserted when the field prop is pushed to _metadataArr array and all properties are added via self.applyProperties(, prop) function call which internally calls setProperty on each field inserted to set the properties (label, hints, validators etc).

The corresponding html looks like this. Notice how we loop over _metadataArr which we are populating with the field props above.

In the next part we will look at how values are captured and forms are validated.

Product Manager for Oracle Visual Builder.I talk about Oracle JET, VBCS, React, React Native, Spring Boot. Views are my own.