0

I am getting this module 'tdlat.AllTasks' may need to be (re)compiled, when I link from my home page (ToDoList.html) to my 'AllTasks' page (AllTasks.html). But when I run directly from the AllTasks page I do not get this error. I am running this in Development Mode.

FILES PACKAGE
enter image description here

Error

Code where the URL links to the error

Anchor link = new Anchor(true);
horizontalPanel_1.add(link);
link.setHTML("All Tasks");
link.setHref("AllTasks.html");

My link is linked to a separate module.

EDIT

link.setHref("AllTasks.html?gwt.codesvr=127.0.0.1:9997")

Fixed my problem, but I am not too sure how to make this work also in production mode. Here is what I have so far.

if (GWT.isProdMode()){
    // What goes here? Thanks!      
}
else
{
    link.setHref("AllTasks.html?gwt.codesvr=127.0.0.1:9997");
}

Thank you for the assistance! Please let me know if there is any confusion.

Community
  • 1
  • 1
AustinT
  • 1,998
  • 8
  • 40
  • 63
  • you may need to do `link.setHref("AllTasks.html?gwt.codesvr=127.0.0.1:9997")` for development mode (you can check this using `GWT.isProdMode()`). I'm not sure if this really is the problem, which is why this a comment, not an answer. But it doesn't hurt either way, especially if you plan to debug it. – MarioP Apr 23 '13 at 17:06
  • Thank you, I tried that and I am still getting the same error. – AustinT Apr 23 '13 at 17:09
  • 1
    I just corrected an error, i wrote "codesrv", "codesvr" would be correct. – MarioP Apr 23 '13 at 17:10
  • Thanks that did fix the problem. How would I make this work for Production mode also? Thanks! – AustinT Apr 23 '13 at 17:15
  • if (GWT.isProdMode()){ What would go here? }else { link.setHref("AllTasks.html?gwt.codesvr=127.0.0.1:9997"); } – AustinT Apr 23 '13 at 17:18
  • made it an answer and explained it further. – MarioP Apr 23 '13 at 17:21

1 Answers1

2

In development mode, you need to append the parameter gwt.codesvr. So, you can use

if(GWT.isProdMode()) {
   link.setHref("AllTasks.html");
} else {
   link.setHref("AllTasks.html?gwt.codesvr=127.0.0.1:9997");
}

GWT.isProdMode() returns true in production mode and false when in development mode (127.0.0.1:8888) and is optimized by the GWT compiler, so everything in the else doesn't show up in the resulting JavaScript code, as if you just wrote link.setHref("AllTasks.html"). It is a neat tool for all kind of analyzing things in DevMode, without slowing down the production system.

MarioP
  • 3,752
  • 1
  • 23
  • 32