[OpenAjaxIDE] [OpenAjaxGadgets] Widget constructors - property bag *not* passed

Jon Ferraiolo jferrai at us.ibm.com
Thu Aug 14 10:17:25 PDT 2008


Hi Rich,
No, that decision hasn't made it into the spec yet. Here is what I think we
need to do to the spec:

1) Remove the existing section on widget constructors and arguments found
at:

*
http://www.openajax.org/member/wiki/OpenAjax_Metadata_Specification_Widget_Metadata#Widget_properties_and_widget_constructor_arguments


2) Add a short new section on widget constructors that says the widget
constructor will be passed two parameters:

* Argument 1: A string holding the widget instance's JavaScript object name
(i.e., the value of __WID__)
* Argument 2: The widget wrapper object

To illustrate the above, assume that the metadata for a widget has
jsClass="MyWidgetClass". Then, the constructor would look something like
this:

function MyWidgetClass(id, wrapper) {
this.id = id;
this.wrapper = wrapper;
}

(If you don't specify jsClass, then there would be a default wrapper class
provided by the host environment.)

Then within the various functions for the "MyWidgetClass", you can invoke:

* this.wrapper.getPropertyValue(...)
* this.wrapper.setPropertyvalue(...)
* hubConnection = this.wrapper.getHubConnectionHandle()
* hubConnection.subscribe(...).
* hubConnection.publish(...).).

Correct?

Jon




                                                                           
             Rich                                                          
             Thompson/Watson/I                                             
             BM at IBMUS                                                   To 
             Sent by:                  gadgets at openajax.org,               
             gadgets-bounces at o         ide at openajax.org                    
             penajax.org                                                cc 
                                                                           
                                                                   Subject 
             08/14/2008 06:13          Re: [OpenAjaxGadgets] Widget        
             AM                        constructors - property bag  *not*  
                                       passed                              
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           





The last time I was involved in a discussion on this topic, the decision
was to pass the WidgetWrapper instead of the property bag since it provided
a superset and passing both would be redundant. Did this not make it all
the way to the spec write-up?

Rich

                                                                           
 From:   "Howard Weingram" <weingram at tibco.com>                            
                                                                           
 To:     Jon Ferraiolo/Menlo Park/IBM at IBMUS, <ide at openajax.org>,           
         <gadgets at openajax.org>                                            
                                                                           
 Date:   08/13/2008 09:48 PM                                               
                                                                           
 Subject Re: [OpenAjaxGadgets] Widget constructors - property bag *not*    
 :       passed                                                            
                                                                           






I am not sure about this, Jon.

The property bag being passed in could include properties
(such as local security callbacks) that are not intended for
external advertisement.

Could we please leave this in here for now? Thanks.

hw

From: gadgets-bounces at openajax.org [mailto:gadgets-bounces at openajax.org.]
On Behalf Of Jon Ferraiolo
Sent: Wednesday, August 13, 2008 1:07 PM.
To: ide at openajax.org; gadgets at openajax.org
Subject: [OpenAjaxGadgets] Widget constructors - property bag *not* passed


As we worked on the reference implementation, we discovered that there was
no need to pass a property bag to the widget constructor, as we have talked
about in the past. The widget can simply call
widgetwrapper.getPropertyValue() for any property values that it needs, and
can make the call to getPropertyValue() at the time when the widget needs
the information. Another approach to getting property values is to take
advantage of the @@foo@@ macro substitution feature by including something
like <javascript>var backgroundcolor='@@bgcolor@@';</javascript>

In our reference implementation, we maintain copies of property values on
both sides (i.e., one copy in the mashup editor and one copy in the widget
itself), so when a widget calls getPropertyValue(), there is negligible
performance impact. It seems likely that other implementations would use a
similar approach.

Does anyone see any problems with removing the preliminary section in the
spec (i.e., still has red-colored comments) that talks about passing the
property bag to the widget constructor? To me, this is a vestigial section
that no longer makes sense. Here is the section of the spec that I propose
to remove:

*
http://www.openajax.org/member/wiki/OpenAjax_Metadata_Specification_Widget_Metadata#Widget_properties_and_widget_constructor_arguments


If no one objects by the end of the week, I'll remove this section.

Jon



_______________________________________________
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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20080814/69bdde3a/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080814/69bdde3a/attachment-0003.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic08628.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080814/69bdde3a/attachment-0004.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080814/69bdde3a/attachment-0005.gif 


More information about the IDE mailing list