use of com.github.bordertech.wcomponents.examples.common.SimpleTableBean in project wcomponents by BorderTech.
the class WListExample method preparePaintComponent.
/**
* Override preparePaintComponent to perform initialisation the first time through.
*
* @param request the request being responded to.
*/
@Override
public void preparePaintComponent(final Request request) {
if (!isInitialised()) {
List<SimpleTableBean> items = new ArrayList<>();
items.add(new SimpleTableBean("A", "none", "thing"));
items.add(new SimpleTableBean("B", "some", "thing2"));
items.add(new SimpleTableBean("C", "little", "thing3"));
items.add(new SimpleTableBean("D", "lots", "thing4"));
for (WList list : lists) {
list.setData(items);
}
setInitialised(true);
}
}
use of com.github.bordertech.wcomponents.examples.common.SimpleTableBean in project wcomponents by BorderTech.
the class AjaxWPaginationExample method preparePaintComponent.
/**
* Override preparePaintComponent in order to set up the example data the first time through.
*
* @param request the request being responded to.
*/
@Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
if (!isInitialised()) {
List<Serializable> items = new ArrayList<>();
items.add(new SimpleTableBean("A", "none", "thing"));
items.add(new SimpleTableBean("B", "some", "thing2"));
items.add(new SimpleTableBean("C", "little", "thing3"));
items.add(new SimpleTableBean("D", "lots", "thing4"));
items.add(new SimpleTableBean("E", "none", "thing5"));
items.add(new SimpleTableBean("F", "some", "thing6"));
items.add(new SimpleTableBean("G", "little", "thing7"));
items.add(new SimpleTableBean("H", "lots", "thing8"));
items.add(new SimpleTableBean("I", "none", "thing9"));
items.add(new SimpleTableBean("J", "some", "thing10"));
items.add(new SimpleTableBean("K", "little", "thing11"));
items.add(new SimpleTableBean("L", "lots", "thing12"));
table.setDataModel(new SimpleBeanListTableDataModel(new String[] { "name", "type", "thing" }, items));
setInitialised(true);
}
}
use of com.github.bordertech.wcomponents.examples.common.SimpleTableBean in project wcomponents by BorderTech.
the class WListOptionsExample method applySettings.
/**
* Apply settings is responsible for building the list to be displayed and adding it to the container.
*/
private void applySettings() {
container.reset();
WList list = new WList((com.github.bordertech.wcomponents.WList.Type) ddType.getSelected());
List<String> selected = (List<String>) cgBeanFields.getSelected();
SimpleListRenderer renderer = new SimpleListRenderer(selected, cbRenderUsingFieldLayout.isSelected());
list.setRepeatedComponent(renderer);
list.setSeparator((Separator) ddSeparator.getSelected());
list.setRenderBorder(cbRenderBorder.isSelected());
container.add(list);
List<SimpleTableBean> items = new ArrayList<>();
items.add(new SimpleTableBean("A", "none", "thing"));
items.add(new SimpleTableBean("B", "some", "thing2"));
items.add(new SimpleTableBean("C", "little", "thing3"));
items.add(new SimpleTableBean("D", "lots", "thing4"));
list.setData(items);
list.setVisible(cbVisible.isSelected());
}
Aggregations