I’ve felt that way on occasion too. What we did was create view beads for SWF 
and not JS in some cases because the createElement function was enough. Not 
sure what to do in these cases. 

Peter 


> On Dec 7, 2017, at 5:52 AM, Piotr Zarzycki <[email protected]> wrote:
> 
> Hi Harbs,
> 
> I would also place the logic which changes the image into the View bead. If
> I correct understand your thoughts. I think if it is possible it would be
> great reuse ImageButton in somehow, cause actually it is doing for one
> state what you want.
> 
> It is the matter of handling states in the view.
> 
> Thanks, Piotr
> 
> 
> 2017-12-07 11:46 GMT+01:00 Harbs <[email protected]>:
> 
>> I need a toggle button which displays images (i.e. ImageToggleButton).
>> 
>> Right now, the way ImageButton works is that the main component modifies
>> the element to show an image. This works only if you want a single image no
>> matter what the state of the button is. If you want different images on
>> hover, active, selected, etc. that requires a separate component.
>> Additionally, I wanted a button in an app which uses images for states. I
>> ended up just using a plain old div and setting the background image via
>> css for the different states. Adding components for each and every use case
>> seems broken.
>> 
>> Ideally, with Royale architecture, the component should really be much
>> more about the behavior of the component and the view should be delegated
>> to a bead.
>> 
>> I’m thinking that the logic which sets the html of the element should be a
>> a view bead. Any thoughts about reworking this?
>> 
>> Harbs
> 
> 
> 
> 
> -- 
> 
> Piotr Zarzycki
> 
> Patreon: 
> *https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Cpent%40adobe.com%7C71c36e4bf8a741aec75108d53d608a2e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636482407203235193&sdata=NJ8ww%2BNnW%2Fd7RWIp%2BQ7p07QBNmvJgiwxIJgyzv5IuPE%3D&reserved=0
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Cpent%40adobe.com%7C71c36e4bf8a741aec75108d53d608a2e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636482407203235193&sdata=NJ8ww%2BNnW%2Fd7RWIp%2BQ7p07QBNmvJgiwxIJgyzv5IuPE%3D&reserved=0>*

Reply via email to