Hi Tim and Kirk,

The SET PAGE CONTENT command did the trick.  

Thank you for the rapid replies.

David

-----Original Message-----
From: Kirk Brooks [mailto:lists.k...@gmail.com] 
Sent: March 13, 2018 9:00 AM
To: dgarr...@gmail.com; 4D iNug Technical <4d_tech@lists.4d.com>
Subject: Re: Loading a variable into Web Area

Hi David,
Tim's suggestion of using SET PAGE CONTENT is a good one. I've noticed it's not 
great if your page is using jquery or other resources loaded from a CDN or even 
other disk files. My guess is a web area loaded by SET PAGE CONTENT doesn't 
have any context to reference the disk files. Where would it look, for 
instance, for "./my.css"? The web server has a defined root but a web area 
doesn't unless it loads from disk. My best success has been when the page has 
all its resources in the html. Which can be a little limiting.

I use, and love, web areas. Several of the primary forms in a heavily used 
database rely on them. My approach is to collect the data to be displayed into 
arrays and then use PROCESS TAGS with html templates to build the actual html. 
In Resources is the folder with the html templates, support files (css, js, 
etc.) and a temp dir I write to. I give this file a name made up of the record 
id and table so the form 'knows' where and what to look for.

To deal with the html file saturation problem I added a method to start up to 
simply clear out the temp folder. It's rare for the temp folder to have more 
than a few dozen files and they are small.



On Mon, Mar 12, 2018 at 3:51 PM, David Garrard via 4D_Tech < 
4d_tech@lists.4d.com> wrote:

> I am trying to control the content displayed in a 4D Web Area on a 
> form and I am forced to use external HTML documents to do this along 
> with WA OPEN URL passing a file path.  This works fine, but means I 
> need to maintain 10's of thousands of external html files just to do 
> this.
>
>
>
> It seems to me that this would be a very common use case:   code some HTML
> into a text variable and then use  WA OPEN URL with a new capability 
> to pass a variable or field to this command.  Or perhaps a new command 
> WA OPEN TEXT.
>
>
>
> Is this something that others have able to work around more elegantly?
>
>
>
> Thanks,
>
> David
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************




--
Kirk Brooks
San Francisco, CA
=======================

*We go vote - they go home*


**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to