Skip to content

Form render fails with minimal control implementation on missing get/setOption() #132

@richard-ejem

Description

@richard-ejem

See test that confirms the failure:
http://pastebin.com/Xwpha0v2

my suggestions:

  • Nette\Forms\IControl should extend Nette\ComponentModel\IComponent (shouldn't even break BC of any existing controls, because $form->addComponent() receives only IComponent anyway)
  • wouldn't it be better if DefaultFormRenderer holds rendered components list in SplObjectStorage rather than setting an option to the control object?

By the way, there are a lot more methods missing from the minimal interface implementation to satisfy DefaultFormRenderer:

  • getForm
  • isRequired
  • getLabel
  • getControl
  • hasErrors
  • getErrors

I think all these should be also included in IControl interface. EDIT: or create IRenderableControl interface extending IControl for these to keep the IControl simple

If you agree with my suggestions, I can implement and pullrequest it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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