Editing table cell with a PopupComponent

I am attempting to replace comboboxes used as components in table cells with popup components. This is in order to get zippier scrolling when the table is editable (table has a couple hundred rows, 14 columns, and 4 comboboxes/selects per line that are the main apparent cause of sluggishness).

I have a cell generator that creates the PopupComponent as follows

	    groupSelect.setPropertyDataSource(prop);
	    final PopupView popup = new PopupView(groupItemDisplayString(prop.getValue()), 
                    groupSelect);

where prop is the Property I want to change (the table cell content). My problem is that upon closing the popup the clickable link is not refreshed. It does not matter whether “prop” is the property from the table item or the underlying data source property. I have tried attaching a listener to “popup”, in the hope of explicitly setting the clickable link value, but the only method exposed is setCaption(), and that does not trigger a change in the displayed link. Getting out of editable mode and back in (obviously) shows the updated values for the PopupComponent labels.

Am I missing something obvious ?

Hi,

PopupView is a tricky bugger, if I recall correctly you’ll have to use the PopupView(PopupView.Content content) -constructor and setContent(PopupView.Content newContent) to change the contents properly in many cases.

…just as a quick hint w/o looking too closely at your problem…

Best Regards,
Marc

Thanks to your hint and a bit of Read the Fine Source, I got this to work. Because table performance is an issue, I would suggest adding a bit on PopupView in the Book. Working code snippet from my column generator follows.

	    groupSelect.setPropertyDataSource(prop);
	    final Select selector = groupSelect;
	    final PopupView popup = new PopupView(
	    		new PopupView.Content(){

					@Override
					public String getMinimizedValueAsHTML() {
						return groupItemDisplayString(prop.getValue());
					}

					@Override
					public Component getPopupComponent() {
						return selector;
					}
	    		});

Yeah, that’s a good idea, I’ll poke Marko. Also, feel free to comment if you have opinions about the API after having tried it…

Best Regards,
Marc