10 Aug 00:14
Re: Re: Adding a javascript event handler to a widget
Hi Dorneles,
Thanks for your reply. Here are my thoughts on how HTML/XML attributes
should be handled in AT.
If the attributes property is currently a placeholder for some desired
functionality, perhaps it could be used to allow *any* HTML/XML
attribute to be generated by the widget. My proposal is to allow the
attributes property of the widget to be passed as a dictionary to the
generator, as in the following example...
schema = BaseSchema + Schema((
StringField('Field_ID',
widget=StringWidget(label='some_label ',
attributes={'onFocus': 'select()', 'onChange': 'someJSfunction()',
'anyXMLattribute': 'anyXMLattributeValue'},
description='some_description'),
),
The flexibility of this approach may even allow TAL statements to be
added to widgets. Does this sound reasonable?
- Kamal
On Aug 9, 2004, at 2:28 PM, Dorneles Treméa wrote:
> Hi Kamal,
>
>> How do I add a javascript event handler to a widget? For example,
>> how would I add the HTML attribute onFocus="select()" to a
>> StringWidget? My suspicion is to use the attributes property of the
>> widget, but I am unable to find any documentation or usage examples
>> regarding the attributes property of Archetype widgets. Any help is
>> much appreciated.
>
> currently there are only some rough ideas sleeping in some
> minds around the world about the best approach for JS events
> (onclick, onfocus, onchange, ...)
>
> A new property on widgets sounds reasonable.
>
> I suggest you write your thoughts, so we can got consensus
> about the idea and effectively implement it on AT.
>
> Regards,
>
> --
>
> Dorneles Treméa
> Caxias do Sul - RS - Brasil
> +55 54 9114 9312 - UIN: 2413568
> X3ng Web Technology <http://www.x3ng.com.br>
>
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.12
> GCS/IT d- s:->: a25 C+++ UBL++++$ P--- L++ E-- W+++
> N++ o? K? w+ O M+ V-- PS+ PE- Y-- PGP++ t+ 5 X++ R+
> tv+ b(++) DI+ D++ G+>+++ e++>++++ h---- r+++ y+++**
> ------END GEEK CODE BLOCK------
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
> _______________________________________________
> Archetypes-users mailing list
> Archetypes-users@...
> https://lists.sourceforge.net/lists/listinfo/archetypes-users
>
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
RSS Feed