09.04.2018 Views

tornadofx-guide

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Wizard<br />

Wizard<br />

Some times you need to ask the user for a lot of information and asking for it all at once<br />

would result in a too complex user interface. Perhaps you also need to perform certain<br />

operations while or after you have requested the information.<br />

For these situations, you can consider using a wizard. A wizard typically has two or more<br />

pages. It lets the user navigate between the pages as well as complete or cancel the<br />

process.<br />

TornadoFX has a powerful and customizable Wizard component that lets you do just that. In<br />

the following example we need to create a new Customer and we have decided to ask for<br />

the basic customer info on the first page and the address information on the next.<br />

Let's have a look at two simple input Views that gather said information from the user. The<br />

BasicData page asks for the name of the customer and the type of customer (Person or<br />

Company). By now you can probably CustomerModel guess how the Customer and<br />

CustomerModel objects look, so we won't repeat them here.<br />

268

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!