Home » Eclipse Projects » Eclipse 4 » XWT + DataBinding + TableViewer Issue
XWT + DataBinding + TableViewer Issue [message #499376] |
Sat, 21 November 2009 15:32 |
Walter Mising name Messages: 128 Registered: July 2009 |
Senior Member |
|
|
Hi,
When using Databinding in XWT using an object ( Transaction.java ) I am
able to show the value of "price"
<Label text="Price:" />
<Label text="{Binding path=price}"/>
However, if I need to show the price in tableviewer
<TableViewer>
<TableViewer.columns>
<TableViewerColumn width="150" text="Price"
displayMemberPath="price" />
</TableViewer.columns>
<TableViewer.control.layoutData>
<GridData horizontalAlignment="FILL" verticalAlignment="FILL"
grabExcessVerticalSpace="true"
grabExcessHorizontalSpace="true" />
</TableViewer.control.layoutData>
</TableViewer>
The Data ( price ) is not rendered in the Table. Even the columns are not
shown.
I tried the following
1) XWT.load(parent, url, ( Transaction ) ( getT [ 0 ] ) ); => Shows up
correctly in Label but not in Table
2) XWT.load(parent, url, getT( ) ) ; => Doesnot show in Label ( correct
behaviour ? ) and does not show in Table
3) XWT.load(parent, url, getTinList ( ) ) ; => Here the object passed is a
List => similar behaviour as in 2).
I had tried even with
<TableViewer input="{Binding Path=transaction}">
Any help is much appreciated.
Thanks,
Best Regards,
Walter G. Prahakar.
|
|
|
Re: XWT + DataBinding + TableViewer Issue [message #499727 is a reply to message #499376] |
Mon, 23 November 2009 20:41 |
Yves YANG Messages: 688 Registered: July 2009 |
Senior Member |
|
|
Hi Walter,
It is about the "data context".
> <Label text="Price:" />
> <Label text="{Binding path=price}"/>
It expects the data context as an object (not a collection) with an
attribute "price".
As for TableViewer, it expects to have a collection to bind in ti "input".
In your code, the "input" specification is missing. If the data context is a
collection, you just need to indicate the input to use the data context like
this:
input="{Binding}"
If the data context of TableViewer is not a collection, you need to indicate
the collection viw path
input="{Binding path=orders}"
Regarding the table header, you need to add
<TableViewer.table headerVisible="true">
</TableViewer.table>
By defualt, it is false.
In general, I support you have a collection of Transaction. You want to
display the price when a transaction gets selected. It is the pure
Master/Detail presentation pattern. I suggest you llok at this example:
org.eclipse.e4.xwt.tests.jface.tableviewer.master.detail/Tab leViewer_MasterDetail.xwt:
The code is attached here. You can more examples in e4 CVS.
Regards
Yves YANG
"Walter Prabhakar" <kwchess@gmail.com> wrote in message
news:he916r$np$1@build.eclipse.org...
> Hi,
>
> When using Databinding in XWT using an object ( Transaction.java ) I am
> able to show the value of "price"
> <Label text="Price:" />
> <Label text="{Binding path=price}"/>
>
> However, if I need to show the price in tableviewer
> <TableViewer>
> <TableViewer.columns>
> <TableViewerColumn width="150" text="Price"
> displayMemberPath="price" />
> </TableViewer.columns>
> <TableViewer.control.layoutData>
> <GridData horizontalAlignment="FILL" verticalAlignment="FILL"
> grabExcessVerticalSpace="true"
> grabExcessHorizontalSpace="true" />
> </TableViewer.control.layoutData>
> </TableViewer>
>
> The Data ( price ) is not rendered in the Table. Even the columns are
> not
> shown.
>
> I tried the following
> 1) XWT.load(parent, url, ( Transaction ) ( getT [ 0 ] ) ); => Shows up
> correctly in Label but not in Table
> 2) XWT.load(parent, url, getT( ) ) ; => Doesnot show in Label ( correct
> behaviour ? ) and does not show in Table
> 3) XWT.load(parent, url, getTinList ( ) ) ; => Here the object passed is
> a
> List => similar behaviour as in 2).
>
> I had tried even with
> <TableViewer input="{Binding Path=transaction}">
>
> Any help is much appreciated.
>
> Thanks,
> Best Regards,
> Walter G. Prahakar.
>
|
|
|
Re: XWT + DataBinding + TableViewer Issue [message #499728 is a reply to message #499727] |
Mon, 23 November 2009 20:44 |
Yves YANG Messages: 688 Registered: July 2009 |
Senior Member |
|
|
Sorry, somme correction of typo in my previous email
---
In general, I suppose you have a collection of Transaction. You want to
display the price when a transaction gets selected. It is a pure
Master/Detail presentation pattern. I suggest you look at this example:
org.eclipse.e4.xwt.tests.jface.tableviewer.master.detail/Tab leViewer_MasterDetail.xwt:
The code is attached here. You can find more examples in e4 CVS.
---
"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hees2r$r1j$1@build.eclipse.org...
> Hi Walter,
>
> It is about the "data context".
>
>> <Label text="Price:" />
>> <Label text="{Binding path=price}"/>
> It expects the data context as an object (not a collection) with an
> attribute "price".
>
> As for TableViewer, it expects to have a collection to bind in ti "input".
> In your code, the "input" specification is missing. If the data context is
> a collection, you just need to indicate the input to use the data context
> like this:
> input="{Binding}"
>
> If the data context of TableViewer is not a collection, you need to
> indicate the collection viw path
> input="{Binding path=orders}"
>
> Regarding the table header, you need to add
> <TableViewer.table headerVisible="true">
> </TableViewer.table>
>
> By defualt, it is false.
>
> In general, I support you have a collection of Transaction. You want to
> display the price when a transaction gets selected. It is the pure
> Master/Detail presentation pattern. I suggest you llok at this example:
> org.eclipse.e4.xwt.tests.jface.tableviewer.master.detail/Tab leViewer_MasterDetail.xwt:
> The code is attached here. You can more examples in e4 CVS.
>
> Regards
> Yves YANG
> "Walter Prabhakar" <kwchess@gmail.com> wrote in message
> news:he916r$np$1@build.eclipse.org...
>> Hi,
>>
>> When using Databinding in XWT using an object ( Transaction.java ) I am
>> able to show the value of "price"
>> <Label text="Price:" />
>> <Label text="{Binding path=price}"/>
>>
>> However, if I need to show the price in tableviewer
>> <TableViewer>
>> <TableViewer.columns>
>> <TableViewerColumn width="150" text="Price"
>> displayMemberPath="price" />
>> </TableViewer.columns>
>> <TableViewer.control.layoutData>
>> <GridData horizontalAlignment="FILL" verticalAlignment="FILL"
>> grabExcessVerticalSpace="true"
>> grabExcessHorizontalSpace="true" />
>> </TableViewer.control.layoutData>
>> </TableViewer>
>>
>> The Data ( price ) is not rendered in the Table. Even the columns are
>> not
>> shown.
>>
>> I tried the following
>> 1) XWT.load(parent, url, ( Transaction ) ( getT [ 0 ] ) ); => Shows up
>> correctly in Label but not in Table
>> 2) XWT.load(parent, url, getT( ) ) ; => Doesnot show in Label (
>> correct
>> behaviour ? ) and does not show in Table
>> 3) XWT.load(parent, url, getTinList ( ) ) ; => Here the object passed is
>> a
>> List => similar behaviour as in 2).
>>
>> I had tried even with
>> <TableViewer input="{Binding Path=transaction}">
>>
>> Any help is much appreciated.
>>
>> Thanks,
>> Best Regards,
>> Walter G. Prahakar.
>>
>
>
>
|
|
|
Re: XWT + DataBinding + TableViewer Issue [message #499868 is a reply to message #499727] |
Tue, 24 November 2009 12:44 |
Walter Mising name Messages: 128 Registered: July 2009 |
Senior Member |
|
|
Thanks Yves Yang. It works.
"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hees2r$r1j$1@build.eclipse.org...
> Hi Walter,
>
> It is about the "data context".
>
>> <Label text="Price:" />
>> <Label text="{Binding path=price}"/>
> It expects the data context as an object (not a collection) with an
> attribute "price".
>
> As for TableViewer, it expects to have a collection to bind in ti "input".
> In your code, the "input" specification is missing. If the data context is
> a collection, you just need to indicate the input to use the data context
> like this:
> input="{Binding}"
>
> If the data context of TableViewer is not a collection, you need to
> indicate the collection viw path
> input="{Binding path=orders}"
>
> Regarding the table header, you need to add
> <TableViewer.table headerVisible="true">
> </TableViewer.table>
>
> By defualt, it is false.
>
> In general, I support you have a collection of Transaction. You want to
> display the price when a transaction gets selected. It is the pure
> Master/Detail presentation pattern. I suggest you llok at this example:
> org.eclipse.e4.xwt.tests.jface.tableviewer.master.detail/Tab leViewer_MasterDetail.xwt:
> The code is attached here. You can more examples in e4 CVS.
>
> Regards
> Yves YANG
> "Walter Prabhakar" <kwchess@gmail.com> wrote in message
> news:he916r$np$1@build.eclipse.org...
>> Hi,
>>
>> When using Databinding in XWT using an object ( Transaction.java ) I am
>> able to show the value of "price"
>> <Label text="Price:" />
>> <Label text="{Binding path=price}"/>
>>
>> However, if I need to show the price in tableviewer
>> <TableViewer>
>> <TableViewer.columns>
>> <TableViewerColumn width="150" text="Price"
>> displayMemberPath="price" />
>> </TableViewer.columns>
>> <TableViewer.control.layoutData>
>> <GridData horizontalAlignment="FILL" verticalAlignment="FILL"
>> grabExcessVerticalSpace="true"
>> grabExcessHorizontalSpace="true" />
>> </TableViewer.control.layoutData>
>> </TableViewer>
>>
>> The Data ( price ) is not rendered in the Table. Even the columns are
>> not
>> shown.
>>
>> I tried the following
>> 1) XWT.load(parent, url, ( Transaction ) ( getT [ 0 ] ) ); => Shows up
>> correctly in Label but not in Table
>> 2) XWT.load(parent, url, getT( ) ) ; => Doesnot show in Label (
>> correct
>> behaviour ? ) and does not show in Table
>> 3) XWT.load(parent, url, getTinList ( ) ) ; => Here the object passed is
>> a
>> List => similar behaviour as in 2).
>>
>> I had tried even with
>> <TableViewer input="{Binding Path=transaction}">
>>
>> Any help is much appreciated.
>>
>> Thanks,
>> Best Regards,
>> Walter G. Prahakar.
>>
>
>
>
|
|
| |
Re: XWT + DataBinding + TableViewer Issue [message #565036 is a reply to message #499376] |
Mon, 23 November 2009 20:41 |
Yves YANG Messages: 688 Registered: July 2009 |
Senior Member |
|
|
Hi Walter,
It is about the "data context".
> <Label text="Price:" />
> <Label text="{Binding path=price}"/>
It expects the data context as an object (not a collection) with an
attribute "price".
As for TableViewer, it expects to have a collection to bind in ti "input".
In your code, the "input" specification is missing. If the data context is a
collection, you just need to indicate the input to use the data context like
this:
input="{Binding}"
If the data context of TableViewer is not a collection, you need to indicate
the collection viw path
input="{Binding path=orders}"
Regarding the table header, you need to add
<TableViewer.table headerVisible="true">
</TableViewer.table>
By defualt, it is false.
In general, I support you have a collection of Transaction. You want to
display the price when a transaction gets selected. It is the pure
Master/Detail presentation pattern. I suggest you llok at this example:
org.eclipse.e4.xwt.tests.jface.tableviewer.master.detail/Tab leViewer_MasterDetail.xwt:
The code is attached here. You can more examples in e4 CVS.
Regards
Yves YANG
"Walter Prabhakar" <kwchess@gmail.com> wrote in message
news:he916r$np$1@build.eclipse.org...
> Hi,
>
> When using Databinding in XWT using an object ( Transaction.java ) I am
> able to show the value of "price"
> <Label text="Price:" />
> <Label text="{Binding path=price}"/>
>
> However, if I need to show the price in tableviewer
> <TableViewer>
> <TableViewer.columns>
> <TableViewerColumn width="150" text="Price"
> displayMemberPath="price" />
> </TableViewer.columns>
> <TableViewer.control.layoutData>
> <GridData horizontalAlignment="FILL" verticalAlignment="FILL"
> grabExcessVerticalSpace="true"
> grabExcessHorizontalSpace="true" />
> </TableViewer.control.layoutData>
> </TableViewer>
>
> The Data ( price ) is not rendered in the Table. Even the columns are
> not
> shown.
>
> I tried the following
> 1) XWT.load(parent, url, ( Transaction ) ( getT [ 0 ] ) ); => Shows up
> correctly in Label but not in Table
> 2) XWT.load(parent, url, getT( ) ) ; => Doesnot show in Label ( correct
> behaviour ? ) and does not show in Table
> 3) XWT.load(parent, url, getTinList ( ) ) ; => Here the object passed is
> a
> List => similar behaviour as in 2).
>
> I had tried even with
> <TableViewer input="{Binding Path=transaction}">
>
> Any help is much appreciated.
>
> Thanks,
> Best Regards,
> Walter G. Prahakar.
>
|
|
|
Re: XWT + DataBinding + TableViewer Issue [message #565063 is a reply to message #499727] |
Mon, 23 November 2009 20:44 |
Yves YANG Messages: 688 Registered: July 2009 |
Senior Member |
|
|
Sorry, somme correction of typo in my previous email
---
In general, I suppose you have a collection of Transaction. You want to
display the price when a transaction gets selected. It is a pure
Master/Detail presentation pattern. I suggest you look at this example:
org.eclipse.e4.xwt.tests.jface.tableviewer.master.detail/Tab leViewer_MasterDetail.xwt:
The code is attached here. You can find more examples in e4 CVS.
---
"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hees2r$r1j$1@build.eclipse.org...
> Hi Walter,
>
> It is about the "data context".
>
>> <Label text="Price:" />
>> <Label text="{Binding path=price}"/>
> It expects the data context as an object (not a collection) with an
> attribute "price".
>
> As for TableViewer, it expects to have a collection to bind in ti "input".
> In your code, the "input" specification is missing. If the data context is
> a collection, you just need to indicate the input to use the data context
> like this:
> input="{Binding}"
>
> If the data context of TableViewer is not a collection, you need to
> indicate the collection viw path
> input="{Binding path=orders}"
>
> Regarding the table header, you need to add
> <TableViewer.table headerVisible="true">
> </TableViewer.table>
>
> By defualt, it is false.
>
> In general, I support you have a collection of Transaction. You want to
> display the price when a transaction gets selected. It is the pure
> Master/Detail presentation pattern. I suggest you llok at this example:
> org.eclipse.e4.xwt.tests.jface.tableviewer.master.detail/Tab leViewer_MasterDetail.xwt:
> The code is attached here. You can more examples in e4 CVS.
>
> Regards
> Yves YANG
> "Walter Prabhakar" <kwchess@gmail.com> wrote in message
> news:he916r$np$1@build.eclipse.org...
>> Hi,
>>
>> When using Databinding in XWT using an object ( Transaction.java ) I am
>> able to show the value of "price"
>> <Label text="Price:" />
>> <Label text="{Binding path=price}"/>
>>
>> However, if I need to show the price in tableviewer
>> <TableViewer>
>> <TableViewer.columns>
>> <TableViewerColumn width="150" text="Price"
>> displayMemberPath="price" />
>> </TableViewer.columns>
>> <TableViewer.control.layoutData>
>> <GridData horizontalAlignment="FILL" verticalAlignment="FILL"
>> grabExcessVerticalSpace="true"
>> grabExcessHorizontalSpace="true" />
>> </TableViewer.control.layoutData>
>> </TableViewer>
>>
>> The Data ( price ) is not rendered in the Table. Even the columns are
>> not
>> shown.
>>
>> I tried the following
>> 1) XWT.load(parent, url, ( Transaction ) ( getT [ 0 ] ) ); => Shows up
>> correctly in Label but not in Table
>> 2) XWT.load(parent, url, getT( ) ) ; => Doesnot show in Label (
>> correct
>> behaviour ? ) and does not show in Table
>> 3) XWT.load(parent, url, getTinList ( ) ) ; => Here the object passed is
>> a
>> List => similar behaviour as in 2).
>>
>> I had tried even with
>> <TableViewer input="{Binding Path=transaction}">
>>
>> Any help is much appreciated.
>>
>> Thanks,
>> Best Regards,
>> Walter G. Prahakar.
>>
>
>
>
|
|
|
Re: XWT + DataBinding + TableViewer Issue [message #565117 is a reply to message #499727] |
Tue, 24 November 2009 12:44 |
Walter Mising name Messages: 128 Registered: July 2009 |
Senior Member |
|
|
Thanks Yves Yang. It works.
"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hees2r$r1j$1@build.eclipse.org...
> Hi Walter,
>
> It is about the "data context".
>
>> <Label text="Price:" />
>> <Label text="{Binding path=price}"/>
> It expects the data context as an object (not a collection) with an
> attribute "price".
>
> As for TableViewer, it expects to have a collection to bind in ti "input".
> In your code, the "input" specification is missing. If the data context is
> a collection, you just need to indicate the input to use the data context
> like this:
> input="{Binding}"
>
> If the data context of TableViewer is not a collection, you need to
> indicate the collection viw path
> input="{Binding path=orders}"
>
> Regarding the table header, you need to add
> <TableViewer.table headerVisible="true">
> </TableViewer.table>
>
> By defualt, it is false.
>
> In general, I support you have a collection of Transaction. You want to
> display the price when a transaction gets selected. It is the pure
> Master/Detail presentation pattern. I suggest you llok at this example:
> org.eclipse.e4.xwt.tests.jface.tableviewer.master.detail/Tab leViewer_MasterDetail.xwt:
> The code is attached here. You can more examples in e4 CVS.
>
> Regards
> Yves YANG
> "Walter Prabhakar" <kwchess@gmail.com> wrote in message
> news:he916r$np$1@build.eclipse.org...
>> Hi,
>>
>> When using Databinding in XWT using an object ( Transaction.java ) I am
>> able to show the value of "price"
>> <Label text="Price:" />
>> <Label text="{Binding path=price}"/>
>>
>> However, if I need to show the price in tableviewer
>> <TableViewer>
>> <TableViewer.columns>
>> <TableViewerColumn width="150" text="Price"
>> displayMemberPath="price" />
>> </TableViewer.columns>
>> <TableViewer.control.layoutData>
>> <GridData horizontalAlignment="FILL" verticalAlignment="FILL"
>> grabExcessVerticalSpace="true"
>> grabExcessHorizontalSpace="true" />
>> </TableViewer.control.layoutData>
>> </TableViewer>
>>
>> The Data ( price ) is not rendered in the Table. Even the columns are
>> not
>> shown.
>>
>> I tried the following
>> 1) XWT.load(parent, url, ( Transaction ) ( getT [ 0 ] ) ); => Shows up
>> correctly in Label but not in Table
>> 2) XWT.load(parent, url, getT( ) ) ; => Doesnot show in Label (
>> correct
>> behaviour ? ) and does not show in Table
>> 3) XWT.load(parent, url, getTinList ( ) ) ; => Here the object passed is
>> a
>> List => similar behaviour as in 2).
>>
>> I had tried even with
>> <TableViewer input="{Binding Path=transaction}">
>>
>> Any help is much appreciated.
>>
>> Thanks,
>> Best Regards,
>> Walter G. Prahakar.
>>
>
>
>
|
|
| |
Goto Forum:
Current Time: Thu Sep 26 20:51:35 GMT 2024
Powered by FUDForum. Page generated in 0.05128 seconds
|