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:

Embedded view

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:

Embedded view with button in layer 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.


1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

7 Responses to “Possible workaround for uidoc.Refresh or uidoc.Save from an embedded view”

  1. Gravatar Theo Heselmans says:

    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.

  2. Gravatar Martin Vereecken says:

    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…

  3. Gravatar Ondrej Kostruh says:

    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.

  4. Gravatar Martin Vereecken says:

    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

  5. Gravatar Noorul Huda says:

    I had the same problem and resolved it by using Call wk.ViewRefresh.

    HTH,
    Nuh.

  6. Gravatar Martin Vereecken says:

    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!

  7. Gravatar Keil Wilson says:

    In my experience, the workspace.ViewRefresh does not refresh the document in which the view is embedded.

Leave a Reply