Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-1687

[PATCH] JXPATHBinding : when saving the form, remove xml elements if the value of the widget is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 2.1.7, 2.1.8, 2.2
    • None
    • Blocks: Forms
    • None

    Description

      When a form is saved using a JXPathBinding, the xml elements that correspond to null widget values must be removed.

      Here is our problem : we have a form containing a "date widget" that is not mandatory,

      1. the user wants to set a value to this widget ex 2005/05/09
      2. the user save this form
      3. the user does not want the date to be set anymore (why ? why not !)
      4. the user edit the value removing its content (ie the value of the widget will be null)
      5. the user save the form
      6. when the user wants to view what's happened, he see : the element containing the value of the date is present, if he loads the form again he found : 1970-01-01 in the date field (the org.w3c.util.DateParser return this value if empty string its given).

      In general, it has no sense for kind of data (integer, float, date...) to have three "state" : empty, null and filled with a value !

      So here is a patch to correct this :

      Attachments

        Activity

          People

            Unassigned Unassigned
            phil@anyware-tech.com Philippe Gassmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: