JAVA Apache Wicket Grid Setup

The ShieldUI Grid Apache Wicket component offers streamlined setup and deployment of our libraries.

Since it is a wrapper of our javascript Grid component, you need to include the references to the CSS and JavaScript resources in the HEAD section of your webpage:

<!DOCTYPE html>
<html>
<head>
<title>Shield Grid</title>
<meta charset="utf-8" />

<link rel="stylesheet" type="text/css" href="css/light/all.min.css" />
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/shieldui-all.min.js"></script>

</head>
<body>
    <div wicket:id="grid"></div>
</body>
</html>

Then init the grid and add it to your wicket page like in the following example:

Grid grid = new Grid("grid");
GridOptions options = grid.getOptions();

options.setData(
            new HashMap() {{
                   put("text", "Item1");
                   put("frequency", 45);
            }},
            new HashMap() {{
                   put("text", "Item2");
                   put("frequency", 45);
            }},
            new HashMap() {{
                   put("text", "Item3");
                   put("frequency", 60);
            }});
options.getPaging().setPageSize(12).setPageLinksCount(10);
options.setAltRows(false);
options.setColumns(
                new GridOptions.ColumnOption().setField("text")),
                new GridOptions.ColumnOption().setField("frequency"))
        );
options.setColumnReorder(true);
options.setResizing(true);

add(grid);

To see more information on this wrapper, please refer to the following startup guide.