FormEditor.selectReveal() not working [message #1050596] |
Sat, 27 April 2013 08:28  |
Eclipse User |
|
|
|
Hi All,
I'm currently trying to use FormEditor.selectReveal(Object pageInput) on a multi-page FormEditor. It's currently working fine... as long as I've previously viewed the page that the pageInput is found on!
The problem is that the UI for the IFormPage is lazily loaded (great feature), but all the IFormParts (such as SectionParts) are added to the IManagedForm during that period of UI creation, because they all rely on being passed or creating their Sections etc in their constructors. Therefore, they're not registered when selectReveal(...) comes iterates through the IManagedForm's IFormParts.
Is there any way of registering the IFormParts with the IManagedForm before the pages are shown for the first time, without having to create all the pages up-front?
|
|
|
Re: FormEditor.selectReveal() not working [message #1421496 is a reply to message #1050596] |
Thu, 11 September 2014 08:45  |
Eclipse User |
|
|
|
Hi Ben,
Although it's been a (long) while since you asked, and I'm not sure my solution is perfect, here's what I did to overcome this issue:
I implemented selectReveal in my form. If form was previously activated I call super.selectReveal(). If not, I check if the input object is related to my model, and if it is I call setActivePage(getId()) to activate my form, and then call super.selectReveal().
@Override
public boolean selectReveal(Object object) {
if (getPartControl() == null) {
//Page not initialized
if (objectIsNotRelevantToPage()) {
return false;
}
getEditor().setActivePage(getId()); //Initializes Page
}
return super.selectReveal(object);
}
Hope this helps. I'll be happy to hear of any other solution that might be relevant.
|
|
|
Powered by
FUDForum. Page generated in 0.06608 seconds