Claus Ibsen created FORGE-2615:
----------------------------------
Summary: Forge addon - From one command be able to easily split into a wizard
with N pages
Key: FORGE-2615
URL:
https://issues.jboss.org/browse/FORGE-2615
Project: Forge
Issue Type: Feature Request
Components: UI - API
Affects Versions: 3.0.0.CR1
Reporter: Claus Ibsen
Problem
When you build commands in forge that you want to be like a wizard, with 3 pages, where
you on page 1 have 3 inputs, on page 2 4 inputs, and on page 3 2 inputs. Then today you
need to build that in multiple classes with UIStep and initialize the ui for each step,
and put them all together and whatnot.
This seems sometimes a bit too much for those simpler commands, where basically you wish
you could write all that in just *one* java class. And then tell forge to split the UI
elements into 3 pages, and tell it which UI elements go into what page. Then forge makes
that automatic a wizard with next/back/finish buttons.
Then from the logic point of view. It works 100% as if would do if there was just 1 page
with all the inputs on the same page. So validation / listeners and so on all react.
The idea is just to allow the end user to much easier break this up into steps that makes
the command better to use for end users. You may on the first page to have ui fields that
take in some mandatory fields, and then on page 2 some fields that are related together in
some way, and then on page 3 yet another group of related options.
You should also be able to configure the title of each page in that steps. So maybe you
can in the initiizeUI method do:
{code}
builder.add(one).add(to).next().add(three).add(four).next().add(five);
{code}
Notice how we use next to tell forge that we want the following inputs on the next page.
Or maybe you can specify the title also as:
{code}
builder.add(one).add(to).nextWithTitle("Configure foo
stuff").add(three).add(four).nextWithTitle("Configure bar
stuff").add(five);
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)