Uploaded image for project: '{RETIRED} XWiki Panels Application'
  1. {RETIRED} XWiki Panels Application
  2. XAPANELS-14

Ensure that the document parent can always be updated (regardless of skin rendering)

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Duplicate
    • Minor
    • None
    • 1.0, 1.1 M1
    • None
    • None
    • Panel DocumentInformation skin, bugfixingday

    Description

      This should apply to any 1.* release:

      It looks like the DocumentInformation panel depends on being rendered inside the edit form. In a skin I have, the main content (including the form) is completely rendered before the sidebar, and the sidebar is what renders the panels.

      The following change to the DocumentInformation Panel corrected the problem:

      Instead of :

      <dl><dt><label for="xwikidocparentinput2">$msg.get("parentfield"):</label></dt> <dd><input type="text" id="xwikidocparentinput2" name="parent" value="$!tdoc.parent" size="30" /></dd>

      Do this:

      <dl><dt><label for="xwikidocparentinput2">$msg.get("parentfield"):</label></dt> <dd><input type="text" id="xwikidocparentinput2" name="parent" value="$!tdoc.parent" size="30" onChange="updateParent(this); return false;"/></dd>

      (add a call to a javascript on the parent input field: onChange="updateParent(this); return false;")

      The script:

      function updateParent(field) {
      var editForm = document.getElementById('edit');
      if(!editForm || !field) return;
      editForm.xwikidocparentinput.value = field.value;
      alert(field.value);
      alert(editForm.xwikidocparentinput.value);
      }

      Requires the hidden field for the parent to be re-added. I put it in edit.vm, so that it present in any edit mode:

      <input type="hidden" id="xwikidocparentinput" name="parent" value="$!tdoc.parent"/>

      Something similar should be done for tags, as that update will have the same issue. I haven't had the time to figure out how they work yet.. the tagedit.vm template is pretty obscure.

      Attachments

        Issue Links

          Activity

            People

              sdumitriu Sergiu Dumitriu
              ebullient Erin Schnabel
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: