Using IFrame with Vortex and Texis

Post Reply
barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Using IFrame with Vortex and Texis

Post by barry.marcus »

I'm trying to improve the display of data by an old app of ours, and I'm confused. Currently the app displays a single record from our DB by just dumping the data stored in each field onto the "surface" of the browser. The app loops through the fields of the SELECT query in turn, displaying first the name of the field and then the field content. It's pretty primitive! Records can be very large, and the user has to scroll the entire browser page up and down to see the various fields. I would like instead to put the content of each field inside of a scrollable iframe with only the field name on the "surface" of the browser, making it much more manageable for the user to look at different parts of the record at one time.

Here's the basic setup now... The app creates a "result" page with a list of hyperlinks. The href of each hyperlink looks basically like this:

href="$url/DisplayRecord.html?thisId=$id"

The PUBLIC function DisplayRecord retrieves the record whose id was passed to $thisId and more or less dumps the record to the screen as described above. (Some other stuff happens and some markup is applied to certain retrieved field values, based on previous user actions, but it's essentially a record dump.)

Here's what I tried so far: I created a PUBLIC function called IFrameDisplay to which I pass the text that would otherwise be dumped to the browser surface in DisplayRecord. In DisplayRecord where the field value is normally just printed, I have instead an iframe, like this:

<iframe src="$url/IFrameDisplay.html?thisData=$ret">

BTW, $ret is the output of a function called in DisplayRecord that adds markup, does some formatting of the field value, etc., before "dumping" it to the screen. This isn't working right. I think that something in the field data itself is being interpreted as HTML and messing up the rendering, but I'm not sure.

Anyway, it feels like I'm spinning my wheels on this. A nudge in the right direction would be appreciated.

As usual, thanks.
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

Using IFrame with Vortex and Texis

Post by Kai »

I wouldn't pass the actual data to display as a parameter to FrameDisplay; it's far too large, especially for a query string. Pass the record id like you do for DisplayRecord, and then add the name of the field to display, eg.:

<iframe src="$url/FrameDisplay.html?thisId=$id&thisField=Foo">

<FrameDisplay> could then "SELECT " $thisField " FROM myTable WHERE id = $id" (make *sure* you validate $thisField first), mark it up, etc. and display it.
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

Using IFrame with Vortex and Texis

Post by John »

NOTE: This does not work with IE

One other thing you could try, which may or may not work and will avoid lots of fetches for each field is:

<capture>
Print what goes in the IFRAME
</capture>
<fmt %U $ret><$idata=$ret>
<iframe src="data:text/html,$idata">

which will put the data inline in the page, but in an IFRAME. You may have issues of length there as well.
John Turnbull
Thunderstone Software
Post Reply