From: Dev W. <wo...@an...> - 2007-05-10 19:12:02
|
OK Guido, I'm not too far I think thanks to your help. I only need to finish my custom task class... Do I have to overwrite pageForResult if I want to "stay" in my "normal" component or overwriting performAction is enough? Thanks again Xavier > On 10.05.2007, at 10:07, Dev Wonder wrote: > >> Hum, your ERXLongResponse is a WOComponent you created which >> extends ERXLongResponse am I right? > > Nope. I have a "normal" page. Nothing fancy. No long response > stuff. I create HTML like that: > > <webobject name="PageWrapper"> > <webobject name="TaskIsNotDoneConditional"> > <webobject name="LongRunningTask"></webobject> > Importing file: <webobject name="CurrentFileName"></ > webobject><br><br> > This page will refresh itself. Please don't leave this page!<br> > Wait, until the import is done, this will take a couple of minutes. > </webobject> > <webobject name="TaskIsDoneConditional"> > Done ... > </webobject> > </webobject> > > and the wod: > > PageWrapper : PageWrapper { > > } > > LongRunningTask : ERXLongResponse { > task = task; > refreshInterval = 10; > } > > TaskIsDoneConditional : WOConditional { > condition = task.isDone; > } > > TaskIsNotDoneConditional : WOConditional { > condition = task.isDone; > negate = true; > } > > CurrentFileName : WOString { > value = task.currentFilename; > } > > In the Java file: > > public class MyPage extends EVPage { > > private MyTask task; > > public MyPage(WOContext context) { > super(context); > > this.task = new MyTask(); > } > > public void setFiles(NSArray files) { > this.task.setFiles(files); > } > > public MyTask task() { > return this.task; > } > > public void setTask(MyTask task) { > this.task = task; > } > > } > > And that's it. The main implementation is in the task. > >> And MyCustomTask class extends >> ERXLongResponseTask.DefaultImplementation, is that correct? > > Yep. > >> That would be awesome thanks Guido:) > > I'll try. > > cug > |