How to move the focus off a form?

Hi Experts,

I'll try to explain the problem first.
Our database starts with a frameset, say Left and Right. In the Left frame, another Frameset is loaded with Frames LeftTop and LeftBottom. In LeftBottom, an outline with several views is shown to the user. When clicking an outline entry, the corresponding view is shown in the frame Right. When double-clicking a document, the document always opens in the Right frame (to be expected, isn't it ;-) Also, the F1-key for help is diverted to an application help file.

And now the LeftTop frame. We want to show a logo in that area. An end-user (application manager) should be able to set or change this logo without the use of the Domino Desiger. There are two approaches for this:
a. the user enters the logo in a document, and the application enters it into the Image Resources
b. the user enters it in a document, and the logo is displayed using a read-only form with a computed rich-text field.

For the first one, we'd need additional software, a no-go at the moment. The second one works, but... Sometimes the LeftTop frame gets the focus, so when a used types F1, he gets help in the logo form. I've been looking all over all properties, switched off everything that looks like setting the focus on the form, but I still can't succeed in getting the focus off or preventing the LeftTop-frame from getting the focus.

I even tried a hotspot around the logo, which works, but I can't find a call to give some other frame the focus. Trying in JavaScript proved no good, since[1].focus() gives an error message when there are only views on screen. Furthermore, focus() and blur() don't seem to work at all.

Big question: How to avoid getting the focus or how to set the focus to another frame?

I kind of know the answer ("sorry, no solution") so offering lots of points is more or less pointless. A direction of a solution will be awarded with the points mentioned.

Thnx for all your reactions!


Btw this question is also on Notes.Net under 
LVL 47
Sjef BosmanGroupware ConsultantAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I don't really see the issue. The only thing you are trying to do is prevent the help for the logo form from displaying.  Notes client obvisouly is giving you the default form help.  So, add a HelpRequest that does nothing.  Change the HelpRequest for that frm to:
or whatever else you want -- it will evaluate to a string that doesn't actually get used.

OK, well, what if you want the help to do something else... like activate whatever help would be appropriate for the main frame?  I think you could probably detect what is in that main frame, and just run the equivalent help.
FYI, R6 has more options to control focus.  Look at the main info tab for form properties.
Try specifying target for the logo frame as _blank or non-existent Frame name ?

JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Sjef BosmanGroupware ConsultantAuthor Commented:
Detect what's in the main frame? Thought of that too. Unfortunately, ws.currentdocument gives me the current form, i.e. the form with the logo, and not the real frame. I could do some ugly tricks with environment variables or profile documents here, but I do prefer the "proper" solution.

I also tried to keep the focus in the Right frame, using source.GotoTop, but this call can only be executed in Edit-mode. Darn!
You can walk the frame hierarchy to see if a particular field exists in the right frame, which would at least allow you to detect if a particular form was open in edit mode.
Sjef BosmanGroupware ConsultantAuthor Commented:
The implemented Object Model in JavaScript in the Notes Client is too limited for this purpose, at least, I cannot find anywhere in the documentation how to walk the frames in LotusScript. I'd expect (from a proper implementation if framesets in LotusScript) to find a NotesUIFrameSet object in the NotesUIWorkspace object, with the necessary NotesUIFrameSet arrays going down to NotesUIDocuments that are being displayed. But it isn't there. Something for Notes R7 or R8?

Anyway, there are no fields on the LogoForm or on the form displayed in the Right frame, since both elements are displayed read-only. I want my Help-key to be fully functional in read-mode too. By the way, the name-field in JS is not filled in, so there is no way to find out what's there.

Maybe I'll write some C++ code to add the resource to the design, although this would add an unwanted DLL and portability problems to the application installation. I think I'll have to go back to the standard approach, using a Page and a fixed Picture. One more nice feature down the drain...
Hmm, how about this.  Instead of opening the view, have it open another frameset called ViewContainer, which will contain a hidden frame and a visisble frame.  The visible frame contains the view.  The hidden frame contains a dummy form with a single field on it.  Now, your logo frame can detect that the view is open.

The view will target its parent frame, so that when a document opens, the hidden fummy form goes away.

I believe you can also autoframe a form, not sure if that would open teh autoframe if a frameset is already open. The autoframe for the form could use a different frameset with a hidden framw ith a different editable dummy form, so that you can now detect that a document is open.

Now, how do you actually do the detection?  Good question.  It would seem you might need to do the detection in JavaScript.  At the ver least, the onFocus event can use JavaScript, and place focus in the dummy form.  The dummy form help request should do the same thing as its visisble framemate's help request is supposed to do.
Sjef BosmanGroupware ConsultantAuthor Commented:

Tried to do the detection with my hobby horse, a NotesTimer, with detrimental effects: Notes6.5 crashes every 3 minutes with it. I knew using the timer was a pain in the butt, and that using the same object every time might result in some trouble, but I wasn't exactly prepared to see such a lot of crashes etc. I'll try to keep this question open for some time, but I get more and more convinced that there is no solution.

Sjef :(
>> I also tried to keep the focus in the Right frame, using source.GotoTop,
>> but this call can only be executed in Edit-mode. Darn!

Can you get away with having the form open in edit mode, but with no editable fields?
Sjef BosmanGroupware ConsultantAuthor Commented:
If I remember well, I tried that at the time. This isn't going to work, because I want the focus to be in the Right frame, but it is the frame with the document in a form. If the document is open for read, then there is no way to call GotoTop.

I more or less left this part of the project :( I absolutely fail to see how Notes does cursor handling an focusing.

Thanks for the input. I'm afraid this question could be open for a long, long time, so I'll be closing it one of these days.
Sjef BosmanGroupware ConsultantAuthor Commented:
Sjef BosmanGroupware ConsultantAuthor Commented:
Apparently there is no solution to the question: the focus cannot be moved programmatically. I'd love to split the points equally between the respondents, for their time and effort. I prefer a PAQ/Refund, though, it's the (politically) correct solution. The information could be valuable to someone else.

Sjef BosmanGroupware ConsultantAuthor Commented:
I understand. I've tried to weigh very carefully all the suggestions given. There is no good answer amongst them, not even a bad one, so splitting is no good. The unwanted situation is still there, I just hope users don't start asking questions. Giving everybody 20 points just for their assistance isn't done as far as I know, so the only thing left is to ask for a Refund.

Sjef :-|
Bob LearnedCommented:
I would ask for a refund.

Sjef BosmanGroupware ConsultantAuthor Commented:
I thought we already agreed on that? Sorry if I got things mixed up.

Please: PAQ/Refund?
PAQed, with points refunded (150)

Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.