Re: reload celltable data

2012-02-01 Thread jgm
Hi,

Thanks for your quick answer.

We also in the meantime found out that ..

private void clearTable() {
if (dataProvider.getDataDisplays() != null &&
dataProvider.getDataDisplays().isEmpty() == false) {
dataProvider.removeDataDisplay(cellTable);
}

clearTableColumns();

cellTable.setVisibleRangeAndClearData(cellTable.getVisibleRange(),
true);
cellTable.setLoadingIndicator(imageProcessing);
}

did the trick !

On 1 Feb., 14:44, Thomas Broyer  wrote:
> AFAICT, CellTable shows the loading indicator only when the LoadingState is
> LOADING, and that one is set by the internal HasDataPresenter only when the
> known rowData is empty (and the rowCount is not 0). So I think you need to
> call setVisibleRangeAndClearData().

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



reload celltable data

2012-02-01 Thread jgm
Hi,

We are using a celltable with a ListDataProvider. The celltable is
defined via UiBinder.
When loading new data, the loadingindicator is not shown and the
celtable is not cleared.

When loading new data, we would like to reset the celltable and
dataprovider, something like this:

if (dataProvider.getDataDisplays() != null &&
dataProvider.getDataDisplays().isEmpty() == false) {
dataProvider.getList().clear();
dataProvider.removeDataDisplay(cellTable);
dataProvider.refresh();
cellTable.redraw();
}
cellTable.setLoadingIndicator(imageProcessing);

But it doesn't work!

Does anyone know how to reload data into a celltable and having the
loadingindicator shown again while the data is loaded ?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: SimplePager in CellTable on a DialogBox using UiBinder

2011-10-14 Thread jgm
Dont't know why it was posted 4 times :-(



On 14 Okt., 15:48, jgm  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 = ".MM.dd HH:mm:ss";
>
>         public interface Binder extends UiBinder RunProgressPopupPanel> {}
>         private static Binder uiBinder = GWT.create(Binder.class);
>         private ListDataProvider dataProvider = new
> ListDataProvider();
>
>         @UiField CellTable 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:
>
>          xmlns:g="urn:import:com.google.gwt.user.client.ui"
>         xmlns:c="urn:import:com.google.gwt.user.cellview.client">
>
>         
>                  width="700px">
>                          pageSize='6'/>
>                         
>                         Ok
>                 
>         
> 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



SimplePager in CellTable on a DialogBox using UiBinder

2011-10-14 Thread jgm
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 = ".MM.dd HH:mm:ss";

public interface Binder extends UiBinder {}
private static Binder uiBinder = GWT.create(Binder.class);
private ListDataProvider dataProvider = new
ListDataProvider();

@UiField CellTable 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:







Ok









-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



SimplePager in CellTable on a DialogBox using UiBinder

2011-10-14 Thread jgm
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 = ".MM.dd HH:mm:ss";

public interface Binder extends UiBinder {}
private static Binder uiBinder = GWT.create(Binder.class);
private ListDataProvider dataProvider = new
ListDataProvider();

@UiField CellTable 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:







Ok









-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



SimplePager in CellTable on a DialogBox using UiBinder

2011-10-14 Thread jgm
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 = ".MM.dd HH:mm:ss";

public interface Binder extends UiBinder {}
private static Binder uiBinder = GWT.create(Binder.class);
private ListDataProvider dataProvider = new
ListDataProvider();

@UiField CellTable 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:







Ok









-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



SimplePager in CellTable on a DialogBox using UiBinder

2011-10-14 Thread jgm
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 = ".MM.dd HH:mm:ss";

public interface Binder extends UiBinder {}
private static Binder uiBinder = GWT.create(Binder.class);
private ListDataProvider dataProvider = new
ListDataProvider();

@UiField CellTable 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:







Ok









-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Column sorting using async dataprovider in celltable

2011-09-29 Thread jgm
Forgot to mention that an example of both ListDataProvider and
AsyncDataProvider can be found here:
- http://code.google.com/intl/da/webtoolkit/doc/latest/DevGuideUiCellTable.html

