ItEr46S04ValidacionEProbasFuncionaisItEr45S04: Fixing problem when moving a milestone.

Avoiding to show the resources text for a milestone since it doesn't
suppor it.
This commit is contained in:
Óscar González Fernández 2010-02-08 11:20:35 +01:00
parent 901a8300f1
commit 889027d2ea
3 changed files with 19 additions and 1 deletions

View file

@ -33,4 +33,9 @@ public class MilestoneComponent extends TaskComponent {
super(task, disabilityConfiguration);
}
@Override
protected boolean canShowResourcesText() {
return false;
}
}

View file

@ -203,16 +203,26 @@ public class TaskComponent extends Div implements AfterCompose {
@Override
public void reloadResourcesTextRequested() {
smartUpdate("resourcesText", getResourcesText());
if (canShowResourcesText()) {
smartUpdate("resourcesText", getResourcesText());
}
String cssClass = isSubcontracted() ? "box subcontracted-task"
: "box standard-task";
response("setClass", new AuInvoke(TaskComponent.this,
"setClass", cssClass));
}
};
this.task.addReloadListener(reloadResourcesTextRequested);
}
/**
* Note: This method is intended to be overridden.
*/
protected boolean canShowResourcesText() {
return true;
}
protected String calculateClass() {
String classText;
if (getSclass().equals("null")) {

View file

@ -359,6 +359,9 @@ public class TaskElementAdapter implements ITaskElementAdapter {
@Override
public String getResourcesText() {
if (taskElement.getOrderElement() == null) {
return "";
}
try {
return transactionService
.runOnAnotherReadOnlyTransaction(new IOnTransaction<String>() {