FoxInCloud
Showing an html page in a container
Gravatar is a globally recognized avatar based on your email address. Showing an html page in a container
  Michele
  thn@foxincloud.com
  Sep 16, 2014 @ 03:01am
I have a form where in one page of a pageframe i have a container. In it i have to show an html page. Normally i use in wcHTMLgen this code:

This.wcHTML = textmerge([<iframe src="] + [Maps/Mappa1.Html] + [" width="] + Str(This.Width,4) + [" height="] + Str(This.Height,4) + ["></iframe>])

The problem is that the page i show continue to change because i generate a temporary html every time i select the page with different data in it (normally a google map). I try to set every time the wcHTML property of the container to the new page, but it is non refreshed....and only the first is shown....what did i miss ?

Gravatar is a globally recognized avatar based on your email address. Re: Showing an html page in a container
  FoxInCloud Support - Thierry N.
  Michele
  Sep 16, 2014 @ 03:27am
If you know when the HTML contents change, you can add a javaScript order to refresh the iframe:
local oAJAX as awAJAX of awServer.prg
if wlAJAX(@m.oAJAX)
m.oAJAX.cScriptJSadd(textmerge([jQuery(#'<<this.wcID>>').find('iframe').attr('src', jQuery(#'<<this.wcID>>').find('iframe').attr('src'));])) && reassigning src should reload the HTML (to be tested)
endif

In the HTML content can change 'randomly', you may add to the generated HTML:
<meta http-equiv="refresh" content="99">
this will refresh the page every 99 seconds


I have a form where in one page of a pageframe i have a container. In it i have to show an html page. Normally i use in wcHTMLgen this code:

This.wcHTML = textmerge([<iframe src="] + [Maps/Mappa1.Html] + [" width="] + Str(This.Width,4) + [" height="] + Str(This.Height,4) + ["></iframe>])

The problem is that the page i show continue to change because i generate a temporary html every time i select the page with different data in it (normally a google map). I try to set every time the wcHTML property of the container to the new page, but it is non refreshed....and only the first is shown....what did i miss ?


-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Showing an html page in a container
  Michele
  Thierry Nivelet (FoxInCloud)
  Sep 16, 2014 @ 06:54am
I can't do it....I try to better explain what i need.

To show a google map i have to take an html file containing some java code, modify it to adapt to data i want to show, save in another local html file with random name and show it. I have to show different files for every user.
I have created a form class where i receive as parameter the html file i need to show, but i don't know where to put the code (and also which code) to show this html file...

Can you help me ? In my destination form i have the main form, and a container (called cntWeb). In the form's Init() i receive the parameters and if i put in wchtmlgen of the container the code:

This.wcHTML = textmerge([<iframe src="] + [Maps/Mappa5.Html] + [" width="] + Str(This.Width,4) + [" height="] + Str(This.Height,4) + ["></iframe>])

I can show the map defined in MAppa5.Html, but i can't use a fixed file, because all other users will show the same map...i need to use a temporary html every time...

Thanks



If you know when the HTML contents change, you can add a javaScript order to refresh the iframe:
local oAJAX as awAJAX of awServer.prg
if wlAJAX(@m.oAJAX)
m.oAJAX.cScriptJSadd(textmerge([jQuery(#'').find('iframe').attr('src', jQuery(#'').find('iframe').attr('src'));])) && reassigning src should reload the HTML (to be tested)
endif

In the HTML content can change 'randomly', you may add to the generated HTML:
<meta http-equiv="refresh" content="99">
this will refresh the page every 99 seconds


I have a form where in one page of a pageframe i have a container. In it i have to show an html page. Normally i use in wcHTMLgen this code:

This.wcHTML = textmerge([<iframe src="] + [Maps/Mappa1.Html] + [" width="] + Str(This.Width,4) + [" height="] + Str(This.Height,4) + ["></iframe>])

The problem is that the page i show continue to change because i generate a temporary html every time i select the page with different data in it (normally a google map). I try to set every time the wcHTML property of the container to the new page, but it is non refreshed....and only the first is shown....what did i miss ?


Gravatar is a globally recognized avatar based on your email address. Re: Showing an html page in a container
  FoxInCloud Support - Thierry N.
  Michele
  Sep 16, 2014 @ 10:00am
this.wcHTML is used only once, when form HTML is generated.

That is why I suggest you try to add the update javaScript code as I suggested in form.init(), after pcount() > 0:

* form.init()
lpara ...
if pcount() > 0
...
local oAJAX
if wlAJAX(@m.oAJAX)
m.oAJAX.cScriptJSadd(text([jQuery('#<%this.cntWeb.wcID%>') ...])) && please see the code I suggested earlier, replace '<%' by double '<'
endif
...
endif



I can't do it....I try to better explain what i need.

To show a google map i have to take an html file containing some java code, modify it to adapt to data i want to show, save in another local html file with random name and show it. I have to show different files for every user.
I have created a form class where i receive as parameter the html file i need to show, but i don't know where to put the code (and also which code) to show this html file...

Can you help me ? In my destination form i have the main form, and a container (called cntWeb). In the form's Init() i receive the parameters and if i put in wchtmlgen of the container the code:

This.wcHTML = textmerge([<iframe src="] + [Maps/Mappa5.Html] + [" width="] + Str(This.Width,4) + [" height="] + Str(This.Height,4) + ["></iframe>])

I can show the map defined in MAppa5.Html, but i can't use a fixed file, because all other users will show the same map...i need to use a temporary html every time...

Thanks



If you know when the HTML contents change, you can add a javaScript order to refresh the iframe:
local oAJAX as awAJAX of awServer.prg
if wlAJAX(@m.oAJAX)
m.oAJAX.cScriptJSadd(textmerge([jQuery(#'').find('iframe').attr('src', jQuery(#'').find('iframe').attr('src'));])) && reassigning src should reload the HTML (to be tested)
endif

In the HTML content can change 'randomly', you may add to the generated HTML:
<meta http-equiv="refresh" content="99">
this will refresh the page every 99 seconds


I have a form where in one page of a pageframe i have a container. In it i have to show an html page. Normally i use in wcHTMLgen this code:

This.wcHTML = textmerge([<iframe src="] + [Maps/Mappa1.Html] + [" width="] + Str(This.Width,4) + [" height="] + Str(This.Height,4) + ["></iframe>])

The problem is that the page i show continue to change because i generate a temporary html every time i select the page with different data in it (normally a google map). I try to set every time the wcHTML property of the container to the new page, but it is non refreshed....and only the first is shown....what did i miss ?




-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Showing an html page in a container
  FoxInCloud Support - Thierry N.
  Michele
  Sep 17, 2014 @ 04:25am
here is some more complete code
procedure formX.cntWeb.wcHTMLgen
lparameters toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML && {en} awHTMLgen instance {fr} instance de awHTMLgen && [.F.] {en} render container's inner HTML {fr} Rendre l'intérieur du conteneur
This.wcHTML = textmerge([<iframe id="<<this.wcID>>" src="" style="width:<<this.Width>>px;height:<<this.Height>>px;"></iframe>])
&& id= && assign this.wcID as ID so that we can easily retrieve this element with JavaScript later on<
&& style= && width="..." and height="..." are deprecated - use style="..." instead

procedure formX.Init
lparameters cHTMLfile
if Pcount() > 0
...
local oAJAX as awAJAX of awServer.prg
if wlAJAX(@m.oAJAX)
m.oAJAX.cScriptjsAdd(Textmerge([$('<<this.cntWeb.wcID>>').src='Maps/<<m.cHTMLfile>>';]))
endif
...
endif


I can't do it....I try to better explain what i need.

To show a google map i have to take an html file containing some java code, modify it to adapt to data i want to show, save in another local html file with random name and show it. I have to show different files for every user.
I have created a form class where i receive as parameter the html file i need to show, but i don't know where to put the code (and also which code) to show this html file...

Can you help me ? In my destination form i have the main form, and a container (called cntWeb). In the form's Init() i receive the parameters and if i put in wchtmlgen of the container the code:

This.wcHTML = textmerge([<iframe src="] + [Maps/Mappa5.Html] + [" width="] + Str(This.Width,4) + [" height="] + Str(This.Height,4) + ["></iframe>])

I can show the map defined in MAppa5.Html, but i can't use a fixed file, because all other users will show the same map...i need to use a temporary html every time...

Thanks



If you know when the HTML contents change, you can add a javaScript order to refresh the iframe:
local oAJAX as awAJAX of awServer.prg
if wlAJAX(@m.oAJAX)
m.oAJAX.cScriptJSadd(textmerge([jQuery(#'').find('iframe').attr('src', jQuery(#'').find('iframe').attr('src'));])) && reassigning src should reload the HTML (to be tested)
endif

In the HTML content can change 'randomly', you may add to the generated HTML:
<meta http-equiv="refresh" content="99">
this will refresh the page every 99 seconds


I have a form where in one page of a pageframe i have a container. In it i have to show an html page. Normally i use in wcHTMLgen this code:

This.wcHTML = textmerge([<iframe src="] + [Maps/Mappa1.Html] + [" width="] + Str(This.Width,4) + [" height="] + Str(This.Height,4) + ["></iframe>])

The problem is that the page i show continue to change because i generate a temporary html every time i select the page with different data in it (normally a google map). I try to set every time the wcHTML property of the container to the new page, but it is non refreshed....and only the first is shown....what did i miss ?




-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Showing an html page in a container
  Michele
  Thierry Nivelet (FoxInCloud)
  Sep 17, 2014 @ 05:45am
Great !!!!! It works!



here is some more complete code
procedure formX.cntWeb.wcHTMLgen
lparameters toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML && {en} awHTMLgen instance {fr} instance de awHTMLgen && [.F.] {en} render container's inner HTML {fr} Rendre l'intérieur du conteneur
This.wcHTML = textmerge([<iframe id="" src="" style="width:px;height:px;"></iframe>])
&& id= && assign this.wcID as ID so that we can easily retrieve this element with JavaScript later on<
&& style= && width="..." and height="..." are deprecated - use style="..." instead

procedure formX.Init
lparameters cHTMLfile
if Pcount() > 0
...
local oAJAX as awAJAX of awServer.prg
if wlAJAX(@m.oAJAX)
m.oAJAX.cScriptjsAdd(Textmerge([$('').src='Maps/';]))
endif
...
endif


I can't do it....I try to better explain what i need.

To show a google map i have to take an html file containing some java code, modify it to adapt to data i want to show, save in another local html file with random name and show it. I have to show different files for every user.
I have created a form class where i receive as parameter the html file i need to show, but i don't know where to put the code (and also which code) to show this html file...

Can you help me ? In my destination form i have the main form, and a container (called cntWeb). In the form's Init() i receive the parameters and if i put in wchtmlgen of the container the code:

This.wcHTML = textmerge([<iframe src="] + [Maps/Mappa5.Html] + [" width="] + Str(This.Width,4) + [" height="] + Str(This.Height,4) + ["></iframe>])

I can show the map defined in MAppa5.Html, but i can't use a fixed file, because all other users will show the same map...i need to use a temporary html every time...

Thanks



If you know when the HTML contents change, you can add a javaScript order to refresh the iframe:
local oAJAX as awAJAX of awServer.prg
if wlAJAX(@m.oAJAX)
m.oAJAX.cScriptJSadd(textmerge([jQuery(#'').find('iframe').attr('src', jQuery(#'').find('iframe').attr('src'));])) && reassigning src should reload the HTML (to be tested)
endif

In the HTML content can change 'randomly', you may add to the generated HTML:
<meta http-equiv="refresh" content="99">
this will refresh the page every 99 seconds


I have a form where in one page of a pageframe i have a container. In it i have to show an html page. Normally i use in wcHTMLgen this code:

This.wcHTML = textmerge([<iframe src="] + [Maps/Mappa1.Html] + [" width="] + Str(This.Width,4) + [" height="] + Str(This.Height,4) + ["></iframe>])

The problem is that the page i show continue to change because i generate a temporary html every time i select the page with different data in it (normally a google map). I try to set every time the wcHTML property of the container to the new page, but it is non refreshed....and only the first is shown....what did i miss ?




© 1996-2024