:: Forum >>

Using controls as templates (does not work)

Unfortunately the current AW version does not allow using controls as parts of other controls (either via setContent or via setTemplate). The original design assumed that the control is always a top level element. The control can be composed out of static content (setContent method) or using dynamic child template elements. Control keeps state in properties/models. Control has a unique id which is either assigned by the user or generated automatically. And control also has a single point of keyboard focus.

Templates, on the other hand, do not create child templates and do not keep state (which comes from the parent control). Template id is always generated automatically and contains access path relative to the parent control. Templates cannot hold or process keyboard focus.

This is the current design and it is indeed rather limiting (which is a major bug :-). Unfortunately I don't see an easy way to fix it without breaking compatibility with the existing code. It will be fixed in the next major release, but the 2.x branch most likely continue as it is (using the design described above).
Alex (ActiveWidgets)
Tuesday, October 13, 2009

This topic is archived.


Back to support forum

Forum search