Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-13647

Update xclass definition when pretty name, rows, cols or editor changes for TextArea

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 8.3-milestone-1, 8.2.2
    • 7.4
    • Old Core
    • None
    • Unknown
    • N/A
    • N/A

    Description

      Right now it's up to the user of BaseClass to write stuff such as:

              needsUpdate |= baseClass.addTextAreaField(FIELD_SCRIPT, "Job Script", 60, 10);
              // make sure that the script field is of type pure text so that wysiwyg editor is never used for it
              TextAreaClass scriptField = (TextAreaClass) baseClass.getField(FIELD_SCRIPT);
              // Note: getEditor() returns lowercase but the values are actually camelcase...
              if (!scriptField.getEditor().equals("puretext")) {
                  scriptField.setStringValue("editor", "PureText");
                  needsUpdate = true;
              }
      

      It would be better if it were automatically done and so that we could simply use:

              needsUpdate |= baseClass.addTextAreaField(FIELD_SCRIPT, "Job Script", 60, 10, "PureText");
      

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: