]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman/WebContent/study/newStudy.jsp
Salome HOME
Fix for a study creation with a new simulation context when no "product" context...
[tools/siman.git] / Workspace / Siman / WebContent / study / newStudy.jsp
1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2         pageEncoding="ISO-8859-1"%>
3 <%@ taglib prefix="s" uri="/struts-tags"%>
4 <%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
5 <tiles:importAttribute name="valid_action" scope="request" />
6
7 <script language="JavaScript">
8         function initialize() {
9                 create.elements[0].focus();
10         }
11
12         function setValue() {
13                 var select = create.projectContextId.value; // contextValue select input
14                 if (select == "0") { // Creation of a new context type
15                         tds = document.getElementById("select");
16                         tde = document.getElementById("enter");
17                         tds.style.display = "none"; // Hides the select input
18                         tde.style.display = "block"; // Displays the text input
19                 }
20                 create.projectContext.focus();
21         }
22
23         $(document).ready(function() {
24         <s:if test="projectContextValues.size > 0">
25                 create.projectContextId.value = <s:property value="projectContextId"/>;
26         </s:if>
27                 setValue();
28         });
29 </script>
30
31 <!-- New study dialog
32      ===========================================================================
33   -->
34 <div id="article-box">
35         <div id="section">
36                 <s:text name="title.newstudy" />
37         </div>
38         <div id="top-spacer"></div>
39         <form id="create" name="create"
40                 action="<tiles:getAsString name="input_action"/>" method="post">
41                 <table class="text">
42
43                         <tr class="error">
44                                 <td colspan="3"><s:text name="%{error}" /></td>
45                         </tr>
46
47                         <tr>
48                                 <td>&nbsp;<s:text name="field.studytitle" />*:&nbsp;
49                                 </td>
50                                 <td><s:textfield theme="simple" size="60" name="title" /></td>
51                         </tr>
52
53                         <tr>
54                                 <td>&nbsp;<s:text name="field.product" />*:&nbsp;
55                                 </td>
56                                 <s:if test="projectContextValues.size > 0">
57                                         <td id="select"><select name="projectContextId"
58                                                 style="width: 214px" onChange="setValue()">
59                                                         <option value="-1">
60                                                                 <s:text name="menu.select" />
61                                                         </option>
62                                                         <option value="0">
63                                                                 &nbsp;
64                                                                 <s:text name="menu.newproduct" />
65                                                         </option>
66                                                         <optgroup label="&nbsp;<s:text name="label.products"/>">
67                                                                 <s:iterator value="projectContextValues">
68                                                                         <option value="<s:property value="index"/>">
69                                                                                 &nbsp;
70                                                                                 <s:property value="value" />
71                                                                         </option>
72                                                                 </s:iterator>
73                                                         </optgroup>
74                                         </select></td>
75                                         <td id="enter" style="display: none"><s:textfield
76                                                         theme="simple" size="30" name="projectContext" /></td>
77                                 </s:if>
78                                 <s:else>
79                                         <td><s:hidden name="projectContextId" value="0" /> <s:textfield
80                                                         theme="simple" size="30" name="projectContext" /></td>
81                                 </s:else>
82                         </tr>
83                         <tiles:insertAttribute name="source_study" ignore="true" />
84
85                         <tr>
86                                 <td align="right" colspan="2"><s:submit
87                                                 action="%{#request.valid_action}" theme="simple" type="button"
88                                                 key="button.newstudy" /></td>
89                         </tr>
90
91                 </table>
92         </form>
93         <div id="top-spacer"></div>
94 </div>
95
96 <!-- Reserved
97   -->
98 <div id="right-pane"></div>
99 <div id="bottom-spacer"></div>