Adding Controllers

0 views
Skip to first unread message

viatropos

unread,
Nov 15, 2008, 3:32:17 PM11/15/08
to OpenFlux
Hi,

Is there a way to add additional controllers to a component? Maybe by
adding a controllers array to the FluxComponent class, so you could do
something like:

<flux:Button label="Button Example" left="20" top="20">
<flux:view>
<flux:CheckBoxView />
</flux:view>
<flux:controllers>
<flux:CustomController selectable="true" />
<flux:AnotherController selectable="true" />
</flux:controllers>
</flux:Button>

Where CustomController and AnotherController would be added alongside
the ButtonController that comes with the Button by default.
Dynamically create ComplexControllers.

Freddie

unread,
Jan 8, 2009, 6:38:38 PM1/8/09
to OpenFlux
how about <flux:Button controller="{ new ComplexController([new
ButtonController(), new CustomController(), new AnotherController
()]) } ?

viatropos

unread,
Jan 9, 2009, 6:52:00 AM1/9/09
to OpenFlux
nice

Ryan Campbell

unread,
Jan 9, 2009, 1:08:14 PM1/9/09
to open...@googlegroups.com
Actually, thanks to the "capacitor" default property on the FluxComponent class you can set your controllers and views like this:

<flux:Button>
  <flux:ComplexController>
    <flux:ButtonController/>
    <CustomController/>
    <AnotherController/>
  </flux:ComplexController>
  <CustomButtonView/>
</flux:Button>

or, without using capacitor, as straight mxml:

<flux:Button>
  <flux:controller>
    <flux:ComplexController>
      <flux:ButtonController/>
      <CustomController/>
      <AnotherController/>
    </flux:ComplexController>
  </flux:controller>
  <flux:view>
    <CustomButtonView/>
  </flux:view>
</flux:Button>

Freddie

unread,
Jan 10, 2009, 7:04:18 PM1/10/09
to OpenFlux
also, what's the [DefaultProperty("variableName")] metadata tag mean?
I'm finding OpenFlux very interesting and powerful, though more
documentation and samples would be nice - I'll help with this when I
understand it myself. peace.

On Jan 9, 6:08 pm, "Ryan Campbell" <r...@safaricreative.com> wrote:
> Actually, thanks to the "capacitor" default property on the FluxComponent
> class you can set your controllers and views like this:
> <flux:Button>
>   <flux:ComplexController>
>     <flux:ButtonController/>
>     <CustomController/>
>     <AnotherController/>
>   </flux:ComplexController>
>   <CustomButtonView/>
> </flux:Button>
>
> or, without using capacitor, as straight mxml:
>
> <flux:Button>
>   <flux:controller>
>     <flux:ComplexController>
>       <flux:ButtonController/>
>       <CustomController/>
>       <AnotherController/>
>     </flux:ComplexController>
>   </flux:controller>
>   <flux:view>
>     <CustomButtonView/>
>   </flux:view>
> </flux:Button>
>

Freddie

unread,
Jan 10, 2009, 4:13:13 PM1/10/09
to OpenFlux
this is interesting, I never knew what capacitor did. however, looking
at the code, I'd have expected it would be possible to set Layout and
Factory of a List in a similar manner, but It doesn't seem to work,
could you explain please?

In general, how exactly to you set the component to use to render list
items? Just setting the view creates weird errors (see my other
post).

thanks!


On Jan 9, 6:08 pm, "Ryan Campbell" <r...@safaricreative.com> wrote:
> Actually, thanks to the "capacitor" default property on the FluxComponent
> class you can set your controllers and views like this:
> <flux:Button>
>   <flux:ComplexController>
>     <flux:ButtonController/>
>     <CustomController/>
>     <AnotherController/>
>   </flux:ComplexController>
>   <CustomButtonView/>
> </flux:Button>
>
> or, without using capacitor, as straight mxml:
>
> <flux:Button>
>   <flux:controller>
>     <flux:ComplexController>
>       <flux:ButtonController/>
>       <CustomController/>
>       <AnotherController/>
>     </flux:ComplexController>
>   </flux:controller>
>   <flux:view>
>     <CustomButtonView/>
>   </flux:view>
> </flux:Button>
>
Reply all
Reply to author
Forward
0 new messages