1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import org.kuali.rice.krad.uif.component.Component;
22 import org.kuali.rice.krad.uif.container.GroupBase;
23 import org.kuali.rice.krad.uif.util.LifecycleElement;
24 import org.kuali.rice.krad.web.form.UifFormBase;
25
26 public class WizardGroup extends GroupBase {
27
28 @Override
29 public void performApplyModel(Object model, LifecycleElement parent) {
30 UifFormBase form = (UifFormBase) model;
31
32 String stepStr = form.getActionParameters().get(this.getId()+".step");
33 Integer step = 0;
34
35 if (stepStr != null && stepStr.matches("\\d")) {
36 step = Integer.valueOf(stepStr);
37 }
38
39 List<Component> currentItems = new ArrayList<Component>();
40 for (int i = 0, len = getItems().size(); i < len; i++) {
41 Component component = getItems().get(i);
42
43 if (i == step) {
44 currentItems.add(component);
45 }
46 }
47
48 setItems(currentItems);
49
50 super.performApplyModel(model, parent);
51 }
52 }