Titanium JIRA Archive
Alloy (ALOY)

[ALOY-80] Establish Ti.UI.iPad.SplitWindow markup syntax

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-19T11:52:03.000+0000
Affected Version/s2012 Sprint 14
Fix Version/s2012 Sprint 14
ComponentsXML
Labelsn/a
ReporterTony Lukasavage
AssigneeTony Lukasavage
Created2012-06-27T12:26:23.000+0000
Updated2014-06-22T13:21:21.000+0000

Description

Description

Right now, the markup syntax for Ti.UI.iPad.SplitWindow assumes that it has 2 children, and that each is a Ti.UI.Window. It also assumes that the first window is the masterView and that the second is the detailView. While this convention over configuration may fit for this component, I wanted to throw out a few alternatives to see what others think.

Alternatives

Add custom attribute to child windows

<SplitWindow ns="Ti.UI.iPad">
    <Window split="master"/>
    <Window split="detail"/>
</SplitWindow>

Enforce IDs of master and detail (I don't like this one, but it's a possibility)

<SplitWindow ns="Ti.UI.iPad">
    <Window id="master"/>
    <Window id="detail"/>
</SplitWindow>

Check class for master and detail

<SplitWindow ns="Ti.UI.iPad">
    <Window class="master otherclass"/>
    <Window class="detail"/>
</SplitWindow>

Use an entirely new markup

<SplitWindow ns="Ti.UI.iPad">
    <Master>
        <!-- Implicitly creates a window, so you can put any markup in here ->
    </Master>
    <Detail></Detail>
</SplitWindow>

Thoughts?

I kinda like the entirely new markup, cause its clear what's going and you don't need to explicitly list the Window. Though perhaps it is overkill for a component that has a pretty specific configuration. Anyone else?

Comments

  1. Tony Lukasavage 2012-07-02

    We can revisit later if necessary
  2. Russell McMahon 2012-07-16

    I like the new markup. I sent the ticket to Rick for his feedback.
  3. Russell McMahon 2012-07-17

    Added on behalf of Rick Blalock... "I don't have much of an opinion on this. The only one I didn't like was the one where the window had an attribute called "split". All the other ones made enough sense to me and are basically the same from my POV. From an engineering POV there might be a downside to having it's own custom tag but I can't think of what that would be off the top of my head. I assume in examples #2 and #3 you could make the window wrap other markup too. Either way, most of those look good to me."
  4. Tony Lukasavage 2012-07-17

    FYI, this is currently implemented simply as the first window in the hierarchy being the master, the second is the detail.

JSON Source