mantisbt:combo_edit_requirements
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
mantisbt:combo_edit_requirements [2007/05/22 00:01] – More details. vboctor | mantisbt:combo_edit_requirements [2008/10/29 04:25] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== AJAX Combo Edit Control Requirements ====== | ||
+ | **Author:** Victor Boctor | ||
+ | |||
+ | ====== Introduction ====== | ||
+ | |||
+ | It is common in Mantis to have a form where the user must enter a valid user name, category, platform, OS, etc. The aim of this task is to implement an AJAX control and wrapping PHP code which allows the use of this control to replace edit boxes and combo boxes in the scenarios that are mentioned later in the document. | ||
+ | |||
+ | ====== Use Case 1: Reporter Name ====== | ||
+ | |||
+ | In the case of " | ||
+ | |||
+ | It should be possible to use the AJAX control to do this. The AJAX control will consistent of three UI components: a textbox, a drop down button and a listbox (or a div) that pops up when the user is selecting from a list of options. | ||
+ | |||
+ | If the user writes in the text box, then auto-complete functionality will be activated. | ||
+ | |||
+ | The other option is for the user to click on the drop down button, in this case the user will get ALL entries independent of the contents of the text box. This will be very useful in the case where the control is pre-populated by a user name and the user wants to select a different entry (rather than using the current content as a prefix). | ||
+ | |||
+ | ====== Use Case 2: Platform ====== | ||
+ | |||
+ | In this case the list of possible values should be pretty small. | ||
+ | |||
+ | ====== Migration to the Control ====== | ||
+ | |||
+ | It should be very easy to migrate a current text box or combobox to this AJAX control. | ||
+ | |||
+ | ====== Design Constraints ====== | ||
+ | |||
+ | * Implement core/ | ||
+ | |||
+ | <code php> | ||
+ | /*** | ||
+ | * This function inserts the necessary HTML and Javascript within the HTML form. | ||
+ | * | ||
+ | * @param $p_name | ||
+ | * @param $p_results_function The name of the function to be used to retrieve the results. | ||
+ | * @param $p_error_div | ||
+ | * @param $p_context | ||
+ | * @param $p_allow_new_entries true to allow the user to enter values not in the list without indicating errors, false otherwise. | ||
+ | * | ||
+ | * @returns string to be echoed. | ||
+ | */ | ||
+ | | ||
+ | </ | ||
+ | |||
+ | * The functions that calculate the results and are called by Javascript using XMLHttpRequest will be implemented in core/ | ||
+ | |||
+ | <code php> | ||
+ | /** | ||
+ | * A function that returns the list of reporter names based on a context and a prefix. | ||
+ | * | ||
+ | * @param $p_context - The context to be used by the function. | ||
+ | * @param $p_prefix - The prefix typed by the user. For example, " | ||
+ | * | ||
+ | * @returns An array of entries where the array key is the form value and the array value is the label. | ||
+ | * Returns an empty array if case of no matches. | ||
+ | * Returns a localized string in case of an error that should be displayed to the user (will only be visible if div was supplied) | ||
+ | */ | ||
+ | | ||
+ | </ | ||
+ | |||
+ | * Use the Javascript libraries that are already shipped with 1.1.0a3 (i.e. prototype, scripticulous). | ||
+ | * Make it dead simple to migrate from standard controls to this control. | ||
+ | * In the case where the javascript configuration option is OFF, the implementation should map to a normal text box or combobox. | ||
+ | * Shouldn' | ||
+ | |||
+ | ====== Usage in Mantis ====== | ||
+ | |||
+ | * As part of the implementation | ||
+ | * Platform (report/ | ||
+ | * OS (report/ | ||
+ | * OS Version (report/ | ||
+ | * Reporter Name (update issue page) | ||
+ | * Followed by: | ||
+ | * Filters (reporter, assigned to, etc) | ||
+ | * and other as appropriate. | ||
+ | |||
+ | ====== Feedback ====== | ||
+ | |||
+ | Please provide feedback in this section. |