Results 1 to 6 of 6

Thread: submission of form data

  1. #1
    TheMonolith
    Guest

    Default submission of form data

    My form structure looks like this:

    Code:
        mainPanel
            positionFieldSet
                5 buttons (toggle group)
            textFieldSet
                combobox
                textField
            fontFieldSet
                combobox
                2 checkboxes
            fontColorFieldSet
                formPanel
                    numberField
                formPanel
                    numberField
                formPanel
                    numberField
            backgroundColorFieldSet
                formPanel
                    numberField
                formPanel
                    numberField
                formPanel
                    numberField
    Put into a sentence, mainPanel contains 5 fieldSets, each of which contains several components. Indentation indicates nesting.

    Now I want mainPanel to submit all the form data. As far as I understand from reading the "Forms" chapter in the "Learning Ext JS book" and looking at old threads, the components whose data I want to submit must be contained in a FormPanel.

    My questions is: Must these components be directly contained in a FormPanel or is it sufficient if they are indirectly contained, as in the following version:

    Code:
        mainFormPanel
            positionFieldSet
                5 buttons (toggle group)
            textFieldSet
                combobox
                textField
            fontFieldSet
                combobox
                2 checkboxes
            fontColorFieldSet
                formPanel
                    numberField
                formPanel
                    numberField
                formPanel
                    numberField
            backgroundColorFieldSet
                formPanel
                    numberField
                formPanel
                    numberField
                formPanel
                    numberField
    Thank you for your help!

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    The second version is the only solution the way things are set up now.

    Submission values are pulled directly from the DOM of the FormPanel.

    I can foresee a better method of submission which uses the Ext Container hierarchy to extract field values to submit, but this is where we are at now.

  3. #3
    TheMonolith
    Guest

    Default

    So all components must be contained in a FormPanel, but it is sufficient if they are indirectly contained (as in my second example)?

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    They are still inside it.

  5. #5
    Sencha User VinylFox's Avatar
    Join Date
    Mar 2007
    Location
    Baltimore, MD
    Posts
    1,501

    Default

    By the way, you don't have to use FormPanel's for each of the nested sections, you can just set the layout to 'form' on a standard Panel. So to use your example...

    Code:
    mainFormPanel
            positionFieldSet
                5 buttons (toggle group)
            textFieldSet
                combobox
                textField
            fontFieldSet
                combobox
                2 checkboxes
            fontColorFieldSet
                Panel (layout: 'form')
                    numberField
                Panel (layout: 'form')
                    numberField
                Panel (layout: 'form')
                    numberField
            backgroundColorFieldSet
                Panel (layout: 'form')
                    numberField
                Panel (layout: 'form')
                    numberField
                Panel (layout: 'form')
                    numberField

  6. #6
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    or simpler:

    Code:
    mainFormPanel
            positionFieldSet
                5 buttons (toggle group)
            textFieldSet
                combobox
                textField
            fontFieldSet
                combobox
                2 checkboxes
            fontColorFieldSet
                numberField
                numberField
                numberField
            backgroundColorFieldSet
                numberField
                numberField
                numberField
    No need to wrap every Field inside a (very heavyweight) Panel. Panel is a very complex class.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •