After upgrading to v2.3, I got an error message when I tried to open in-app notifications
by clicking on the bell icon.
I deleted the extended view I had for received-in-app-notifications-dialog.xml
After that I created the extended view new using the wizard.
It works fine without an error.
But, what ever I try now, I cannot change the view any more…
I wanted to add the body property to the grid.
Here is the xml code I use:
I cannot see what I do wrong…
KR
Roland
I cannot find any .jmix/conf directory.
As another test I zipped the project and opened it in another new project folder.
Also not working…
When I change the controller or descriptor,
hot deployment works.
But it looks like the extended views are not used.
in my main project, the conf dir does not exist.
In a new project it does and I can see the change .xml file for the ext-app-settings-entity-view I created.
But the changes are not reflected in the GUI.
Which means,
extending the view does not work like expected.
And like I wrote before, it worked in an older version (can not remember which one…)
I have tried to a create a custom view for received-in-app-notifications-dialog.xml using the instruction from docs and it works. Overridden view is shown in the application.
In the case of Override an existing view option, Jmix Studio creates:
View descriptor that extends received-in-app-notifications-dialog.xml descriptor
View controller class that is annotated @ViewController("ntf_ReceivedInAppNotificationsDialog") and extending view from the add-on:
@ViewController("ntf_ReceivedInAppNotificationsDialog")
@ViewDescriptor("ext-received-in-app-notifications-dialog.xml")
public class ExtReceivedInAppNotificationsDialog extends ReceivedInAppNotificationsDialog {
}
Do you have the same view controller class as described above?
attached my test project where I included also the notification addon.
I created the extended view using the wizard.
One difference I see is the view controller naming and view descriptor naming…
In my app it has leading ext_
attached the project…
I wanted to show the body column in the notification list …
@r.walde To use custom extended view instead of view provided by add-on, it is required to set the value in the @ViewController as in the base screen. In your sample project, the fix will be the following:
@Route(value = "test", layout = MainView.class)
@ViewController("ntf_ReceivedInAppNotificationsDialog") //remove the "ext" prefix
@ViewDescriptor("ext-received-in-app-notifications-dialog.xml")
public class ExtReceivedInAppNotificationsDialog extends ReceivedInAppNotificationsDialog {
}
mmhhh… sorry, I overread that part of the docu:
Note that the @ViewController annotation has the same value as in the base screen. This is important because we actually need to override the base screen, meaning that everywhere in the system the extended screen will be used instead of the base one, as is done for replaced entities.
You can override public and protected methods of the base controller to extend the screen logic if needed.
And,
I thought that the wizard will do it like needed and I didn’t challenged that
I did Extend because when doing the Override I get this error when opening the in-app notification:
ClassCastException: class com.schneebaer.view.receivedinappnotificationsdialog.ExtReceivedInAppNotificationsDialog cannot be cast to class io.jmix.notificationsflowui.view.receivedinappnotifications.ReceivedInAppNotificationsDialog (com.schneebaer.view.receivedinappnotificationsdialog.ExtReceivedInAppNotificationsDialog and io.jmix.notificationsflowui.view.receivedinappnotifications.ReceivedInAppNotificationsDialog are in unnamed module of loader ‘app’)
When using Extend and take out the leading ext_ it works fine.