Changes between Initial Version and Version 1 of Ticket #9910


Ignore:
Timestamp:
Sep 17, 2009, 8:17:58 AM (12 years ago)
Author:
bill
Comment:

Hi Phil,

I can see the reason for asking for this.

About the implementation, it seems like calling attr() on the widgets might be limited because certain attributes (on certain widgets) can only be specified at initialization time. But I guess it would still be better than nothing.

Maybe you could file a CLA and then help to write some test cases to add into _Templated-widgetsInTemplate.html? That's half the battle of adding new features.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9910

    • Property Milestone changed from tbd to future
  • Ticket #9910 – Description

    initial v1  
    1 If I want to make a simple, compound widget (say, combining a Slider with a TextBox), there is no easy way to map properties from the parent _Widget to child widgets.  (The child widgets in this case are created using a template with widgetsInTemplate set to true.)
     1If I want to make a simple, compound widget (say, combining a Slider with a !TextBox), there is no easy way to map properties from the parent _Widget to child widgets.  (The child widgets in this case are created using a template with widgetsInTemplate set to true.)
    22
    33If you attempt to use '''attributeMap''', the widget being set will throw deprecated warnings about ''setAttribute'' (because dojo.attr() is calling setAttribute).
     
    1717---
    1818
    19 Example of usage:  In my example above, my compound slider widget puts a NumberTextBox at the end of the Slider.  This textbox can be typed into, or the slider can be adjusted normally.  However, I want to be able to map basic attributes like ''name'', ''required'', and ''promptMessage'' to the TextBox (which is what is submitted).
     19Example of usage:  In my example above, my compound slider widget puts a !NumberTextBox at the end of the Slider.  This textbox can be typed into, or the slider can be adjusted normally.  However, I want to be able to map basic attributes like ''name'', ''required'', and ''promptMessage'' to the !TextBox (which is what is submitted).
    2020
    2121Currently, the only way to get this to work with a templated widget is to manually add getters and setters for every mapped property.  This not only adds bulk to the class, but is tedious for more than a few properties.