1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.demo.kitchensink;
17
18 import org.kuali.rice.core.api.uif.RemotableAttributeField;
19 import org.kuali.rice.core.api.uif.RemotableSelect;
20 import org.kuali.rice.core.api.uif.RemotableTextInput;
21 import org.kuali.rice.krad.uif.container.Container;
22 import org.kuali.rice.krad.uif.service.impl.ViewHelperServiceImpl;
23 import org.kuali.rice.krad.uif.view.View;
24
25 import java.util.ArrayList;
26 import java.util.HashMap;
27 import java.util.List;
28 import java.util.Map;
29
30
31
32
33
34
35 public class UIfComponentsViewHelperServiceImpl extends ViewHelperServiceImpl {
36
37 public List<RemotableAttributeField> retrieveRemoteFields(View view, Object model, Container container) {
38 List<RemotableAttributeField> remoteFields = new ArrayList<RemotableAttributeField>();
39
40
41 RemotableAttributeField.Builder builder = RemotableAttributeField.Builder.create("remoteField1");
42 builder.setLongLabel("Remote Field 1");
43
44 RemotableTextInput.Builder controlBuilder = RemotableTextInput.Builder.create();
45 controlBuilder.setSize(30);
46 builder.setControl(controlBuilder);
47 remoteFields.add(builder.build());
48
49 builder.setName("remoteField2");
50 builder.setLongLabel("Remote Field 2");
51 remoteFields.add(builder.build());
52
53 controlBuilder.setSize(5);
54 builder.setName("remoteField3");
55 builder.setLongLabel("Remote Field 3");
56 remoteFields.add(builder.build());
57
58 Map<String, String> options = new HashMap<String, String>();
59 options.put("Fruit", "Fruit");
60 options.put("Vegetables", "Vegetables");
61
62 RemotableSelect.Builder selectBuilder = RemotableSelect.Builder.create(options);
63 builder.setName("remoteField4");
64 builder.setLongLabel("Remote Field 4");
65 builder.setControl(selectBuilder);
66 remoteFields.add(builder.build());
67
68 return remoteFields;
69 }
70
71 }