#1 2016-02-02 01:28:40

datadon
Member
Registered: 2015-04-23
Posts: 108

Modify HTML Code

I am using html to display an image on my server in an app.

I want to make one of the folders in the image string a variable.  what would be the best way to do that? 

I would like to search and replace a /##Folder##/ variable in the html string, and then use a variable in the HTML property, but not sure how to do that.  If I use the search and replace, where should the html text be that is processed?

That might be one way to do it, is there another way?

Can I do a search and replace on the HtmlContent2.HTML for example?

Last edited by datadon (2016-02-02 01:30:32)

Offline

#2 2016-02-02 01:40:24

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,657
Website

Re: Modify HTML Code

Hello Donald,

The HtmlContent control is a bit special, since we can't access their HTML variable in runtime. In fact probably we can do it using Javascript, however, such variable is plained to used at designtime, commonly to put inside one or more variables. Then this variables are parsed in compile time and therefore become available at runtime.

Therefore, probably what you can do is to think about variables, because variables can be changed at runtime. Then, for example, if you shown an image in your HTMLContent control using a code similar to this:

<img ng-src="[MyImageUrl]" />

In the app's view Show event we can set the variable to this:

SetVar "[MyImageUrl]" "app/images/dog.jpg" "String"

And then, in every other place (a Push Button's Click event, for example) we can place another similar code:

SetVar "[MyImageUrl]" "app/images/pelican.jpg" "String"

Also, we can made the entire HTMLContent control a variable, that is, we can simply place inside something like "[MyVariable]", then we can change the content of that variable at runtime.

Hope this can help you in some manner Donald. smile

Online

#3 2016-02-02 11:00:57

edunt
Member
Registered: 2015-12-21
Posts: 258

Re: Modify HTML Code

Hi,
Will this logic work with audio file?

Offline

#4 2016-02-02 11:53:14

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,657
Website

Re: Modify HTML Code

Hello,

edunt wrote:

Hi,
Will this logic work with audio file?

Yes, edunt. In principle, the HTMLContent control can contains any HTML and app variables.

Online

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.