You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by ccp999 <cc...@hotmail.com> on 2012/09/12 11:22:31 UTC

Usage of TableViewCheckboxCellRenderer

Hi,

I followed Table View Tutorial and setup a java bean class as followed:

public class TagView {

Tag tag;
private Checkbox attachableCheckbox = null;

TagView(Tag tag) {
	this.tag = tag;
}
public Checkbox getAttachable() {
	attachableCheckbox = new Checkbox();
	attachableCheckbox.setSelected(tag.isAttachable());
}
}

and BXML file:
...
<TableView.Column name="Attachable" width="50" headerData="%isAttachable">
	<cellRenderer>
		<content:TableViewCheckboxCellRenderer />
	</cellRenderer>
</TableView.Column>
...

The checkbox does appear but all are unselected even for selected column.

What's wrong?

Brendan




--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Usage-of-TableViewCheckboxCellRenderer-tp4022108.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Usage of TableViewCheckboxCellRenderer

Posted by Roger and Beth Whitcomb <Ro...@rbwhitcomb.com>.
Hi Brendan,
     The Java bean class does not need a Checkbox in it -- it just needs 
to provide a data value for the renderer to use.  So, actually you don't 
even need your TagView class since the "Tag" object already has the 
correct bean method ("isAttachable()").  All you would need, then, is 
just to use a List<Tag> as the data for your TableView with the BXML you 
have already coded.  Although (and I haven't tried it to be sure) you 
might need to say name="attachable" (lower case).

~Roger Whitcomb

On 9/12/12 2:22 AM, ccp999 wrote:
> Hi,
>
> I followed Table View Tutorial and setup a java bean class as followed:
>
> public class TagView {
>
> Tag tag;
> private Checkbox attachableCheckbox = null;
>
> TagView(Tag tag) {
> 	this.tag = tag;
> }
> public Checkbox getAttachable() {
> 	attachableCheckbox = new Checkbox();
> 	attachableCheckbox.setSelected(tag.isAttachable());
> }
> }
>
> and BXML file:
> ...
> <TableView.Column name="Attachable" width="50" headerData="%isAttachable">
> 	<cellRenderer>
> 		<content:TableViewCheckboxCellRenderer />
> 	</cellRenderer>
> </TableView.Column>
> ...
>
> The checkbox does appear but all are unselected even for selected column.
>
> What's wrong?
>
> Brendan
>
>
>
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Usage-of-TableViewCheckboxCellRenderer-tp4022108.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>
>