}
});
});
+
+$(document).ready(function () {
+ $("#bring #documentType").change(function () {
+ $.ajax({
+ type: 'POST',
+ url:'update-uses.action?documentType=' + $('#documentType').val(),
+ success: function(data){
+ $("#bring .dynamic").remove();
+ $(data).insertBefore("#bring .inner");
+ }
+ });
+ }
+)}).change();
</script>
<!-- Import dialog
<td><s:textfield theme="simple" id="documentName"
name="documentName" disabled="true" /></td>
</tr>
- <s:if test="defaultDocumentUses.size > 0">
- <tr>
- <td align="right"><s:text name="label.uses" />:</td>
- </tr>
- <s:iterator value="defaultDocumentUses">
- <tr>
- <td align="right"><input type="checkbox" name="uses"
- value="<s:property value="index"/>" checked></td>
- <td><s:property value="title" /></td>
- </tr>
- </s:iterator>
- </s:if>
- <tr height="10">
+ <s:if test="defaultDocumentUses.size > 0">
+ <tr class="dynamic">
+ <td align="right"><s:text name="label.uses" />:</td>
+ </tr>
+ <s:iterator value="defaultDocumentUses">
+ <tr class=dynamic>
+ <td align="right"><input type="checkbox" name="uses"
+ value="<s:property value="index"/>" checked></td>
+ <td><s:property value="title" /></td>
+ </tr>
+ </s:iterator>
+ </s:if>
+
+ <tr height="10" class ="inner">
<td></td>
</tr>
<tr>
--- /dev/null
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+<%@ taglib prefix="s" uri="/struts-tags"%>
+
+<s:if test="defaultDocumentUses.size > 0">
+ <tr class = dynamic>
+ <td align="right"><s:text name="label.uses" />:</td>
+ </tr>
+ <s:iterator value="defaultDocumentUses">
+ <tr class = dynamic>
+ <td align="right"><input type="checkbox" name="uses"
+ value="<s:property value="index"/>" checked></td>
+ <td><s:property value="title" /></td>
+ </tr>
+ </s:iterator>
+</s:if>
+
*/
private DocumentTypeService _documentTypeService;
+ /**
+ * Update uses documents list if chosen new type of import document.
+ * @return SUCCESS
+ */
+ public final String updateUsesList() {
+ _mystudy = getOpenStudy();
+ _defuses = new ArrayList<Document>();
+ _deftype = getDocumentTypeService().selectType(
+ (int) _documentType);
+ if (_deftype != null) {
+ setupDefaultUses(_deftype);
+ }
+ return SUCCESS;
+ }
+
/**
* Initialize the operation.
*
public List<Boolean> getReviewable() {
return _reviewable;
}
-}
\ No newline at end of file
+}
</result>
<result name="error" type="tiles">page.importerror</result>
</action>
+ <action name="update-uses" class="importDocumentAction"
+ method="updateUsesList">
+ <result name="success" type="dispatcher">
+ /study/usesList.jsp
+ </result>
+ </action>
<action name="valid-import" class="importDocumentAction"
method="import">
<interceptor-ref name="simanBasicStack"/>