pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bartlett <cbartlet...@googlemail.com>
Subject Re: Advice for a newbie
Date Thu, 24 Jun 2010 12:59:36 GMT
I think you can just change name attribute/property to match the getter in
GenesisEvent
so
<TableView.Column name="info" width="500" headerData="Header"/>
becomes
<TableView.Column name="message" width="500" headerData="Header"/>

http://svn.apache.org/repos/asf/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/tableviews/
http://svn.apache.org/repos/asf/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/tableviews/basic_table_view.bxml
http://svn.apache.org/repos/asf/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/tableviews/OlympicStanding.java

Chris

On Thu, Jun 24, 2010 at 7:43 PM, B.L. Zeebub <roger.varley@googlemail.com>wrote:

>
> Chris,
>
> Thanks for the response. I'd already started with the TableView. You say
> that I can use just a Pivot List for my datasource. I couldn't get it to
> work with a simple list unless my Pivot list was a list of maps. I've
> attached my wtkx file and the code I use to load it below. How do I modify
> it to use a simple list of strings?
>
> Regards
>
>
> To initialize the tableview;
>
>                messages = new ArrayList<Map<String,String>>();
>                TableView tv = (TableView) wtkxSerializer.get("tableView");
>                tv.setTableData(messages);
>
> to load it;
> public void notify(GenesisEvent event) {
>                HashMap<String,String> map = new HashMap<String,String>();
>                map.put("info",event.getMessage());
>                messages.add(map);
>
>        }
>
>
>
> <Window title="Genesis Client" maximized="true"
>            xmlns:wtkx="http://pivot.apache.org/wtkx"
>            xmlns="org.apache.pivot.wtk">
>        <content>
>        <Border styles="{color:10}">
>                    <content>
>                        <ScrollPane>
>                            <view>
>                                                        <TableView
> wtkx:id="tableView">
>                                    <columns>
>                                        <TableView.Column name="info"
> width="500"
> headerData="Header"/>
>                                    </columns>
>                                </TableView>
>                            </view>
>                        </ScrollPane>
>                    </content>
>                </Border>
>            </content>
>        </Window>
>
>
> --
> View this message in context:
> http://apache-pivot-users.399431.n3.nabble.com/Advice-for-a-newbie-tp919140p919398.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>

Mime
View raw message