Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Perth Hackfest October 2012/Forms API

From MoodleDocs
Revision as of 12:50, 30 October 2012 by Helen Foster (talk | contribs) (copied session notes from google doc)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
  • Problems with Form API
    • Cannot use forms in a javascript popout (MDL-17146)
    • Cannot override how they look
    • Forms lib was done before renderers (but should not be required, otherwise we cannot use existing form libraries)
    • Handling files simpler
    • Ability to have form elements appear/disappear (now able to be accessible with ARIA attributes)
    • ARIA support is required
    • Ability to create custom form elements for plugins
    • No easy way to create special forms (eg: rubrics form)
    • Multi-step forms are not possible
    • Admin tree is a separate form library (should be unified)
    • Ability to submit by AJAX
    • Needs to be backwards compatible
    • Complex dependencies between form elements
    • label in form submit button - bad for accessibility
  • Discuss: Could forms api sort of extend web services to help in implementing ws throughout moodle? (bad performance?)
    • abstracting validation functions
    • This is blue sky perhaps as theres too much to cZhange and its too late to introduce validations into xmldb
  • Drupal forms uses hooks: Drupal Forms API ( http://drupal.org/node/751826 )
    • plugin extends forms
    • people can create local plugins to modify, reorder, etc core forms
    • form extensions can define fields, etc..
  • Existing form frameworks
  • Petr’s speech on *3’ QF2
    • frozen + hard freeze history/problems
    • we have bc issues and currently tied into QF
    • Author shares the same perspective on using code as Petr ;-)
  • Forms library should be so easy to use for first time coder.
    • should ensure sesskey
    • should have validations somehow..?
    • all the day to day stuff that we don’t want to have to think about everyday - thats the win we can get from our forms lib.
    • as few as possible bc issues from any simple bug fixes. (eg: accessibility sprint)
    • dynamic form elements/validation