Dynamic CompositeCell

124 views
Skip to first unread message

Aoxiang Cui

unread,
Apr 25, 2012, 9:16:44 PM4/25/12
to google-we...@googlegroups.com
The title is too short, let me explain and simplify my situation.

Say, I have a dto which contains a list of Booleans. I need a column whose cell looks like below:

item_1  checkbox_1
item_2  checkbox_2
...
item_n  checkbox_n

If n is a fixed number, it is fine to use CompositeCell. The problem is we don't know the size of list and each cell can have different list size.
Is there any way to extend CompositeCell so as to make it support my situation. Or maybe I should write a new Cell?

Derek

unread,
Apr 27, 2012, 9:55:16 AM4/27/12
to Google Web Toolkit
I personally would just create a new cell, but I'd probably start with
CompositeCell for a starting point.

Alfredo Quiroga-Villamil

unread,
Apr 27, 2012, 10:09:52 AM4/27/12
to google-we...@googlegroups.com
If you have an "n" number of values that should be represented in one
single column, I would go for a tree. Its ability to expand nodes when
needed, gives the user a chance to have it expanded or collapsed. So
in your case the column would contain:

"Top Of Tree"
CheckBox 1
CheckBox 2
CheckBox 3
CheckBox n

Regards,

Alfredo
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/slhetcYlVBsJ.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-tool...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.



--
Alfredo Quiroga-Villamil

AOL/Yahoo/Gmail/MSN IM:  lawwton

Maik Riechert

unread,
Jun 24, 2013, 10:49:38 AM6/24/13
to google-we...@googlegroups.com
I have the same problem at the moment. I can't use a CellTree because I actually want this to be a column of a CellTable. And as CellTree is not a Cell itself, this is not possible as far as I see.

Is there any other way than going down to HTML and doing everything on my own?

What I want is a column where each cell contains a variable number of labelled Checkboxes (label through "text" attribute of the Checkbox widget).

Jens

unread,
Jun 24, 2013, 11:02:58 AM6/24/13
to google-we...@googlegroups.com

I have the same problem at the moment. I can't use a CellTree because I actually want this to be a column of a CellTable. And as CellTree is not a Cell itself, this is not possible as far as I see.

Is there any other way than going down to HTML and doing everything on my own?

What I want is a column where each cell contains a variable number of labelled Checkboxes (label through "text" attribute of the Checkbox widget).

You have to implement your own custom Cell for use in CellTable. Letting a cell render a dynamic list of checkboxes doesn't sound that hard to me.

GWT can't provide cells for every possible use case.

-- J.

Maik Riechert

unread,
Jun 24, 2013, 3:27:29 PM6/24/13
to google-we...@googlegroups.com
Jens wrote:
> You have to implement your own custom Cell for use in CellTable.
> Letting a cell render a dynamic list of checkboxes doesn't sound that
> hard to me.
>
> GWT can't provide cells for every possible use case.
Well, ok, I probably will do that for the checkboxes. But in my mind
this allows for nearly no reuse. If instead there would be something
like a CompositeCell where the number and type of child cells depend on
the row value, then this would be reusable in lots of cases. And
considering that this issue pops up quite some times on the internet I
guess it would be useful.

To be honest, I find creating custom Cells hard, because it feels low
level and also because Cells are completely different to use compared to
their counterpart widgets (e.g. Checkbox vs. CheckboxCell). That's why
I'm happy if there's something existing I can just use or plug together
(like the CompositeCell for fixed Cell number).

Do you think it would be hard to create a DynamicCompositeCell for
variable Cells? I don't have much experience with cells yet, only with
regular widgets, but I'd like to tackle that challenge if I get a little
help or advice.

Cheers
Maik
Reply all
Reply to author
Forward
0 new messages