We're looking at various options -- improve the Java code, generate the reports off-line as static HTML, etc.
The option I'm looking at is to render this report under the operation of a WOLongResponse. I've not used this class before, so I looked at Apple's example and wrote a trivial example of my own to get a sense of how it operates. What I'm stuck on though is whether it is possible to generate a web page during a WOLongResponse with something like:
public class Slow extends WOLongResponsePage {
public Slow(WOContext context) {
super(context);
}
@Override
public Object performAction() {
WOComponent calcPage = pageWithName(Calc.class.getName());
WOContext calcCntx = calcPage.context();
return calcPage.generateResponse().contentString(); // may take a long time
}
@Override
public WOComponent refreshPageForStatus(Object o) {
return this;
}
@Override
public WOComponent pageForResult(Object result) {
WOComponent donePage = pageWithName(Done.class.getName());
donePage.takeValueForKey(result, "result");
return donePage;
}
@Override
public void appendToResponse(WOResponse aResponse, WOContext aContext) {
setRefreshInterval(3);
super.appendToResponse(aResponse, aContext);
}
}
I'm clearly confused because this doesn't work -- the generateResponse() method call fails with a null pointer exception.
The Calc component is simply:
<wo:WORepetition count = "20">x </wo:WORepetition>
I'd appreciate some help. I have this horrible suspicion that I'm making this more complicated than is required .. Thanks, Gavin