Hi Rogelio, below the code i used to create my CellTable populated by
dataset of ValueProxy, received via request factory (onClickGetList
method). I can show data in the CellTable also the pager everything work
fine. The problem occur when i want to update a row via SelectionCell, it
take a long time before update and some time i get (remote connection lost)
or (Stack overflow; to increase the stack size, use the -Xss flag at
startup (java -Xss1M ...))
To be sure which part of code cause the problem, i put a message inside
getValue method and update method, i found out an several call to getValue
method and NO call to update method.
*PS:*
- *ValueProxy (ConceptProxy) that i received do not have TypeConcept, i
want to set it via SellectionCell That's why i return **"Unknown"** if
TypeConcept == Null in getValue method*
- *My GWT app based on Activities & Places and the code below is in a
view implementation that extend Composite class and implement the view
interface.*
---------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
private final CellTable<ConceptProxy> cellTable = cellTable = new
CellTable<>();
private SimplePager pager;
private void prepareCellTable(){
cellTable.setWidth("100%", true);
cellTable.setStyleName("style.cellTable");
cellTable.setAutoHeaderRefreshDisabled(true);
cellTable.setAutoFooterRefreshDisabled(true);
TextColumn<ConceptProxy> conceptNameColumn = new TextColumn<ConceptProxy>()
{
public String getValue(ConceptProxy concept) {
return concept.getIntituleConcept();
}
};
final List<String> conceptType = new LinkedList<String>();
conceptType.add("Goal");
conceptType.add("Input");
conceptType.add("Output");
conceptType.add("Precondition");
conceptType.add("Postcondition");
List<String> conceptTypeNamesList = new LinkedList<String>();
for (String type : conceptType) {
conceptTypeNamesList.add(type);
}
SelectionCell conceptTypeSelectionCell = new
SelectionCell(conceptTypeNamesList);
Column<ConceptProxy, String> conceptTypeColumn = new Column<ConceptProxy,
String>(conceptTypeSelectionCell) {
public String getValue(ConceptProxy concept) {
System.out.println(">>concept type update method");
return (concept.getTypeConcept() == null) ? "Unknown" :
concept.getTypeConcept();
}
};
conceptTypeColumn.setFieldUpdater(new FieldUpdater<ConceptProxy, String>() {
public void update(int index, ConceptProxy concept, String value) {
System.out.println(">>concept type getValue method");
concept.setTypeConcept(value);
presenter.updateConcept(currentConceptProxy);
}
});
cellTable.addColumn(conceptNameColumn, "Concept Name");
cellTable.addColumn(conceptTypeColumn, "Concept Type");
cellTable.setPageSize(6);
SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.
class);
pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0,true);
pager.setDisplay(cellTable);
}
@UiHandler("getList")
public void onClickGetList(ClickEvent event){
prepareCellTable();
Receiver<List<ConceptProxy>> rec = new Receiver<List<ConceptProxy>>() {
public void onSuccess(List<ConceptProxy> response) {
listProvider = new ListDataProvider<ConceptProxy>();
listProvider.setList(response);
listProvider.addDataDisplay(cellTable);
cellTableHolder.add(cellTable);
pagerHolder.add(pager);
classementPanel.setVisible(true);
}
};
presenter.getAllConcepts().fire(rec);
}
Le mardi 10 juin 2014 20:57:58 UTC+1, Marouan MARZOUGA a écrit :
>
> Hi everyone,
>
> I have a view that contain a cellTable populated by Proxys (type
> ValueProxy) received from server side using RequestFactory. I can display
> rows but some problems*** occur when i want to update a row via
> SelectionCell. The same example *work* when using a real model not proxy
> using GWT-RPC.
>
> ***Plenty of problem occur such as:
> + Take a long time before update.
> + Update is possible 1 time.
> + Remote connection lost.
> + Stack overflow; to increase the stack size, use the -Xss flag at
> startup (java -Xss1M ...)
>
> Is there a difference between using a real model or proxy in CellTable.
>
> Any ideas, thanks.
>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.