1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.demo.layout;
17
18 import org.kuali.rice.krad.uif.component.Component;
19 import org.kuali.rice.krad.uif.container.PageGroup;
20 import org.kuali.rice.krad.uif.control.Control;
21 import org.kuali.rice.krad.uif.field.InputField;
22 import org.kuali.rice.krad.uif.service.impl.ViewHelperServiceImpl;
23 import org.kuali.rice.krad.uif.util.ComponentFactory;
24 import org.kuali.rice.krad.uif.view.View;
25
26 import java.util.ArrayList;
27 import java.util.List;
28
29
30
31
32 public class UifGeneratedTestViewHelperServiceImpl extends ViewHelperServiceImpl {
33
34 @Override
35 protected void performCustomInitialization(View view, Component component) {
36 super.performCustomInitialization(view, component);
37 List<Component> fields = new ArrayList<Component>();
38 if(component instanceof PageGroup && component.getId().equals("UifGeneratedFields-Page1")){
39 for(int i=0; i < 400; i++){
40 InputField field = ComponentFactory.getInputField();
41 view.assignComponentIds(field);
42 Control control = ComponentFactory.getTextControl();
43 view.assignComponentIds(control);
44 field.setControl(control);
45 field.setPropertyName("field1");
46 field.setLabel("Field");
47 field.setRequired(true);
48 fields.add(field);
49 }
50 ((PageGroup) component).setItems(fields);
51 }
52
53 }
54 }