[ALOY-883] Support proxy-like elements in Alloy widget/require child view-elements
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2014-01-20T21:48:08.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | XML |
Labels | alloy, children, require, views, widgets |
Reporter | Fokke Zandbergen |
Assignee | Shak Hossain |
Created | 2013-11-22T08:45:10.000+0000 |
Updated | 2014-01-21T05:21:48.000+0000 |
I might misunderstand this completely Fokke, so just taking a shot here. I get the impression you simply want an extra element to group other UI elements, but perhaps without adding an extra UI layer? If correct, then something like the example below might make sense. This Container is to behave like a basic View in many ways, except when rendering it, then it should: A) simply get out of the way and directly render its children, or B) if the widget didn't actually "do" anything with it, it's children should not be rendered at all
If I'm completely off here, please clarify ;-)
[~ronaldtreur] yes, you could do it like that as well, having just a single
<Container />
element for this purpose, but then at least another attribute thenid
should be used to name it, because that's exactly what I find non-descriptive about the referenced example in the Alloy repo. I'd rather name it through the tag name, because I think that is most clear.I agree that custom semantic tags would trump non-descriptive ones! Then by default these non-standard elements should not render, simply let the widget figure out what to do with it. If implementing custom tags proves difficult, then using a single new element (e.g. Container) with an id might prove a nice solution in the interim I guess? Support for both would nicely mimic HTML 5, which might be a good thing since this lowers the learning curve for a great many developers.
How would Alloy identify a tag as a container to be passed as a named argument to
children
versus being just another UI element it's supposed to render?There would be no other way then assuming it is when the tag is unknown and there's no
module
orns
attribute.[~fokke] there's no way to determine that the tag is "unknown". Alloy always defers to its default renderer, which is how it is able to automatically start using new Titanium APIs when they are introduced. Since this is essentially impossible in its current incarnation I'm going to close this for now. If an alternate solution arises that does not require arbitrary tags to be interpreted in a specific way, I'll re-open it.
Makes sense. I don't see a way that wouldn't be a terrible hack as well.