You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Vicente de Rivera III <th...@gmail.com> on 2009/10/09 07:15:52 UTC

buttonData

how about reducing the declaration for buttons?
     <PushButton buttonData="{text:'clickme', icon:'@button.png'}" />

good pm everyone!

Re: buttonData

Posted by Greg Brown <gk...@mac.com>.
On the surface, this seems like a reasonable suggestion, but there are  
a few problems with it. The Button class would need to know that:

a) The string value in the attribute represents a JSON object
b) It should convert the value of the "icon" property to a URL
c) The URL in the "icon" property actually represents an image, and  
not the URL of some other arbitrary data

Button data is currently simply treated as an untyped Object that the  
renderer is responsible for knowing how to paint. Building this logic  
into Button would create a hard association between a button and its  
content, which we don't want.


On Oct 9, 2009, at 1:15 AM, Vicente de Rivera III wrote:

> how about reducing the declaration for buttons?
>
>      <PushButton buttonData="{text:'clickme', icon:'@button.png'}" />
>
> good pm everyone!