[EMF Forms] Dynamic Auto-Complete on a single details page [message #1794026] |
Wed, 22 August 2018 11:41  |
Eclipse User |
|
|
|
Hi Everyone,
I have a case, where the values of auto-complete proposals depend on another value in the same view. (I am extending the generic editor)
I could solve the problem by implementing following:
- in CommandStackListener, when the field is changed, upon which the autocomplete values depend, set a local field "jumpToAfterRendering" to the value of current selection
- set selection of the tree-master-detail to empty
tmd.setSelection(new StructuredSelection());
- implement the renderingFinished callback to the tree-master-detail
tmd.registerDetailPanelRenderingFinishedCallback(new DetailPanelRenderingFinishedCallback() {
@Override
public void renderingFinished(Object renderedObject) {
if (jumpToAfterRendering != null) {
tmd.setSelection(new StructuredSelection(jumpToAfterRendering));
jumpToAfterRendering = null;
}
}
});
This results in fresh rendering of the detail panel, with new call to the Autocomplete service.
Donwside is that there is a not-so-nice looking transition to empty selection and back.
Is there a more elegant way of implementing this?
Best regards
Nikola
P.S.
If I remember my recent analysis of the Autocomplete Control correctly, the values are calculated on rendering.
At that moment I thought, wouldn't it be possible to change the control in a way to make it call the autocomplete service when the values are required?
I will try to find time to look into it more closely, but maybe someone could point out a better solution, or disillusion me on this subject...
[Updated on: Thu, 23 August 2018 12:27] by Moderator
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.19096 seconds