Extension visibility [message #1860580] |
Fri, 18 August 2023 08:46 |
|
Hello
I would like to control the extension visibility from a field existing in other module.
I have a form containing a Smart field and a Tab Box
I created an extension for the tab Box that add a new Tab,
Now I would like to control the visibility of the new Tab based on the value on the field
I tried to make the Smart Field acting as a master field for the tab box but when try to get the value I have null
I get the value in the
public ExtensionFormDetailTabExtension(DetailsBox ownerForm) {
super(ownerForm);
ownerForm.getMasterValue();
}
how to get value of the Smart field inside the extension and also notify extension that smart field value changed.
Regards
Anis
|
|
|
Re: Extension visibility [message #1860899 is a reply to message #1860580] |
Thu, 07 September 2023 15:28 |
|
Hi Anis
You should not access other fields in the constructor. When a form is opened, there are two phases. In the first phase, instances of all form fields are created, e.g. their constructor is called, and all properties are set to their configured value (initConfig). Then, in the second phase, all instances are initialized (execInit) via a form field visitor.
I think in your case, you should hook into the second phase. In the extension, you can manually register a listener to the smart field, so you get informed when the value changes.
Regards,
Beat
|
|
|
Powered by
FUDForum. Page generated in 0.02610 seconds