0 votes
2.4k views
in Coach Views by (120 points)
How to create a wizard using Coach Views

1 Answer

0 votes
by (30.6k points)

A wizard is a sequence of pages inside one client-side human service (CSHS), so the data stays in the same variable set and nothing is submitted to the server until the last page. Two ways that work well with the OOB UI Toolkit:

A. One coach, several panels, a step indicator (recommended, no round trip between steps)

  • Put the pages into a Vertical Layout per step and bind the visibility of each layout to a variable tw.local.step with a visibility rule (Visible when step == 1).
  • Use the UI Toolkit Tab Section in "hidden tabs" mode or simply Next / Back buttons that change tw.local.step in a client-side script block.
  • Validate the current step in the button handler before moving on; the Status Box / Alert controls show the messages.
// Next button, "on click" of a UI Toolkit Button: validate then move
var me = this, page = this.context; // 'page' when used inside the coach's script
if (page.ui.get("Email").getData() === "") { page.ui.get("Email").setValid(false, "Enter the e-mail address"); return; }
page.ui.get("Email").setValid(true);
${step}.setData( ${step}.getData() + 1 );   // Text control bound to tw.local.step, or use the binding directly

B. One coach per step connected in the CSHS diagram with boundary events (Next / Back). The flow is visible in the diagram, data is kept in tw.local, and you can put a service between two steps (for example a lookup). The Stay on page option of a boundary event lets a button call a service without leaving the coach.

Tips: keep all step data in one business object (tw.local.form) so that Back never loses input; show the progress with the UI Toolkit Progress Bar or a small custom "breadcrumb" (see question 3119); disable Next while a service call is running (${Next}.setEnabled(false)).

References

Related questions

0 votes
1 answer 4.0k views
0 votes
1 answer 1.5k views
0 votes
1 answer 1.2k views
0 votes
1 answer 3.1k views
0 votes
1 answer 1.1k views
0 votes
1 answer 1.6k views
0 votes
1 answer 1.7k views
0 votes
1 answer 1.6k views
0 votes
1 answer 1.5k views
0 votes
1 answer 1.9k views
0 votes
1 answer 2.4k views
0 votes
1 answer 1.2k views
0 votes
1 answer 1.2k views
0 votes
1 answer 1.0k views
+1 vote
1 answer 1.1k views
0 votes
1 answer 3.7k views

723 questions

807 answers

98 comments

4.9k users

Join BPM Community Discord Channel

Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel
...