Giter Site home page Giter Site logo

Comments (3)

back2dos avatar back2dos commented on August 16, 2024

I'm making a bit of progress here, but I need to sort out how exactly children work in feathers. I've read up on containers and browsed the code a bit, so I have a few questions for @joshtynjala

  • Most components are not containers and so one should not add arbitrary children to them. Those that have a @defaultXmlProperty should have the "child markup" fed into that property, e.g. what you've attempted in the post linked above should ideally read as <FormItem text="User Name"><TextInput prompt="[email protected]"/></FormItem>, right?
  • Are "simple containers" the only components that can have arbitrary children?

I've also seen there are data containers, but I think for now they'll have to be treated like normal controls and a more ergonomic integration can still be done later.

from coconut.feathersui.

joshtynjala avatar joshtynjala commented on August 16, 2024

Those that have a @defaultXmlProperty should have the "child markup" fed into that property

Yeah, I added @defaultXmlProperty to define what property should be used to handle children of the XML element. It is intended for an MXML-like environment (I have a background in Adobe Flex, and I have previously offered MXML support in the Starling version of Feathers UI, so I eventually want to support the same in the Haxe version). However, I don't see why coconut.feathersui cannot make use of this metadata too.

I am also willing to add more metadata, specifically for coconut.feathersui. Please let me know if there's anything that I could expose that would help you.

Most components are not containers and so one should not add arbitrary children to them.
Are "simple containers" the only components that can have arbitrary children?

Correct. Most Feathers UI components should not have arbitrary children added to them. LayoutGroup, ScrollContainer, and their subclasses (such as Panel) can be treated as having arbitrary children.

I also recently added HDividedBox and VDividedBox too. I don't think I've added those to the "simple containers" section of the docs yet.

e.g. what you've attempted in the post linked above should ideally read as , right?

Yes, this would be even better than what I originally posted. If you can detect that the property is of type DisplayObject (or a subclass of DisplayObject), and enforce only one child in the markup, that would be pretty cool.

from coconut.feathersui.

joshtynjala avatar joshtynjala commented on August 16, 2024

Also, I just want to say thank you for looking into this!

from coconut.feathersui.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.