アプリケーションで SimplePager を使用し、その表示を HasRows を実装するカスタム ウィジェットに設定しようとしていますが、SimplePager が表示されません。
UiBinder スニペットは次のとおりです。
<g:LayoutPanel ui:field="mainPanel" styleName="{style.panel}">
<!-- OTHER LAYERS CONTAINING DATA CONTAINERS (ROWS) -->
<g:layer left="0%" width="30%" top="0px" height="200px">
...
</g:layer>
...
<!-- LAYER CONTAINING SimplePager -->
<g:layer left="0px" right="0px" top="400px" height="50px">
<cv:SimplePager ui:field="pager" />
</g:layer>
</g:LayoutPanel>
カスタム ウィジェット クラスは次のとおりです。
public class MyCustomWidget extends Composite implements HasRows {
private static final int NUM_ROWS = 3;
private static MyCustomWidgetUiBinder uiBinder = GWT.create(MyCustomWidgetUiBinder.class);
public interface MyCustomWidgetUiBinder extends UiBinder<Widget, MyCustomWidget> {
}
@UiField LayoutPanel mainPanel;
@UiField(provided = true) SimplePager pager;
public MyCustomWidget() {
// create and initialize SimplePager
SimplePager.Resources resources = GWT.create(SimplePager.Resources.class);
pager = new SimplePager(TextLocation.CENTER, resources, false, 0, true);
pager.setDisplay(this);
pager.setPageSize(NUM_ROWS);
initWidget(uiBinder.createAndBindUi(this));
}
...
// HasRows implementations, etc.
}
データは表示されており、ページャーの hasNextPage() メソッドは true を返しますが、SimplePager は表示されません。なんで?