Load Logo Image from database in Mobile Outsystems
Question

Dear All Please Help

How do I change this login logo by retrieving it from the database?.

karena saat ini saya memanggilnya lewat css yang saya buat sperti capture di bawah



Champion
Solution

I change it from onReady to onRender


Hi Marcio,

What I got from the question, is he want to put on the style so not adding another component. But if he didn't have constraint on adding component, yes your idea is works.


Thanks

DemoLogo2.oml

Hello there!

I would recommend you to try use, but in this case for the login

https://www.outsystems.com/forums/discussion/72132/how-to-cache-app-logo-in-reactive-web-apps/#Post294223

Kind Regards,

Márcio

mvp_badge
MVP

Hi Hothorasman,

You missed quotes ('') sorrounding the background-image property url value, i.e.

background-image: url('/CloneActivitylog/img/CloneActivity.bg_clear.jpg');

See this sample screen Login Screen


I hope this helps you!


Kind regards,

Benjith Sam

Dear Benjith Sam,

thanks for checking, I mean c how do I retrieve those logs from the database? so that the user can easily replace it at any time

mvp_badge
MVP

Hi Hothorasman,

If your question is how to set background image from the database entity dynamically, then the solution was already given by Márcio in his first comment (which he deleted later)

Solution: Define a style attributes with background-image property on the div with style class 'login-screen', then map the respective entity URL attribute or variable as the property value as shown below.

If this is what you are looking for, then the solution credits go to @Márcio Carvalho 


I hope this helps you!


Kind regards,

Benjith Sam

Champion

Hi Hothorasman,


Benjith's solution will work.

Maybe additional information is variable "BackgroundImgUrl" is the url of your image, and not the binary data.

Also if you want to use bahasa, I can help.


NB : Put Benjith's answer as solution :D


Thanks

Dear Toto

Thank you for the help, I will try to apply the article link provided by Márcio Carvalho.

Do you have an example of how to retrieve the logo from the database?

Hi,

You can add this logo in web block and then you can drag there. That would be also work.

Kind Regards,

Ajit kurane.

Champion

Hi Hothorasman,


I just notice your problem, because the image is from database and if using style on properties, the image is still loaded when assigned to the style.

I have created a demo (see the attachment). Main screen (Upload) is for uploading the image, and the image will shown on the login screen.


Thanks

DemoLogo.oml

Dear Pak Toto

I've tried the oml attached, but it doesn't work, and I've uploaded the image file

Champion

Hi,


Sorry my mistake pak, I usually open on web version (and work) but it seems not working on mobile emulation

let me recheck

Hello there,

First, I think is not working, because what Toto did was just simply using the property background-image with binary data when you cannot do it like that because you are working with binary data and not links.

So what you have to do is use  the HTML element with tag img and put the src with the background coming from the database


Now you have a look


Try the module that I am sharing with that fix

Let me know if I could help you!

ps: you don't need javascript

Kind Regards,

Márcio Carvalho



logoImageBackgroundFromDatabase.oml

Champion
Solution

I change it from onReady to onRender


Hi Marcio,

What I got from the question, is he want to put on the style so not adding another component. But if he didn't have constraint on adding component, yes your idea is works.


Thanks

DemoLogo2.oml

I will keep in mind that in the future! It's a good thing to keep Nice!!! :)

Yours is better because you don't need to put another element inside of the screen. If there is not a constraint as you said. I will check your solution. 

PS: In this case, javascript is needed :D

Thank you very much!

Dear Toto,  and All

Dear Toto, Thank you for the support, I've tried it and it worked after the JavaScript moved to OnRender


Best & Regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.