Hi,
I want to dynamically change the logo of the Main Screen. The image will change dynamically based on the application settings.
Images are saved as Filedescriptor in the BD.
I saw this post, but i can not to resolve my problem. Please, is there an easy step-by-step description about how to set the logo dynamically?.
in the MainScreen controller i have this code, but i don’t get show the image in the descriptor
Hi Natalia,
I saw the post, but I continue with the problem. I configured the logo, it is not affected by my code. Please, Can you tell me how can I do it correctly so that the logo changes dynamically?.
Hi Natalia,
Unfortunately it does not work. I got this error.
However these images are used in the company’s controller and it works. I can see them in the table of company data.
The code to display the logo in the company data table
@Subscribe
public void onInit(InitEvent event) {
empresasTable.addGeneratedColumn(“logo”,
this::LogoComponentImagen);
}
Hi Natalia,
I don’t mean what you mean by the view. In the controller, MainScreen.java I have a fileDescriptor that corresponds to the image. I configure logoImage which is an image component of the MainScreen.xml. The code MainScreen.java and main-screen.xml is above, in my previous post.
Thank you.
I think the problem is a image component. I think the possible solution is apply the component in a different way as this component is now. But the is how apply the component in the right way?.
Thanks
@albudarov
Hi Alexandre,
Please,Can you tell me if it is possible to dynamically change the logo of the MainMenu using a fileDescriptor, wich is the attribute of a table.
I use this code, but it doesn’t work
Hi Natalia,
I use this project about images, GitHub - cuba-guides/cuba-petclinic-working-with-images: CUBA Petclinic example: Working with Images
I need to get the image from the FileDescriptor in the MainScreen.java so that I can use this in the main-screen.xml
The question is how do I get the image from the FileDescriptor using the library
“com.haulmont.cuba.core.entity.FileDescriptor” ?. Please, note it doesn’t work
Where did you get the empresa object?
If you use a data container, check the view that you use on the loader - it should contain the logo attribute. If you load this object using DataManager / EntityManager extend the view, that you using for loading entity.