What is a Subview?

 

I’m working in K2 SmartForms and see references to Subviews. What is a subview?

A subview is a view that is opened by another view in a dialog.

Let’s say I have two views that do related, but different things. Perhaps view 1 contains the picker and list controls I mentioned in the last post. In that post, the list was populated with the names of months.

picker-click-2

Now let’s say view 2 is a form that takes a selected month as an input:

simple-list

So, if we put the two views together, a user can click on a month (in the first view) and enter hours (in the second view). the metaphor for this is the view-subview relationship.

By determining that view 2 will be a subview of view 1, you construct a rule that stipulates that view 2 will be opened as a subview. When the rule is executed at runtime, view 2 opens as a popup.

Here’s the view:

subview-1

And here’s the subview:

subview-2

You get the idea. A subview is not a part of a view; it’s a complete view which is being displayed by another view.

What is a Subview?