shuber      2005/06/10 14:43:27 CEST

  Modified files:        (Branch: JAHIA-4-0-BRANCH)
    src/views/jsp/jahia/engines/shared boolean_field.jsp 
  Log:
  Fix bug reported by Ghislain that prevents the use of two boolean fields in 
the same container.
  
  Revision  Changes    Path
  1.4.4.2   +12 -3     
jahia/src/views/jsp/jahia/engines/shared/boolean_field.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/src/views/jsp/jahia/engines/shared/boolean_field.jsp.diff?r1=1.4.4.1&r2=1.4.4.2&f=h
  
  
  
  Index: boolean_field.jsp
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/src/views/jsp/jahia/engines/shared/Attic/boolean_field.jsp,v
  retrieving revision 1.4.4.1
  retrieving revision 1.4.4.2
  diff -u -r1.4.4.1 -r1.4.4.2
  --- boolean_field.jsp 6 Aug 2004 18:01:13 -0000       1.4.4.1
  +++ boolean_field.jsp 10 Jun 2005 12:43:27 -0000      1.4.4.2
  @@ -3,9 +3,17 @@
   <%@ page import="org.jahia.data.fields.*" %>
   <%@ page import="org.jahia.params.*" %>
   <%@ page import="org.jahia.services.*" %>
  +<%@ page import="org.jahia.utils.*" %>
   <%@ page import="java.util.*" %>
   <%@ taglib uri="JahiaLib" prefix="jahia" %>
  +<%!
   
  +        // Used with multiple field edit !
  +        private String contextID (int id) {
  +                return JahiaTools.replacePattern(String.valueOf(id),"-","_");
  +        }
  +
  +%>
   <%
       HashMap engineMap = (HashMap) request.getAttribute( 
"org.jahia.engines.EngineHashMap" );
   
  @@ -16,12 +24,13 @@
       String      localSwitchUrl      = (String) engineMap.get( 
"localSwitchUrl" );
       ParamBean jParams   = (ParamBean) request.getAttribute( 
"org.jahia.params.ParamBean" );
       String      theURL              = (String) 
jParams.settings().getJahiaEnginesHttpPath();
  +    String           contextID                       = 
contextID(theField.getID());
   %>
   
   
   <SCRIPT type="text/javascript">
   <!--
  -function changeBoolean(what) {
  +function changeBoolean_<%=contextID%>(what) {
       if 
(document.mainForm.elements["_<%=theField.getID()%>checkBoolean"].checked) {
           what.value = "true";
       } else {
  @@ -31,8 +40,8 @@
   // -->
   </SCRIPT>
   
  -<input type="checkbox" name="_<%=theField.getID()%>checkBoolean" 
class="input" 
onClick="changeBoolean(document.mainForm.elements['_<%=theField.getID()%>']);"<%if
 (theField.getValue().equals("true")) { %> checked<% } %>><span 
class="text">&nbsp;<jahia:engineResourceBundle 
resourceName="org.jahia.engines.shared.Boolean_Field.checkForTrue.label"/></span>
  -<input type="hidden" name="_<%=theField.getID()%>" 
value="<%=theField.getValue()%>">
  +<input type="checkbox" name="_<%=theField.getID()%>checkBoolean" 
class="input" 
onClick="changeBoolean_<%=contextID%>(document.mainForm.elements['_<%=theField.getID()%>']);"<%if
 (theField.getValue().equals("true")) { %> checked<% } %>><span 
class="text">&nbsp;<jahia:engineResourceBundle 
resourceName="org.jahia.engines.shared.Boolean_Field.checkForTrue.label"/></span>
  +<input type="hidden" name="_<%=theField.getID()%>" 
value="<%=theField.getValue()%>"> 
   
   <SCRIPT type="text/javascript">
   <!--
  

Reply via email to