Displaying an value as an image in a TreeGrid without losing natural order

We have an Object that is displayed to the user as an image but has a natural sort. Using

treeGrid.addColumn(x -> convertValueToResource(x.getImageableValue()), new ImageRenderer()); displays the correct image but the grid won’t sort by x’s natural order.

I’ve extended TextRenderer to render other objects to their textual representation without losing their natural sort, e.g. BigDecimal, Date, etc., but, while TextRendered.encode will take an Object and let me format it into a JsonValue, ImageRender.encode takes a Resource. Extending ClickableRender blows everything up, perhaps due to missing client-side stuff?

So, in short, I want to:

treeGrid.addColumn(x -> x.getImageableValue(), new ValueToResourceRenderer()); Thoughts?

Thanks in advance.

PM me for the details but, in a nutshell, sub-ing TextRenderer is possible but sub-ing ClickableRenderer is not, even though it appears that the server → connector → state → client structure appears the same.

An Object → Resource → Image renderer should be part of baseline, IMHO.

ClickableRenderer is a widget renderer, which means that you need the client side implementation as well. There is number of examples in Grid Renderers Collection add-on in the Directory.