Salome HOME
Minor fix of input tag.
[tools/siman.git] / Workspace / Siman / WebContent / jsp / editContext.jsp
1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2     pageEncoding="ISO-8859-1"
3 %>
4 <%@ taglib prefix="s" uri="/struts-tags"
5 %>
6 <s:set var="todo"><%=request.getParameter("action")%></s:set>
7 <s:set var="type"><%=request.getParameter("type")%></s:set>
8 <s:url id="undo" namespace="/study" action="step-study"></s:url>
9
10 <!-- Selection of an existing type of simulation context
11   -->
12 <s:if test="%{#todo == 'selectContext'}">
13   <table cellpadding=0 cellspacing=0 border=0 class=text>
14     <tr height=2><td></td></tr>
15   <s:iterator value="simulationContexts">
16     <tr height=18>
17       <td width=18>
18         <s:if test="%{isApproved()}"><img src="<s:url value="/skin/disabled.APPROVED.png"/>" width=14 height=14 border="none" /></s:if>
19         <s:else><img src="<s:url value="/skin/disabled.state.png"/>" width=14 height=14 border="none" /></s:else>
20       </td>
21       <td>
22         <s:if test="%{type.isApproved()}"><b><s:text name="type.context.%{typeName}"/>:&nbsp;</b></s:if>
23         <s:else><b><s:property value="%{typeName}"/>:&nbsp;</b></s:else>
24       </td>
25       <td><s:property value="value"/></td>
26     </tr>
27   </s:iterator>
28   </table>
29   <table cellpadding=0 cellspacing=0 border=0 class=text>
30     <tr height=26>
31       <td width=18 align=center>
32         <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
33       </td>
34       <td>
35           <select name="contextType" onChange="submit()">
36             <s:set var="category" value="-1"/>
37             <option value="-1"><s:text name="menu.selectcontextype"/></option>
38             <option value="0">&nbsp;<s:text name="menu.newcontype"/></option>
39             <s:iterator value="simulationContextTypes">            
40               <s:set var="valided" value="%{isApproved()}"/>
41               <s:if test="%{#category != #valided}">
42                 <s:if test="%{#category != '-1'}"></optgroup></s:if>
43                 <s:if test="%{#valided}"><optgroup label="&nbsp;<s:text name="label.contypes.valid"/>"></s:if>
44                 <s:else><optgroup label="&nbsp;<s:text name="label.contypes"/>"></s:else>
45                 <s:set var="category" value="%{#valided}"/>
46               </s:if>            
47               <option value="<s:property value="index"/>">
48                 <s:if test="%{isApproved()}">&nbsp;<s:text name="type.context.%{name}"/></s:if>
49                 <s:else>&nbsp;<s:property value="%{name}"/></s:else>
50               </option>
51             </s:iterator>
52             </optgroup>
53           </select>
54       </td>
55     </tr>
56   </table>
57 </s:if>
58 <s:else>
59
60 <!-- List of existing simulation contexts
61   -->
62   <table cellpadding=0 cellspacing=0 border=0 class=text>
63     <tr height=2><td></td></tr>
64   <s:iterator value="simulationContexts">
65     <tr height=18>
66       <td width=18>
67         <s:if test="%{isApproved()}"><img src="<s:url value="/skin/disabled.APPROVED.png"/>" width=14 height=14 border="none" /></s:if>
68         <s:else><img src="<s:url value="/skin/disabled.state.png"/>" width=14 height=14 border="none" /></s:else>
69       </td>
70       <td>
71         <s:if test="%{type.isApproved()}"><b><s:text name="type.context.%{typeName}"/>:&nbsp;</b></s:if>
72         <s:else><b><s:property value="%{typeName}"/>:&nbsp;</b></s:else>
73       </td>
74       <td><s:property value="value"/></td>
75     </tr>
76   </s:iterator>
77   </table>
78
79 <!-- Display of eventual input error
80   -->
81
82 <!-- Input of a new type of simulation context
83 -->
84   <table cellpadding=0 cellspacing=0 border=0 class=text>
85     <s:if test="%{#todo == 'newContext'}">
86     <tr height=18>
87       <td width=18 align=center>
88         <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
89       </td>
90       <td><input type=text name=newType value="<s:text name="field.contextype"/>">&nbsp;:&nbsp;</td>
91       <td><input type=text name=contextValue></td>
92               <td>
93                 <button type="submit" value="" style="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent">
94                   <img src="<s:url value="/skin/image.export.png"/>" title="<s:text name="button.save"/>"/>
95                 </button>
96               </td>
97     </tr>
98     </s:if>
99
100 <!-- Input of a value of the selected simulation context type
101   -->
102     <s:elseif test="%{#todo == 'setContext'}">
103     <tr height=18>
104       <td width=18 align=center>
105         <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
106       </td>
107       <td>
108         <s:if test="%{contextType.isApproved()}"><b><s:text name="type.context.%{contextName}"/>:&nbsp;</b></s:if>
109         <s:else><b><s:property value="%{contextName}"/>:&nbsp;</b></s:else>
110       </td>
111       <s:if test="simulationContextValues.size > 0">
112         <td id=select>
113           <select name="contextValue" onChange="setValue()">
114             <option value="-1"><s:text name="menu.select"/></option>
115             <option value="0">&nbsp;<s:text name="menu.newcontext"/></option>
116             <optgroup label="&nbsp;<s:text name="label.contexts"/>">
117               <s:iterator value="simulationContextValues">
118                 <option value="<s:property value="index"/>">&nbsp;<s:property value="value"/></option>
119               </s:iterator>
120             </optgroup>
121           </select>
122         </td>
123         <td id=enter style="display: none">
124           <input type=hidden name=contextType value="<s:property value="%{#type}"/>">
125           <input type=text  name=contextValue>
126         </td>
127               <td>
128                 <button type="submit" value="" style="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent">
129                   <img src="<s:url value="/skin/image.export.png"/>" title="<s:text name="button.save"/>"/>
130                 </button>
131               </td>
132       </s:if>
133       <s:else>
134         <td>
135           <input type=hidden name=contextType value="<s:property value="%{#type}"/>">
136           <input type=hidden name=contextValue value="0">
137           <input type=text   name=contextValue>
138         </td>
139               <td>
140                 <button type="submit" value="" style="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent">
141                   <img src="<s:url value="/skin/image.export.png"/>" title="<s:text name="button.save"/>"/>
142                 </button>
143               </td>
144       </s:else>
145     </tr>
146     </s:elseif>
147
148   </table>
149 </s:else>