Glamour Oddness with Tabs and Tables

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Glamour Oddness with Tabs and Tables

riverdusty
Hi All

Below is a simple example of my problem.
Unless I am missing something, shouldn't the second row of items have 'second' as their tab (title) names?

|browser aCollection aDictionary|
aCollection := OrderedCollection new add: 'one'; add: 'two'; add: 'three'; add: 'four'; yourself.
aDictionary := Dictionary new at: 'first' put: aCollection; at: 'second' put: aCollection copy; yourself.
browser := GLMTabulator new title: 'List Example'.
aDictionary keysAndValuesDo: [ :key :collection |
    browser row: [ :row |
        collection do: [ :string |
            row column: string asSymbol.
            browser transmit
                to: string asSymbol;
                andShow: [ :a |
                    a text
                        title: key;
                        display: string
                ]
        ]
    ]
].
browser openOn: aDictionary

--
Gareth Cox
IT Manager/Developer
Inspired Org (PTY) Ltd
email: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Glamour Oddness with Tabs and Tables

Nicolai Hess
This is a bit tricky if the entities have the same name (row column:'one'/'two' ... is called  two times, for every row ('first'/'second'))
This may work:

|browser aCollection aDictionary|
Transcript clear.
aCollection := OrderedCollection new add: 'one'; add: 'two'; add: 'three'; add: 'four'; yourself.
aDictionary := Dictionary new at: 'first' put: aCollection; at: 'second' put: aCollection; yourself.
browser := GLMTabulator new title: 'List Example'.
aDictionary keysAndValuesDo: [ :key :collection |
    browser row: [ :row |
        collection do: [ :string |
            row column: (string, key)  asSymbol.               "<<<<<-------changed"
            browser transmit
                to: (string, key) asSymbol;                          "<<<<<-------changed"
                andShow: [ :a |
                    a text
                        title: key;
                        display: string
                ]
        ]
    ]
].
browser openOn: aDictionary



2015-07-28 13:17 GMT+02:00 Gareth Cox <[hidden email]>:
Hi All

Below is a simple example of my problem.
Unless I am missing something, shouldn't the second row of items have 'second' as their tab (title) names?

|browser aCollection aDictionary|
aCollection := OrderedCollection new add: 'one'; add: 'two'; add: 'three'; add: 'four'; yourself.
aDictionary := Dictionary new at: 'first' put: aCollection; at: 'second' put: aCollection copy; yourself.
browser := GLMTabulator new title: 'List Example'.
aDictionary keysAndValuesDo: [ :key :collection |
    browser row: [ :row |
        collection do: [ :string |
            row column: string asSymbol.
            browser transmit
                to: string asSymbol;
                andShow: [ :a |
                    a text
                        title: key;
                        display: string
                ]
        ]
    ]
].
browser openOn: aDictionary

--
Gareth Cox
IT Manager/Developer
Inspired Org (PTY) Ltd
email: [hidden email]