This entry was posted on Monday, May 26th, 2008 at 4:06 pm and is filed under IBM Lotus Notes, Interface, LotusScript. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
BizzyBee’s BizzyThoughts
Think Outside The Hive - About Notes and Web
Possible workaround for uidoc.Refresh or uidoc.Save from an embedded view
I saw a post on IdeaJam asking for a solution to this problem.
The thing is: if you have an action button on top of an embedded view and this button tries to run code that refreshes or saves the uidoc (t.i. the document that has the embedded view on it), this will crash your client.
This is exactly the situation I was in: I needed a refresh or save in the containing document after pushing the button Add Checklist:

My client crashed everytime I tried to use a uidoc.Refresh or uidoc.Save. I first tried to put the button above the embedded view, that way the code ran ok, but the problem is: how do you explain this to the user? All action buttons are located above the embedded view, except for one? “Is this a joke?”, he will ask.
Then I tried to move all buttons outside the embedded view. New problems rised: my code didn’t work the same way, and I had to find new workarounds for this.
Then I put the button on a layer: you can’t see it in the screenshot, but the first button is actually in a layer floating on top of the embedded view. Here’s a screenshot of it in Designer:

However, this needs some tweaking if you want your user not to notice the difference with a real action button in an embedded view:
- Positioning: I use 2 layers: one layer (the container) with autopositioning, and a second (contained) layer with fixed positions (I had to go through some trial and error to position it right, but it’s doable). Also, I let a dummy action button (without any code behind it) to leave some open space for the button.
- Color and style: I matched the layer background color with the color of the actionbar. For the style for Action Bar - Button Options, I used Display border - Never. The layer button is actually a hotspot, which resembles most to this kind of action button. I also added the icon in the layer.
I won’t say this is the solution to all problems, but it might solve some of these embedded view/uidoc related issues.
Articles
Da Honey Pot
About me

May 26th, 2008 at 5:25 pm
Martin, glad you’re still kicking.
I usually solve this problem by ‘Sending an F9′. Works only in Windows, as I use the win API.
May 26th, 2008 at 7:07 pm
Thanks :-). Your suggestion is also a good one. I suppose you can also use it to send a CTRL-S. And indeed, a pitty it’s Windows only…
May 30th, 2008 at 11:18 am
Thanks for tip, but there is one big problem with these actions (if they are anywhere else than in the view), they cannot manipulate with documents selected in embedded view.
June 10th, 2008 at 9:33 pm
Hi Ondrej,
You should check out Nathan’s post: http://www.lotus911.com/nathan/escape.nsf/d6plinks/NTFN-6Z3R8C and Chris’s: http://interfacematters.com/2007/03/quick-tip-collapse-all-in-embedded-view.html - they use a trick (showing the view that is embedded in another frame of the frameset, and apparently, the unexpected behaviour seeems that it picks up the selections from the embedded view. Read their articles (I tried it myself, but I couldn’t get it to work, maybe I did something wrong there).
Regards,
Martin
June 11th, 2008 at 8:26 am
I had the same problem and resolved it by using Call wk.ViewRefresh.
HTH,
Nuh.
June 11th, 2008 at 6:43 pm
And no Notescrashes then? And it refreshes the document that has the embedded view on it? If this is true, it’s a very easy way to solve this issue! Thanks!
June 19th, 2008 at 8:32 pm
In my experience, the workspace.ViewRefresh does not refresh the document in which the view is embedded.