0
我想根据从数据库检索日期使用RPC绘制图表。gwt-RPC问题!什么是使用gwt-RPC的最佳实践?
但每次我都没有得到结果。我的rpc功能正在工作。
我认为是过程的顺序。下面
是我的课:
public class TrafficPattern_1 extends GChart {
TrafficPattern_1() {
final DBServiceAsync dbService = GWT
.create(DBService.class);
dbService.SendData(null, null,
new AsyncCallback<Container_TrafficPattern>() {
@Override
public void onFailure(Throwable caught) {
}
@Override
public void onSuccess(Container_TrafficPattern result) {
// TODO Auto-generated method stub
pContainer.SetaDate(result.aDate.get(1));
}
});
pContainer.aDate.get(0);
setChartSize(350, 200);
setChartTitle("<h2>Temperature vs Time<h2>");
setPadding("8px");
//setPixelSize(380, 200);
getXAxis().setAxisLabel("<small><b><i>Time</i></b></small>");
getXAxis().setHasGridlines(true);
getXAxis().setTickCount(6);
// Except for "=(Date)", a standard GWT DateTimeFormat string
getXAxis().setTickLabelFormat("=(Date)h:mm a");
getYAxis().setAxisLabel("<small><b><i>°C</i></b></small>");
getYAxis().setHasGridlines(true);
getYAxis().setTickCount(11);
getYAxis().setAxisMin(11);
getYAxis().setAxisMax(16);
addCurve();
getCurve().setLegendLabel("<i> </i>");
getCurve().getSymbol().setBorderColor("blue");
getCurve().getSymbol().setBackgroundColor("blue");
// getCurve().getSymbol().setFillSpacing(10);
// getCurve().getSymbol().setFillThickness(3);
getCurve().getSymbol().setSymbolType(SymbolType.LINE);
getCurve().getSymbol().setFillThickness(2);
getCurve().getSymbol().setFillSpacing(1);
for (int i = 0; i < dateSequence.length; i++)
// Note that getTime() returns milliseconds since
// 1/1/70--required whenever "date cast" tick label
// formats (those beginning with "=(Date)") are used.
getCurve().addPoint(dateSequence[i].date.getTime(),
dateSequence[i].value);
}
添加更多细节。从你的问题来看,人们无法理解实际的问题。什么不工作?它是否会抛出异常?... – Juri 2010-02-04 10:32:52
当我调用pContainer.aDate.get(0)时,它会提示我一个错误。 我把pContainer.aDate.get(0)和另一个RPC函数中的2个断点放在一个。我发现它运行pContainer.aDate.get(0)1st。 所以我不能得到的数据。 – guaz 2010-02-04 10:35:48