We think that the sorting inside the AsyncDataProvider breaks the idea
of separation of view and data.

Or have we totally misunderstood when to use AsyncDataProvider vs
ListDataProvider? Or how sorting is implemented.

On 27 Sep., 16:41, jgm  wrote:
> Hello,
>
> We are using an async dataprovider in our celltable, and we have had
> some problemt gettting the sorting to work.
>
> In the OnRangeChanged method, we implement sorting this way:
>
> if (sortList.get(0).getColumn().equals(costManagementNameColumn)) {
>         Collections.sort(effectConfigurationCache, new
> Comparator() {
>                 public int compare(EffectConfiguration o1, 
> EffectConfiguration o2) {
>                         if (o1 == o2) {
>                                 return 0;
>                         }
>                         // Compare the cost management name columns.
>                         int diff = -1;
>                         if (o1 != null) {
>                                 diff = (o2 != null) ?
> o1.getCostManagementName().compareTo(o2.getCostManagementName()) : 1;
>                         }
>                         return sortList.get(0).isAscending() ? diff : -diff;
>                 }
>         });} else if (sortList.get(0).getColumn().equals(orgUnitNameColumn)) {
>
>         Collections.sort(effectConfigurationCache, new
> Comparator() {
>                 public int compare(EffectConfiguration o1, 
> EffectConfiguration o2) {
>                         .
>                         .
>                 }
>         });} else if 
> (sortList.get(0).getColumn().equals(effectTypeNameColumn)) {
>
>         Collections.sort(effectConfigurationCache, new
> Comparator() {
>                 public int compare(EffectConfiguration o1, 
> EffectConfiguration o2) {
>                         ..
>                         .
>                 }
>         });} else if 
> (sortList.get(0).getColumn().equals(maximumThresholdColumn))
>
> {
>         Collections.sort(effectConfigurationCache, new
> Comparator() {
>                 public int compare(EffectConfiguration o1, 
> EffectConfiguration o2) {
>                         ..
>                         .
>                 }
>         });
>
> }
>
> This seems to be quite cumbersome !
> Can this be done more elegantly?
>
> Previously we used the ListDataProvider, and here sorting is
> implemented directly on the ListHandler by setting a comparator for
> each column, wich we think is a elegant way to do it!

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Column sorting using async dataprovider in celltable

2011-09-27 Thread jgm
Hello,

We are using an async dataprovider in our celltable, and we have had
some problemt gettting the sorting to work.

In the OnRangeChanged method, we implement sorting this way:

if (sortList.get(0).getColumn().equals(costManagementNameColumn)) {
Collections.sort(effectConfigurationCache, new
Comparator() {
public int compare(EffectConfiguration o1, EffectConfiguration 
o2) {
if (o1 == o2) {
return 0;
}
// Compare the cost management name columns.
int diff = -1;
if (o1 != null) {
diff = (o2 != null) ?
o1.getCostManagementName().compareTo(o2.getCostManagementName()) : 1;
}
return sortList.get(0).isAscending() ? diff : -diff;
}
});
} else if (sortList.get(0).getColumn().equals(orgUnitNameColumn)) {
Collections.sort(effectConfigurationCache, new
Comparator() {
public int compare(EffectConfiguration o1, EffectConfiguration 
o2) {
.
.
}
});
} else if (sortList.get(0).getColumn().equals(effectTypeNameColumn)) {
Collections.sort(effectConfigurationCache, new
Comparator() {
public int compare(EffectConfiguration o1, EffectConfiguration 
o2) {
..
.
}
});
} else if (sortList.get(0).getColumn().equals(maximumThresholdColumn))
{
Collections.sort(effectConfigurationCache, new
Comparator() {
public int compare(EffectConfiguration o1, EffectConfiguration 
o2) {
..
.
}
});
}

This seems to be quite cumbersome !
Can this be done more elegantly?


Previously we used the ListDataProvider, and here sorting is
implemented directly on the ListHandler by setting a comparator for
each column, wich we think is a elegant way to do it!

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.