Skip to content

Accordion and SequenceWidget #347

@Ezka77

Description

@Ezka77

Mixing accordion exemple with SequenceWidget and Select2Widget leads to some strange behaviour:

  • accordion of the first element work, the others can't be opened/closed
  • css of Select2Widget inside the accordion seems have some issues.

version: deform==2.0.4

Here some code to illustrate:

choices = (('test1', 'Test 1'),
                   ('test2', 'Test 2'),
                   ('test3', 'Test 3'))

## Inside the accordion
class ClipParameterSchema(colander.Schema):
    not_available_for = colander.SchemaNode(
                colander.Set(),
                validator=colander.Length(max=10),
                widget=deform.widget.Select2Widget(
                    values=choices,
                    multiple=True),
                missing=[]
                )
    only_available_for = colander.SchemaNode(
                colander.Set(),
                validator=colander.Length(max=1),
                widget=deform.widget.Select2Widget(
                    values=choices,
                    multiple=True),
                missing=[],
                )
    until = colander.SchemaNode(
                colander.Date(),
                missing=colander.drop
                )

## Schema with an accordion
class ClipSchema(colander.Schema):
    upload = colander.SchemaNode(
            deform.FileData(),
            widget=deform.widget.FileUploadWidget(tmpstore)
            )
    parameters = ClipParameterSchema(
                        title="Clip parameters",
                        widget=deform.widget.MappingWidget(
                        template="mapping_accordion",
                        open=False))

## Sequence of schema with  an accordion
class ClipSequence(colander.SequenceSchema):
    upload = ClipSchema()

And a screen shot here:
deform_accordion_issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions