[OpenAjaxGadgets] Request a widget mode

Howard Weingram weingram at tibco.com
Wed Apr 15 22:07:43 PDT 2009


Any reason why you are doing it this way rather than having phase 1 be the
constructor and phase 2 be onLoad?

Regards,
Howard


On 4/15/09 8:16 AM, "Rich Thompson" <richt2 at us.ibm.com> wrote:

> We are trying "oldMode" being undefined though may switch this to "view"
> if it causes problems for simpler widgets. The widget's content node
> exists, but is not spliced into the html dom until the modeChanged event
> is fired. This allows widgets that do not need the subtleties of the more
> advanced use cases to do all of their processing in onLoad (common use
> case for simpler widgets) with the container managing when the prepared
> dom tree is actually shown to the use, much as it might for a widget which
> is initially hidden. More advanced widgets can separate their
> initialization logic (onLoad) from their render logic (modeChanged) and
> achieve a better coordinated user experience.
> 
> Rich 
> 
> 
> 
> From:
> Howard Weingram <weingram at tibco.com>
> To:
> Jon Ferraiolo/Menlo Park/IBM at IBMUS
> Cc:
> "gadgets at openajax.org" <gadgets at openajax.org>, Rich
> Thompson/Watson/IBM at IBMUS
> Date:
> 04/14/2009 12:53 PM
> Subject:
> Re: [OpenAjaxGadgets] Request a widget mode
> 
> 
> 
> +1 to getMode().
> 
> Rich's suggestion needs more discussion before I can agree to it.
> Coordination of startup activities is a tricky area, and the approach that
> Rich proposes does not really resolve most of the issues. Also, it is not
> clear what the oldMode would be (the mode before the mode change).
> 
> Regards,
> Howard
> 
> 
> On 4/14/09 9:02 AM, "Jon Ferraiolo" <jferrai at us.ibm.com> wrote:
> 
>> 
>> I propose that this issue is considered resolved. If anyone objects,
> please
>> speak up.
>> 
>> Here is a summary of the resolution:
>> * We will add a getMode() API (which Howard has already added)
>> * At widget load time, the mashup applications must send an
> onModeChanged
>> event to notify the widget about its initial mode, following Rich's
>> processing model description (I put a red-colored reminder in the
> Widgets
>> API chapter about this)
>> 
>> Jon
>> 
>> 
>> 
>> 
>>              Howard Weingram
>>              <weingram at tibco.c
>>              om> To
>>              Sent by:                  Rich Thompson/Watson/IBM at IBMUS,
>>              gadgets-bounces at o         "gadgets at openajax.org"
>>              penajax.org               <gadgets at openajax.org>
>> cc
>> 
>>              04/13/2009 05:47 Subject
>>              PM                        Re: [OpenAjaxGadgets] Request a
>>                                        widget mode
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Hi Rich.
>> 
>> 
>> getMode()
>> 
>> I tentatively added getMode() to the API wiki page and the oawidget.js
>> JavaScript interface file in SVN. It simply makes sense.
>> 
>> 
> http://www.openajax.org/member/wiki/OpenAjax_Metadata_1.0_Specification_Widg
> 
>> 
>> et_APIs#OpenAjax.widget.WidgetAdapter.prototype.getMode
>> 
>> 
>> Startup Coordination
>> 
>> What mode are your widgets in before the modeChanged event?
>> 
>> Regards,
>> Howard
>> 
>> On 4/13/09 5:45 AM, "Rich Thompson" <richt2 at us.ibm.com> wrote:
>> 
>>> We have had a number of use cases come to light recently where the
>>> preferred user experience is achieved by the following loading
> sequence:
>>> 
>>> 1. onLoad -> informs the widget to initialize itself
>>> 2. any and all queued events are delivered to the widget (could have
> been
>>> sourced by the container or other widgets)
>>> 3. onModeChanged -> widget renders itself
>>> 
>>> This keeps the screen from going through a visual state where all of
> the
>>> widgets appear uncoordinated followed by an immediate shift into a
>>> coordinated state.
>>> 
>>> That is a bit of an aside (though related) to the original thread, but
> I
>>> would prefer a getMode() over having both the container and the widget
>>> remember the current mode.
>>> 
>>> Rich Thompson
>>> 
>>> 
>>> 
>>> 
>>> From:
>>> Howard Weingram <weingram at tibco.com>
>>> To:
>>> Jon Ferraiolo/Menlo Park/IBM at IBMUS
>>> Cc:
>>> "gadgets at openajax.org" <gadgets at openajax.org>
>>> Date:
>>> 04/10/2009 03:58 PM
>>> Subject:
>>> Re: [OpenAjaxGadgets] Request a widget mode
>>> 
>>> 
>>> 
>>> Hi, Jon.
>>> 
>>> Thanks for the comment.
>>> 
>>> There is no onModeChanged at the time of the widget constructor or at
> the
>>> time of onLoad, when the widget is first rendering. A mode change may
>>> occur
>>> later, but it may be much later.
>>> 
>>> Unless onLoad must always be followed immediately by modeChanged (which
>> is
>>> a
>>> poor approach), I'll add getMode().
>>> 
>>> Regards,
>>> Howard
>>> 
>>> 
>>> On 4/10/09 12:00 PM, "Jon Ferraiolo" <jferrai at us.ibm.com> wrote:
>>> 
>>>> 
>>>> I'm OK with adding getMode(), but I'll point out that a widget has
>>> enough
>>>> information now to figure out what mode it's in due to the
> onModeChanged
>>>> event. But it would be convenient to have getMode() so that the widget
>>>> wouldn't have to store away some sort of _mode private variable.
>>>> 
>>>> Jon
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>>              Howard Weingram
>>>>              <weingram at tibco.c
>>>>              om> To
>>>>                                        Howard Weingram
>>>>              04/10/2009 11:32          <weingram at tibco.com>, Jon
>>>>              AM                        Ferraiolo/Menlo Park/IBM at IBMUS
>>>> cc
>>>>                                        "gadgets at openajax.org"
>>>>                                        <gadgets at openajax.org>
>>>> Subject
>>>>                                        Re: [OpenAjaxGadgets] Request a
>>>>                                        widget mode
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> (Specifically because widget.xml allows the same content to be used
> for
>>>> multiple modes; so how does such a widget know its mode when 1st
>>> rendered?)
>>>> 
>>>> Regards,
>>>> Howard
>>>> 
>>>> 
>>>> On 4/10/09 9:42 AM, "Howard Weingram" <weingram at tibco.com> wrote:
>>>> 
>>>>> Do we need a function:
>>>>> 
>>>>>     getMode()
>>>>> 
>>>>> ?
>>>>> 
>>>>> Regards,
>>>>> Howard
>>>>> 
>>>>> 
>>>>> On 4/10/09 7:31 AM, "Jon Ferraiolo" <jferrai at us.ibm.com> wrote:
>>>>> 
>>>>>> 
>>>>>> +1
>>>>>> 
>>>>>> Jon
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>              Howard Weingram
>>>>>>              <weingram at tibco.c
>>>>>>              om>
>>>> To
>>>>>>              Sent by:                  "gadgets at openajax.org"
>>>>>>              gadgets-bounces at o         <gadgets at openajax.org>
>>>>>>              penajax.org
>>>> cc
>>>>>> 
>>>>>> 
>>>> Subject
>>>>>>              04/09/2009 06:31          [OpenAjaxGadgets] Request a
>>>> widget
>>>>>>              PM                        mode
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> I would like to add a function that allows a widget to request
>>>> transition
>>>>>> to
>>>>>> a different mode. The only indication of success would be a
>>> modeChanged
>>>>>> event delivered to the widget at some future time.
>>>>>> 
>>>>>>     /**
>>>>>>      * @param {String} newMode
>>>>>>      *      The name of the mode to which the widget is
>>>>>>      *      requesting transition
>>>>>>      */
>>>>>>     OpenAjax.widget.Adapter.prototype.requestMode(newMode) {}
>>>>>> 
>>>>>> 
>>>>>> Use Case
>>>>>> 
>>>>>> For example, a Help mode screen may contain a button that sends the
>>>> widget
>>>>>> back to View mode. This button is INSIDE the widget rather than
>>> outside
>>>> in
>>>>>> the container. This could simply transition the widget, but then any
>>>>>> container buttons would be out of sync because the container does
> not
>>>> know
>>>>>> about the change.
>>>>>> 
>>>>>> With the requestMode, the button would not actually switch modes; it
>>>> would
>>>>>> call requestMode('view') and this would tell the container to switch
>>> the
>>>>>> mode.
>>>>>> 
>>>>>> 
>>>>>> Compatibility with Other Standards
>>>>>> 
>>>>>> This behavior would be comparable to that of javax.portlet, which
>>>> specifies
>>>>>> that a portlet can "programmatically change [its] portlet mode when
>>>>>> processing an action request."
>>>>>> 
>>>>>> In other words, in the portlet world, there is a standard way for a
>>>> portlet
>>>>>> to request that the portlet container execute a mode change.
>>>>>> 
>>>>>> The portlet spec allows the portlet container to ignore or override
>>> the
>>>>>> mode-change request. It is only a request.
>>>>>> 
>>>>>> 
>>>>>> Regards,
>>>>>> Howard
>>>>>> 
>>>>>> --
>>>>>> Howard Weingram      650.846.1000
>>>>>> Principal Architect  TIBCO Software Inc.
>>>>>> 
>>>>>> TIBCO PageBus(TM) delivers ultra-lightweight
>>>>>> publish-subscribe messaging for mash-ups.
>>>>>> Learn more at http://www.pagebus.org
>>>>>> 
>>>>>> _______________________________________________
>>>>>> gadgets mailing list
>>>>>> gadgets at openajax.org
>>>>>> http://openajax.org/mailman/listinfo/gadgets
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Howard Weingram      650.846.1000
>>>>> Principal Architect  TIBCO Software Inc.
>>>>> 
>>>>> TIBCO PageBus(TM) delivers ultra-lightweight
>>>>> publish-subscribe messaging for mash-ups.
>>>>> Learn more at http://www.pagebus.org
>>>>> 
>>>>> _______________________________________________
>>>>> gadgets mailing list
>>>>> gadgets at openajax.org
>>>>> http://openajax.org/mailman/listinfo/gadgets
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Howard Weingram      650.846.1000
>>>> Principal Architect  TIBCO Software Inc.
>>>> 
>>>> TIBCO PageBus(TM) delivers ultra-lightweight
>>>> publish-subscribe messaging for mash-ups.
>>>> Learn more at http://www.pagebus.org
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Howard Weingram      650.846.1000
>>> Principal Architect  TIBCO Software Inc.
>>> 
>>> TIBCO PageBus(TM) delivers ultra-lightweight
>>> publish-subscribe messaging for mash-ups.
>>> Learn more at http://www.pagebus.org
>>> 
>>> _______________________________________________
>>> gadgets mailing list
>>> gadgets at openajax.org
>>> http://openajax.org/mailman/listinfo/gadgets
>>> 
>>> 
>>> _______________________________________________
>>> gadgets mailing list
>>> gadgets at openajax.org
>>> http://openajax.org/mailman/listinfo/gadgets
>> 
>> 
>> 
>> --
>> Howard Weingram      650.846.1000
>> Principal Architect  TIBCO Software Inc.
>> 
>> TIBCO PageBus(TM) delivers ultra-lightweight
>> publish-subscribe messaging for mash-ups.
>> Learn more at http://www.pagebus.org
>> 
>> _______________________________________________
>> gadgets mailing list
>> gadgets at openajax.org
>> http://openajax.org/mailman/listinfo/gadgets
> 
> 
> 
> --
> Howard Weingram      650.846.1000
> Principal Architect  TIBCO Software Inc.
> 
> TIBCO PageBus(TM) delivers ultra-lightweight
> publish-subscribe messaging for mash-ups.
> Learn more at http://www.pagebus.org
> 
> 
> 
> _______________________________________________
> gadgets mailing list
> gadgets at openajax.org
> http://openajax.org/mailman/listinfo/gadgets



--
Howard Weingram      650.846.1000
Principal Architect  TIBCO Software Inc.

TIBCO PageBus(TM) delivers ultra-lightweight
publish-subscribe messaging for mash-ups.
Learn more at http://www.pagebus.org



More information about the gadgets mailing list