Hy,

I have 4 combo-boxes and each one has a RefreshableValueHolder.
If I change the value in one of them, I would like to automatically change contents of the others. I know I have to use the refresh() method of this class, but I cannot figure it out how.

for example I declared the holder like this:

new RefreshableValueHolder(new Closure() {
	public Object call( Object o )
	{
		return getElementsForCombo();
	}
}, true, true)

Please help me with an example!

Thanks in advance,
Ender

I got the solution myself.
I shall post it, so that anyone who encounters this problem, can find it here:

getFormModel().getDisplayValueModel("theNameOfComboThatChanges").addValueChangeListener(( DynamicComboBoxListModel ) comboThatChangesAutomatically.getModel());

So, in other words, you register another combo-box, that will change its values, as the listener for the primary combo that is changed by user. This principle can be used with other kind of interface items too.

Best regards,
Ender

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.