Dialog Box

Is there a way to programatically click the OK button on a dialog box instead of the user?

I am bringing in data from a db2 table into a dynamic table. The data comes in great, but will not format correctly until the dialog box is opened (the information will appear) and click on OK.

Any help is appreciated

Michele

Subject: RE: Dialog Box

Are you talking about a dialog box as in the @Dialogbox function, or some sort of system dialog? Can you provide more detail about what you’re doing and whether you have Designer access to the database in question? Why do you have to use a dialog to format the data correctly?

Subject: RE: Dialog Box

I am using Lotuscript that calls a run on agent to grab information from a db2 table. The information is appended in a dynamic table. The table is created using table walker. If the user wants to enter/edit information, he uses the dialog box. The information is then formatted in the dynamic table with numbering and spaces between entries.

Although the information from the db2 table comes in correctly, it does not format until the dialog box is opened and then closed by clicking on okay. I would like the user to avoid having to open and close the dialog box.

I tried the following code, but it didn’t work:

 flag = ws.DialogBox ( "dlgMEBObjectMF", True, True, True, True, False, False, "Edit MEBEL Object Ship Sheet")	

flag = True

Call ws.RefreshParentNote()

’ Call ws.ViewRefresh

Call Doc.Save(True, True)

Subject: RE: Dialog Box

I wonder that you didn’t think it was relevant to mention that you were using TableWalker in your original post. For others reading this thread, the tool is available here.

There’s a great deal of code in the dialogbox that reformats the data for display. The right way to make this work in your environment is not to open the dialog and click OK for the user, but to put that logic in a place where it can be used both in the dialog, and in the back end as you pull in information from the relational database – for instance, in a script library.

I’m not actually a big fan of the way TableWalker works, since it depends on guessing the amount of space required to display text and inserting line feeds at appropriate spots to make each row of data take up the same number of lines so it will not wrap and make the rows become misaligned. This doesn’t work if the data happens to contain an unusually high number of wide characters – the rows can become misaligned. I prefer using a real table, such as described in Betsy Thiede’s Dynamic Tables Article in The View (if you’re not a subscriber you can still download the article), with the addition of the Update rich text tip to redisplay the form without saving it. The TableWalker tool also contains code to use real tables, I believe, but it’s not the default.