Changeset 7501


Ignore:
Timestamp:
Aug 9, 2018, 8:40:57 AM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #2127: Boolean extended properties are not disabled when the restricted-edit is enabled

There was a remaining problem with disabled properties being validated when saving the form. In case of an error there there was no way to fix it.

Also fixes an issue with null values when a property is required by checking the 'false' option.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/util/json/JsonUtil.java

    r6497 r7501  
    6969      while (it.hasNext())
    7070      {
    71         json.add(converter.convert(it.next()));
     71        Object t = converter.convert(it.next());
     72        if (t != null) json.add(t);
    7273      }
    7374    }
  • trunk/www/admin/users/edit_user.jsp

    r7496 r7501  
    616616                  <input type="radio" name="<%=fieldName%>" id="<%=fieldName%>.true" value="true"
    617617                    <%=b != null && b == true ? "checked" : ""%>
    618                     ><label for="<%=fieldName%>.true">true</label><br>
     618                    ><label for="<%=fieldName%>.true">true</label>
    619619                  <input type="radio" name="<%=fieldName%>" id="<%=fieldName%>.false" value="false"
    620                     <%=b != null && b == false ? "checked" : ""%>
     620                    <%=b != null && b == false || required && b == null ? "checked" : ""%>
    621621                    ><label for="<%=fieldName%>.false">false</label>
    622622                  <%
  • trunk/www/my_base/user/settings.jsp

    r7499 r7501  
    8181      public Object convert(ExtendedProperty ep)
    8282      {
     83        if (ep.isRestrictedEdit()) return null;
    8384        JSONObject json = new JSONObject();
    8485        json.put("name", ep.getName());
     
    298299                  ><label for="<%=fieldName%>.true">true</label>
    299300                <input type="radio" <%=isDisabled%> name="<%=fieldName%>" id="<%=fieldName%>.false" value="false"
    300                   <%=b != null && b == false ? "checked" : ""%>
     301                  <%=b != null && b == false || required && b == null ? "checked" : ""%>
    301302                  ><label for="<%=fieldName%>.false">false</label>
    302303                <%
Note: See TracChangeset for help on using the changeset viewer.