1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package edu.sampleu.travel.krad.controller; |
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 | 0 | public class UIfComponentsViewHelperServiceImpl extends ViewHelperServiceImpl { |
36 | |
|
37 | |
public List<RemotableAttributeField> retrieveRemoteFields(View view, Object model, Container container) { |
38 | 0 | List<RemotableAttributeField> remoteFields = new ArrayList<RemotableAttributeField>(); |
39 | |
|
40 | |
|
41 | 0 | RemotableAttributeField.Builder builder = RemotableAttributeField.Builder.create("remoteField1"); |
42 | 0 | builder.setLongLabel("Remote Field 1"); |
43 | |
|
44 | 0 | RemotableTextInput.Builder controlBuilder = RemotableTextInput.Builder.create(); |
45 | 0 | controlBuilder.setSize(30); |
46 | 0 | builder.setControl(controlBuilder); |
47 | 0 | remoteFields.add(builder.build()); |
48 | |
|
49 | 0 | builder.setName("remoteField2"); |
50 | 0 | builder.setLongLabel("Remote Field 2"); |
51 | 0 | remoteFields.add(builder.build()); |
52 | |
|
53 | 0 | controlBuilder.setSize(5); |
54 | 0 | builder.setName("remoteField3"); |
55 | 0 | builder.setLongLabel("Remote Field 3"); |
56 | 0 | remoteFields.add(builder.build()); |
57 | |
|
58 | 0 | Map<String, String> options = new HashMap<String, String>(); |
59 | 0 | options.put("Fruit", "Fruit"); |
60 | 0 | options.put("Vegetables", "Vegetables"); |
61 | |
|
62 | 0 | RemotableSelect.Builder selectBuilder = RemotableSelect.Builder.create(options); |
63 | 0 | builder.setName("remoteField4"); |
64 | 0 | builder.setLongLabel("Remote Field 4"); |
65 | 0 | builder.setControl(selectBuilder); |
66 | 0 | remoteFields.add(builder.build()); |
67 | |
|
68 | 0 | return remoteFields; |
69 | |
} |
70 | |
|
71 | |
} |