W3C home > Mailing lists > Public > public-appformats@w3.org > March 2008

Re: Widgets 1.0 - widget settings: publishing / modifications

From: Marcos Caceres <marcosscaceres@gmail.com>
Date: Thu, 13 Mar 2008 19:24:13 +1000
Message-ID: <b21a10670803130224r541af375t93a54fed5d5aee2b@mail.gmail.com>
To: "Sergey Ilinsky" <castonet@yahoo.co.uk>
Cc: public-appformats@w3.org

Hi Sergey,

On Thu, Mar 13, 2008 at 1:07 AM, Sergey Ilinsky <castonet@yahoo.co.uk> wrote:
> Not sure if the issue was previously discussed -
> I could not find its trails anyway..
>
> If I understand correctly, the purpose of the following API
> functions preferenceForKey / setPreferenceForKey
> available on Widget interface is to query widget runtime for
> "widget instance" - specific settings.
>
> Then several questions/issues come:
>
> 1) will there be a "setting" element available
>  in the configuration file for the purpose of publishing
>  widget settings? (Widget runtime could then, for example,
>  provide a consistent UI for editing settings)

Probably not (though the Open Ajax Alliance (OAA) is working on this
in their metadata format). I strongly believe that the preferences
should be set "onload" using script. Personally, and in the case of
the kind widgets we are defining, I think it would be messy to have
preferences being set in the config file. For one, it would mean
having to define a bunch of types that ECMAScript already gives us.
Also, I think the preference UI is better custom built using HTML.

> 2) how a widget will then be notified on settings changes
>  made from the widget runtime UI?

Good point. We will probably add an event for that...  or something like:

widget.addEventListener("preferenceChange", listener, true|false);

Or

widget.onPreferencesChanged = function(event){ ...do something with event... }

and the event object might contain the key, the new value, and the old value:

interface PreferenceChagedEvent : Event {
  readonly attribute DOMString        prevValue;
  readonly attribute DOMString        newValue;
  readonly attribute DOMString        preferenceKey;
};


Kind regards,
Marcos
-- 
Marcos Caceres
http://datadriven.com.au
Received on Thursday, 13 March 2008 09:24:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 13 March 2008 09:24:57 GMT