5. Screens, tabs and rows¶
The shop needs more than the counter: the bikes in the workshop, and a page for each booking. This page gives
app.trb its screens, a booking its tabs, and the parts of a repair their rows.
The screens of the app¶
Choose view and click Add, Layout, Screens of the app. The designer adds
screens, after the form, with two screens to start with, Home and Details.Each screen is a row of the structure, with its faces under it. Choose
screen home "Home". Its properties have a section Screen:screen name: the word the app goes to it by,
go 'counter. Typecounter.title: what the window is called while it shows. Type
Counter.arguments: what the screen is given when the app goes to it. None here.
Add a screen adds another, empty, after the last.
Choose
screen details "Details": name itworkshop, titledWorkshop.
The counter’s form belongs in the counter screen. Drag the row of the form in the structure onto the row of
text "Home": the form goes into the counter screen, with every face inside it, just above that text. Then
choose text "Home" and Delete it.
The workshop¶
Choose text "Details" and Delete it. Choose the workshop screen and add Data, Table. A table shows
the fields of its rows in columns, in the small code box columns: write the ones of a booking,
[customer "Customer" bike "Bike"]. The preview fills it with a few made-up rows, so you see how it looks:

A screen for each booking¶
Choose the workshop screen and click Add a screen. Choose the new one and name it booking, titled Booking,
with id in arguments: the app goes to it with go [booking 42], and its code reads id.

The preview shows one screen at a time: the one the chosen face is on, or the first when the chosen face is on none. The first screen is the one the app starts on, so screens are not moved with Up and Down; Delete takes one out with its faces.
Tabs¶
A booking shows the repair on one tab and its parts on another.
Choose the booking screen and add Layout, Tabs. Two tabs come in, One and Two, each a row of the structure.
Choose
tab "One". A tab has one property, its label: typeRepair. Choosetab "Two"and typeParts. Add a tab would add a third.Choose
tab "Repair"and add Input, Long text:What is wrongin its text,faultin its name.
Choosing a face in a tab shows that tab in the preview, so the face is always in sight. A tab has no options and no events of its own; Delete takes it out with its faces. Steps, a wizard with Back and Next, work the same way, with Add a step.
Rows¶
The parts of a repair are a list the shop fills in, one part per row: rows. You design one row, and the user
adds as many as the repair needs.
Choose
tab "Parts"and add Input, Rows:Partsin its text,partsin its name.Under it in the structure is the row it repeats, with one field. Choose the field:
Partin text,partin name.Choose the
rowsagain and add Input, Money: it goes into the row, beside the part.Pricein text,pricein name.

The app now reads:
Trebol [title: "Cog & Chain"]
view [
title "Cog & Chain"
screens [
counter "Counter" [
form [
field customer "Customer" required
choice bike "Bike" ["Road" "Mountain" "City" "Child's"]
submit "Book in" [toast "Booked in"]
]
]
workshop "Workshop" [
table [customer "Customer" bike "Bike"]
]
booking "Booking" [id] [
tabs [
"Repair" [
area fault "What is wrong"
]
"Parts" [
rows parts "Parts" [field part "Part" money price "Price"]
]
]
]
]
]
The row of rows was written on one line, [field "Item"], so the price went beside the part on that line, as
you would have written it.
What’s next¶
The next page brings the styles a file defines into the Add menu.