]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Update uses list functionality
authormka <mka@opencascade.com>
Thu, 12 Dec 2013 14:48:20 +0000 (14:48 +0000)
committermka <mka@opencascade.com>
Thu, 12 Dec 2013 14:48:20 +0000 (14:48 +0000)
Workspace/Siman/WebContent/study/importDocument.jsp
Workspace/Siman/WebContent/study/usesList.jsp [new file with mode: 0644]
Workspace/Siman/src/org/splat/simer/ImportDocumentAction.java
Workspace/Siman/src/struts.xml

index 3a715bd7935ef3dd4e1c9f807feb1346eae3a020..ee3f104d3d811388c1498e82f1877f74aa14adbf 100644 (file)
@@ -42,6 +42,19 @@ $(document).ready(function () {
           }
        });
 });
+
+$(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
@@ -85,19 +98,20 @@ $(document).ready(function () {
                <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>
diff --git a/Workspace/Siman/WebContent/study/usesList.jsp b/Workspace/Siman/WebContent/study/usesList.jsp
new file mode 100644 (file)
index 0000000..d426c22
--- /dev/null
@@ -0,0 +1,17 @@
+<%@ 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>
+
index 3381631ca28d9e9789ab9663e79ad328e5c8716b..ed307e2ce165b5d59030d58c0df6e3de9a8c0312 100644 (file)
@@ -59,6 +59,21 @@ public class ImportDocumentAction extends BaseUploadDocumentAction {
         */
        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.
         * 
@@ -446,4 +461,4 @@ public class ImportDocumentAction extends BaseUploadDocumentAction {
        public List<Boolean> getReviewable() {
                return _reviewable;
        }
-}
\ No newline at end of file
+}
index 5b0a0c750d6cc47556dd59a624189684b2dae75b..add83ea64d212facfac6f3b4c59e174557c5c3d2 100644 (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"/>