Sunday, October 16, 2011

Re: SimplePager in CellTable on a DialogBox using UiBinder

In initTableColumns you are assigning pager to a new SimplePager. Get
rid of that line and it might work.

On Oct 14, 9:52 am, jgm <j...@glusted.dk> wrote:
> Dont't know why it was posted 4 times :-(
>
> On 14 Okt., 15:48, jgm <j...@glusted.dk> wrote:
>
>
>
> > Hi,
>
> > We are having problems getting the SimplePager to work.
> > The pager is shown, but it doesn't work - as if it is not initialized
> > correctly with the data, somehow.
>
> > The java code looks like this:
>
> > public class RunProgressPopupPanel extends DialogBox {
>
> >         private final String dateFormat = "yyyy.MM.dd HH:mm:ss";
>
> >         public interface Binder extends UiBinder<Widget,
> > RunProgressPopupPanel> {}
> >         private static Binder uiBinder = GWT.create(Binder.class);
> >         private ListDataProvider<StepProgress> dataProvider = new
> > ListDataProvider<StepProgress>();
>
> >         @UiField CellTable<StepProgress> cellTable;
> >         @UiField SimplePager pager;
>
> >         // (provided = true)
>
> >         public RunProgressPopupPanel(){
> >                 super(false, Global.POPUPS_ARE_MODAL);
> >                 setWidget(uiBinder.createAndBindUi(this));
>
> >                 initTableColumns();
> >         }
>
> >         private void initTableColumns(){
> >                 // Connect the table to the data provider.
> >                 dataProvider.addDataDisplay(cellTable);
>
> >                 //SimplePager.Resources pagerResources =
> > GWT.create(SimplePager.Resources.class);
> >                 //pager = new SimplePager(TextLocation.CENTER, pagerResources,
> > false, 0, true);
>
> >                 pager = new SimplePager();
> >                 pager.setRangeLimited(false);
> >                 pager.setDisplay(cellTable);
> >         //pager.setPageSize(10);
>
> >                ---
> >                ---
> >                 ---
>
> >         public void show(String title, RunProgress p){
> >                 this.setText(title);
>
> >                 if (dataProvider.getDataDisplays() == null ||
> > dataProvider.getDataDisplays().isEmpty()) {
> >                         dataProvider.addDataDisplay(cellTable);
> >                 }
> >                 dataProvider.getList().clear();
> >                 dataProvider.getList().addAll(p.steps);
> >                 cellTable.setRowCount(p.steps.size());
> >                 GWT.log("p.steps:"+ p.steps.size());
> >             cellTable.redraw();
>
> >             this.setPopupPosition(400, 200);
> >             this.show();
> >         }
>
> >         public void updateProgress(RunProgress p) {
> >                 dataProvider.getList().clear();
> >                 dataProvider.getList().addAll(p.steps);
> >                 GWT.log("p.steps:"+ p.steps.size());
> >                 cellTable.setRowCount(p.steps.size());
> >             cellTable.redraw();
> >         }
>
> > The UIBinder xml looks like this:
>
> > <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
> >         xmlns:g="urn:import:com.google.gwt.user.client.ui"
> >         xmlns:c="urn:import:com.google.gwt.user.cellview.client">
>
> >         <g:HTMLPanel>
> >                 <g:VerticalPanel horizontalAlignment="center" spacing='10'
> > width="700px">
> >                         <c:CellTable width="100%" ui:field="cellTable" pageSize='6'/>
> >                         <c:SimplePager ui:field="pager" location="CENTER"/>
> >                         <g:Button ui:field="btnOk">Ok</g:Button>
> >                 </g:VerticalPanel>
> >         </g:HTMLPanel>
> > </ui:UiBinder>

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate