Lost Rich Text Images, The Solution
Here's a follow-up to my post from Monday about lost images in Rich Text fields. The solution was simple. Ironically (?) it was the client who suggested I try it. Sometimes working for a developer come manager can pay off! All that was needed was a simple doc.Save(). Somehow this cements the copied images in to the document.
Now, obviously, with the way I was doing this, saving the document causes problems. Because I was using a view's Form Formula the value of the Form field changes and saving the document means that anybody opening the document from a normal view will then see the print-friendly version. A different approach was needed.
Instead of using the view trick I created a Form that inherits values from the parent. The print-friendly link creates a new document that displays the content of all child documents. The link to the print version looks like this:
print?CreateDocument&ParentUNID=docidhere
The new Print form has a WQS agent that contains the same logic as the original WQO agent. The difference being that it now combines with the save event, which means the images display. The Print form also has a $$Return field on it which redirects the browser to the print-friendly document created.
The downside to this (there's always one isn't there) is that we have an unwanted document left over. Hence the need for an extra scheduled agent that removes them each night. However, I'd rather this than have to use anything involved iframes or DHTML hackery. This feels more solid and the client seems happy - even if this all meant I delivered two days late. Assuming I get the clients permission I may make an article of this one day.
I'm at my parents' house writing this on my dad's donkey of a PC with nothing but dial-up. I'm supposed to be down in the garage helping him make the shelves but I'm having a "break". In fact all I was doing was sitting on a stool - near the heater - trying to keep warm as I read this book (intermediate level content, but worth a read by us all).
The re-design will go live tomorrow all being well. I will probably tell http q
for the hour or so it's going to take me. Probably around 16:00 GMT. Don't be surprised if there's no connection to codestore.net. Should be worth the wait...
Jake,
I have a 'library' room in my place with shelves on two walls much like that picture. Although I did not build them myself, I did modify the back corner of each shelf to have a 1/2" hole for running speaker wire for the surround sound system. I then hide the wires with some small modified 1/4 round and the speakers are in place. You have the benefit of starting fresh to you may want to incorporate some sort of a run for cabling if required. Our shelves are stained pine and we also have a faux beam crossing the room with the same stain.
That's my shelf story.
Good luck,
Michael
Well, that makes a lot more sense. It seemed unlikely that the images wouldn't get copied over. Glad to hear you got it sorted.
Hi Jake...
Glad to see that you got your problem solved. As for the "iframes/DHTML hackery" that i posted, i'm sure it would have worked!.....
Just glad you mentioned my idea, no matter how much "hackery" it might have been!
Later
Patrick
P.S. Can't wait to see your new site!
A Domino app without any hackery. I can't wait to see it.
Jake, did you try to use the richtextitem.update() method (new method in R6.5) in the wqo-agent? It might save you the processing of unwanted print documents that comes with the wqs approach.
I think it will force an update on your new richtextitem (just as save() does) and should be called after all rti operatons...
IT WORKS!!! I'm always amazed at how effective simple solutions are. Now if I can only convince management that less is better a wonderful world it would be.
All men from the British Isles need a library, it is in your genes.
I went to a work working show a few months back a saw this guy {Link} He does by hand what machines costing hundreds if not thousands do. It real was an inspiration for me. So, signed up for several work working class - next one is on how to use hand planes. My fist project was to made a general workbench - did it all the joint cutting by hand with a saw, chisel, and plane. Not perfect, but nice for first try. Plus it was very relaxing.
My guess is that if you and your dad tackle the bookcase you will fine it very rewarding, not to mention that you will get to spent some quality time with the old man.
Good luck, and keep us posted.
Thanks Louis. I just gave this a go but it didn't solve the problem.
it works!