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