Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Panel/UI/Window child component hierarchy is invalid #744

Closed
vaadin-bot opened this Issue May 9, 2009 · 3 comments

Comments

Projects
None yet
1 participant
Collaborator

vaadin-bot commented May 9, 2009

Originally by @Artur-


The child of a Panel/Window/UI should be its content (the layout) and not the children of the content. Currently the content is not the child of its parent and it causes problem for almost everybody who starts using Vaadin. In addition it causes problems when traversing the component hierarchy:

  • ComponentSizeValidator fails to validate content size without special cases
  • Attach and detach events need special handling as the child is not a child (#1715)
  • WYSIWYG editor needs special handling of this case
Collaborator

vaadin-bot commented Oct 26, 2010

Originally by @Artur-


What currently seems like the best option is to

  • Keep the panel as a simple container that always contains 1 component
  • Make constructors that do not take a ComponentContainer as a parameter protected
  • This makes sense for extending classes but forces users to always supply the content when constructing.
  • Clearly marks that something has to be done when updating to the new version (when using e.g. new Panel())
  • Remove the feature that a VerticalLayout is by default used
  • Make addComponent call setContent() or throw an exception if the content has already been set
  • Make removeComponent remove the content or throw an exception if there is no content
  • Make getComponentIterator return an iterator with only the content
  • Remove special implementations / fix replaceComponent,removeAllComponents,attach,detach,componentAttachedToContainer/componentDetachedFromContainer
Collaborator

vaadin-bot commented Nov 12, 2012

Originally by @hesara


Working on this based on the decisions of the API review meeting, including:

  • UI, Panel and Window do not extend ComponentContainer but implement HasComponents
  • no addComponent()/removeComponent()/removeAllComponents() in Panel or Window
  • UI, Panel and Window methods getContent()/setContent() use content type Component, not ComponentContainer
  • no default content for Panel or Window
  • component iterator, component count etc. for a Panel or a Window only consider the content, not its content
  • LegacyWindow still implements addComponent and removeComponent()
Collaborator

vaadin-bot commented Nov 14, 2012

Originally by @hesara


Changes done as listed in previous comment.

@vaadin-bot vaadin-bot closed this Nov 14, 2012

@vaadin-bot vaadin-bot added the bug label Dec 9, 2016

@vaadin-bot vaadin-bot added this to the Vaadin 7.0.0.beta9 milestone Dec 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment