Salome HOME
Fix for a study creation with a new simulation context when no "product" context...
authorrkv <rkv@opencascade.com>
Tue, 2 Apr 2013 18:39:23 +0000 (18:39 +0000)
committerrkv <rkv@opencascade.com>
Tue, 2 Apr 2013 18:39:23 +0000 (18:39 +0000)
Workspace/Siman/WebContent/study/newStudy.jsp
Workspace/Siman/src/org/splat/simer/NewStudyAction.java

index 34d5e8c13ed37aa614236004c6b7a5bef5e5c17b..7fada946e6fd08c1f39864fcd492be8186658557 100644 (file)
@@ -1,92 +1,96 @@
 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
-    pageEncoding="ISO-8859-1"%>
+       pageEncoding="ISO-8859-1"%>
 <%@ taglib prefix="s" uri="/struts-tags"%>
 <%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
-<tiles:importAttribute name="valid_action" scope="request"/>
+<tiles:importAttribute name="valid_action" scope="request" />
 
 <script language="JavaScript">
-    function initialize() {
-        create.elements[0].focus();
-    }
+       function initialize() {
+               create.elements[0].focus();
+       }
 
-    function setValue() {
-        var select = create.projectContextId.value; // contextValue select input
-        if (select == "0") { // Creation of a new context type
-            tds = document.getElementById("select");
-            tde = document.getElementById("enter");
-            tds.style.display = "none"; // Hides the select input
-            tde.style.display = "block"; // Displays the text input
-        }
-        create.projectContext.focus();
-    }
-    
-    $(document).ready(function () {
-        create.projectContextId.value = <s:property value="projectContextId"/>;
-        setValue();
-    });
+       function setValue() {
+               var select = create.projectContextId.value; // contextValue select input
+               if (select == "0") { // Creation of a new context type
+                       tds = document.getElementById("select");
+                       tde = document.getElementById("enter");
+                       tds.style.display = "none"; // Hides the select input
+                       tde.style.display = "block"; // Displays the text input
+               }
+               create.projectContext.focus();
+       }
+
+       $(document).ready(function() {
+        <s:if test="projectContextValues.size > 0">
+               create.projectContextId.value = <s:property value="projectContextId"/>;
+        </s:if>
+               setValue();
+       });
 </script>
 
 <!-- New study dialog
      ===========================================================================
   -->
 <div id="article-box">
-    <div id="section">
-        <s:text name="title.newstudy" />
-    </div>
-    <div id="top-spacer"></div>
-    <form id="create" name="create" action="<tiles:getAsString name="input_action"/>" method="post">
-        <table class="text">
+       <div id="section">
+               <s:text name="title.newstudy" />
+       </div>
+       <div id="top-spacer"></div>
+       <form id="create" name="create"
+               action="<tiles:getAsString name="input_action"/>" method="post">
+               <table class="text">
+
+                       <tr class="error">
+                               <td colspan="3"><s:text name="%{error}" /></td>
+                       </tr>
 
-            <tr class="error">
-                <td colspan="3"><s:text name="%{error}" /></td>
-            </tr>
+                       <tr>
+                               <td>&nbsp;<s:text name="field.studytitle" />*:&nbsp;
+                               </td>
+                               <td><s:textfield theme="simple" size="60" name="title" /></td>
+                       </tr>
 
-            <tr>
-                <td>&nbsp;<s:text name="field.studytitle" />*:&nbsp;
-                </td>
-                <td><s:textfield theme="simple" size="60" name="title" /></td>
-            </tr>
+                       <tr>
+                               <td>&nbsp;<s:text name="field.product" />*:&nbsp;
+                               </td>
+                               <s:if test="projectContextValues.size > 0">
+                                       <td id="select"><select name="projectContextId"
+                                               style="width: 214px" onChange="setValue()">
+                                                       <option value="-1">
+                                                               <s:text name="menu.select" />
+                                                       </option>
+                                                       <option value="0">
+                                                               &nbsp;
+                                                               <s:text name="menu.newproduct" />
+                                                       </option>
+                                                       <optgroup label="&nbsp;<s:text name="label.products"/>">
+                                                               <s:iterator value="projectContextValues">
+                                                                       <option value="<s:property value="index"/>">
+                                                                               &nbsp;
+                                                                               <s:property value="value" />
+                                                                       </option>
+                                                               </s:iterator>
+                                                       </optgroup>
+                                       </select></td>
+                                       <td id="enter" style="display: none"><s:textfield
+                                                       theme="simple" size="30" name="projectContext" /></td>
+                               </s:if>
+                               <s:else>
+                                       <td><s:hidden name="projectContextId" value="0" /> <s:textfield
+                                                       theme="simple" size="30" name="projectContext" /></td>
+                               </s:else>
+                       </tr>
+                       <tiles:insertAttribute name="source_study" ignore="true" />
 
-            <tr>
-                <td>&nbsp;<s:text name="field.product" />*:&nbsp;
-                </td>
-                <s:if test="projectContextValues.size > 0">
-                    <td id="select"><select name="projectContextId"
-                        style="width: 214px" onChange="setValue()">
-                            <option value="-1">
-                                <s:text name="menu.select" />
-                            </option>
-                            <option value="0">
-                                &nbsp;
-                                <s:text name="menu.newproduct" />
-                            </option>
-                            <optgroup label="&nbsp;<s:text name="label.products"/>">
-                                <s:iterator value="projectContextValues">
-                                    <option value="<s:property value="index"/>">
-                                        &nbsp;
-                                        <s:property value="value" />
-                                    </option>
-                                </s:iterator>
-                            </optgroup>
-                    </select></td>
-                    <td id="enter" style="display: none"><s:textfield
-                            theme="simple" size="30" name="projectContext" /></td>
-                </s:if>
-                <s:else>
-                    <td><s:hidden name="projectContextId" value="0" /> <s:textfield
-                            size="30" name="projectContext" /></td>
-                </s:else>
-            </tr>
-                <tiles:insertAttribute name="source_study" ignore="true" />
-            
-            <tr>
-                <td align="right" colspan="2"><s:submit action="%{#request.valid_action}"
-                        theme="simple" type="button" key="button.newstudy" /></td>
-            </tr>
+                       <tr>
+                               <td align="right" colspan="2"><s:submit
+                                               action="%{#request.valid_action}" theme="simple" type="button"
+                                               key="button.newstudy" /></td>
+                       </tr>
 
-        </table>
-    </form>
-    <div id="top-spacer"></div>
+               </table>
+       </form>
+       <div id="top-spacer"></div>
 </div>
 
 <!-- Reserved
index 2058b0881a14a8463403cbc29c083e4573e763aa..83cbd61c002b4cb0bf66c696596c321f3efe4469 100644 (file)
@@ -100,7 +100,7 @@ public class NewStudyAction extends Action {
                        // Title empty, simply wait for input without error message
                        res = INPUT;
                } else {
-                       String value; // if new a project context has to be created
+                       String value; // if a new project context has to be created
                        if (_projectContextId == 0) {
                                value = _projectContext.trim();
                                if (value.length() == 0) {