1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.myfaces.tobago.facelets;
21
22 import javax.el.ValueExpression;
23 import javax.faces.component.UIComponent;
24 import javax.faces.view.facelets.ComponentConfig;
25 import javax.faces.view.facelets.FaceletContext;
26 import javax.faces.view.facelets.TagAttribute;
27
28 public class WizardComponentHandler extends TobagoComponentHandler {
29
30 private TagAttribute outcomeAttribute;
31
32 public WizardComponentHandler(ComponentConfig componentConfig) {
33 super(componentConfig);
34 outcomeAttribute = getAttribute("outcome");
35 }
36
37 public void onComponentCreated(FaceletContext faceletContext, UIComponent wizard, UIComponent parent) {
38
39 if (outcomeAttribute != null) {
40 if (outcomeAttribute.isLiteral()) {
41 wizard.getAttributes().put("outcome", outcomeAttribute.getValue(faceletContext));
42 } else {
43 ValueExpression expression = outcomeAttribute.getValueExpression(faceletContext, String.class);
44 wizard.setValueExpression("outcome", expression);
45 }
46 }
47
48 super.onComponentCreated(faceletContext, wizard, parent);
49 }
50
51 }