Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[]]></ac:plain-text-body></ac:macro>
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Dojo Zend_Form Widgets Component Proposal

Proposed Component Name Dojo Zend_Form Widgets
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Dojo Zend_Form Widgets
Proposers Matthew Weier O'Phinney
Zend Liaison Ralph Schindler
Revision 1.0 - 20 June 2008: Initial Draft. (wiki revision: 6)

Table of Contents

1. Overview

Dojo offers a number of form-related widgets via its dijit.form widgets (dijit == widget in Dojo parlance). Additionally, there are a number of layout widgets via dijit.layout that are well-suited to form presentation. This proposal aims to identify a number of these widgets to include as specialized form elements and decorators for use with the Zend_Form component.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • MUST live within the Zend_Dojo component
  • MUST implement programmatic javascript decoration of elements
    • MAY allow utilizing dojoType and other attribute declarations
  • SHOULD allow specifying dojo-specific options via explicit mutators
  • Form elements and decorators MUST utilize Dojo view helper to setup appropriate dojo.require statements and other dojo-specific environment requirements.
  • SHOULD provide both decorators AND view helpers for layout components
  • MAY provide both view helpers for dijit elements

4. Dependencies on Other Framework Components

5. Theory of Operation

Developers wishing to use Dojo form elements and layouts would point their form object to the Dojo elements:

Once the paths are in place, they would simply reference the appropriate form elements and decorators by name.

6. Milestones / Tasks

  • Milestone 1: [DONE] Prepare this proposal
  • Milestone 2: Prepare test suite and API
  • Milestone 3: Complete initial implementation
  • Milestone 4: Write documentation

7. Class Index

  • Elements
    • Zend_Dojo_Form_Element_CheckBox
    • Zend_Dojo_Form_Element_ComboBox
    • Zend_Dojo_Form_Element_CurrencyTextBox
    • Zend_Dojo_Form_Element_DateTextBox
    • Zend_Dojo_Form_Element_FilteringSelect
    • Zend_Dojo_Form_Element_HorizontalSlider
    • Zend_Dojo_Form_Element_NumberSpinner
    • Zend_Dojo_Form_Element_NumberTextBox
    • Zend_Dojo_Form_Element_RadioButton
    • Zend_Dojo_Form_Element_Textarea
    • Zend_Dojo_Form_Element_Textbox
    • Zend_Dojo_Form_Element_TimeTextBox
    • Zend_Dojo_Form_Element_ToggleButton
    • Zend_Dojo_Form_Element_ValidationTextbox
    • Zend_Dojo_Form_Element_VerticalSlider
  • Layout-related decorators
    • Zend_Dojo_Form_Decorator_AccordionContainer
    • Zend_Dojo_Form_Decorator_BorderContainer
    • Zend_Dojo_Form_Decorator_ContentPane
    • Zend_Dojo_Form_Decorator_Form
    • Zend_Dojo_Form_Decorator_StackContainer
    • Zend_Dojo_Form_Decorator_TabContainer
  • View helpers
    • Zend_Dojo_View_Helper_AccordionContainer
    • Zend_Dojo_View_Helper_BorderContainer
    • Zend_Dojo_View_Helper_ContentPane
    • Zend_Dojo_View_Helper_Form
    • Zend_Dojo_View_Helper_HorizontalSlider
    • Zend_Dojo_View_Helper_StackContainer
    • Zend_Dojo_View_Helper_TabContainer
    • Zend_Dojo_View_Helper_VerticalSlider

8. Use Cases

9. Class Skeletons

No class skeletons will be provided in the proposal. All will merely be extensions of the base Zend_Form classes, with a few added mutators and accessors.

]]></ac:plain-text-body></ac:macro>

]]></ac:plain-text-body></ac:macro>

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jun 25, 2008

    <p>Some DojoToolkit Widgets (for example <a href="http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/form-validation-specialized-input/select">FilteringSelect</a> and <a href="http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/form-validation-specialized-input/auto-completer">ComboBox</a>) are dojo.data-enabled. On the widget site there is only the attribute "store" necessary, which connects the Widget with a Datastore. A Datastore could be created with the new <a href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Dojo_Data+-+Matthew+Weier+O%27Phinney">Zend_Dojo_Data</a> class, so that the "store" attribute gets a reference from a Zend_Dojo_Data instance. Therefore, Zend_Dojo_Data is a soft dependency of this Proposal.</p>

    <p>My question is: Could you add an Use Case with such an dojo.data-enabled widget?</p>

    <p>Remi </p>

    1. Jun 25, 2008

      <p>Actually, the dojo.data data store would reference a URL (typically using a custom data store that extends QueryReadStore) – this could be a file on the server, a controller action, etc. So, the Zend_Form elements themselves have no dependency on Zend_Dojo_Data – the <strong>application</strong> does. In that case, you would simply have an action that passes data to Zend_Dojo_Data and returns it to your store.</p>

      1. Jun 25, 2008

        <p>Yes, I see it. Zend_Dojo_Data is not right here.</p>

        <p>Let us think about the following Use Case:<br />
        We have a Form with two FilteringSelect Widgets. Both of them should select their Data from the <strong><em>same</em></strong> Datastore ('<span style="color: rgb(255,102,0);">myStore</span>'):</p>
        <ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
        $form->addElement('filteringSelect', 'myCountry', array(
        'searchAttr' => 'name',
        'autoComplete' => 'true',
        'store' => 'myStore',
        'query' => "

        Unknown macro: {type}

        ",
        'invalidMessage' => 'Choose a Country from the list'
        ));

        $form->addElement('filteringSelect', 'myCity', array(
        'searchAttr' => 'name',
        'autoComplete' => 'true',
        'store' => 'myStore',
        'query' => "

        Unknown macro: {type}

        ",
        'invalidMessage' => 'Choose a City from the list'
        ));
        ]]></ac:plain-text-body></ac:macro>
        <p>In this case, it would be good, if we could use a Zend_Dojo_Form_Element_Datastore (the question is, is the Datastore really a "<strong>Form</strong>_Element"?) and set a reference from this Datastore to the 'store' attribute:</p>
        <ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
        'store' => $newCreatedDatastore->getName(),
        ]]></ac:plain-text-body></ac:macro>
        <p><br class="atl-forced-newline" /></p>

        <p>Remi </p>

        1. Jun 25, 2008

          <p>Ah – yes, that's a good use case. It's beyond the scope of this proposal, but would be a good candidate for a view helper. I'll start thinking on a solution for setting up data stores.</p>

  2. Jul 02, 2008

    <ac:macro ac:name="note"><ac:parameter ac:name="title">Zend Official Comment</ac:parameter><ac:rich-text-body>

    <p>This proposal is accepted to the <strong>Standard Incubator</strong> with the following provisions:</p>

    <ul>
    <li>We explore the possibility of a prepareForm() static method that will make all the necessary calls to the proper objects to make them aware of Dojo's paths for decorators, helpers, validators and/or filters.</li>
    </ul>

    </ac:rich-text-body></ac:macro>