}
create.projectContext.focus();
}
+
+ function setDefaultSelection() {
+ tds = document.getElementById("select");
+ tde = document.getElementById("enter");
+ tds.style.display = "block"; // Hides the select input
+ tde.style.display = "none"; // Displays the text input
+
+ create.projectContextId.value = -1;
+ create.projectContextId.focus();
+ }
$(document).ready(function() {
<s:if test="projectContextValues.size > 0">
event.preventDefault(); //cross-browser solution
}
});
-
- function setDefaultSelection()(event) {
- tds = document.getElementById("select");
- tde = document.getElementById("enter");
- tds.style.display = "block"; // Hides the select input
- tde.style.display = "none"; // Displays the text input
-
- create.projectContextId.value = -1;
- create.projectContextId.focus();
-
- //hide back button
- }
});
-
-
</script>
<!-- New study dialog
</s:iterator>
</optgroup>
</select></td>
- <td id="enter" style="display: none"><s:textfield
- theme="simple" size="30" name="projectContext" /></td>
+ <td id="enter" style="display: none">
+ <s:textfield theme="simple" size="30" name="projectContext" />
+ <img src="<s:url value="/skin/icon.undo.png"/>" border="none"
+ title="<s:text name="tooltip.cancel"/>"
+ onclick="setDefaultSelection()"/>
+ </td>
</s:if>
<s:else>
<td><s:hidden name="projectContextId" value="0" /> <s:textfield
}
}
if (_exports == null) {
- List<Relation> relation = _mydoc
- .getRelations(ConvertsRelation.class);
-
- _exports = new ArrayList<FileFacade>(relation.size());
- for (Iterator<Relation> i = relation.iterator(); i.hasNext();) {
- ConvertsRelation export = (ConvertsRelation) i.next();
- _exports.add(new FileFacade(export,
- getApplicationSettings()));
- }
+ updateExports();
}
if (_history == null) {
if (_mydoc.getPreviousVersion() != null
_display = State.open;
}
}
+
+ /**
+ * Update the list of export files.
+ */
+ private void updateExports() {
+ List<Relation> relations = _mydoc
+ .getRelations(ConvertsRelation.class);
+
+ _exports = new ArrayList<FileFacade>(relations.size());
+ for (Relation rel : relations) {
+ _exports.add(new FileFacade((ConvertsRelation)rel,
+ getApplicationSettings()));
+ }
+ }
/**
* Close the presentation tree partially.
_version = verstring.format(_version);
_size = sizstring.format(_mydoc.getSourceFile().asFile().length() / 1000);
_date = datstring.format(_mydoc.getLastModificationDate());
-
+ updateExports();
// Refresh of the history in case of promotion
if (_display == State.deepopen) {
_history.clear();
KnowledgeElement kelm = scene.getKnowledgeElement(Integer
.valueOf(_myindex));
getScenarioService().removeKnowledgeElement(scene, kelm); // The knowledge element necessarily exists
-
- _openStudy.remove(kelm);
- updateMenu();
-
+
+ if (_selection == null) { // Opening a study just newed
+ _selection = _openStudy.getSelection(); // Default selection
+ }
+ _openStudy = open(getStudyService().selectStudy(
+ _openStudy.getIndex())); // Closes the previously open study
+ _openStudy.setSelection(_selection);
+
return SUCCESS;
}