Re: Programming forms in cadence



Guenther Sohler wrote:
I have been programming forms the last days.
This process is as follows, that the user fills in some fields and
presses "OK".
Then the callback is called and processes the input given.

The issue is following: if the user gives incorrect data, the callback
cannot execute correctly and has to quit. Thus the user has to start
the form again to reenter all the data.
How can this be prevented ?

if the callback detects invalid data, how can the user be sent back to the
already-filled-out form, correct it and try "OK" again ?


rds


From memory, FWIW: In the past, I have circumvented this problem by storing the form handle (the same one passed to hiDisplayForm and returned by hiCreateAppForm) in a global variable. In my form initialization program, I simply test to see if the global variable is defined and contains a valid form. If it does, then I do not recreate it. I simply display it again. Something like:

unless(boundp('myGlobalForm) &&
hiIsForm(myGlobalForm) &&
hiIsInstantiated(myGlobalForm) (or similar form sanity checks)

myGlobalForm = hiCreateAppForm(...)

)

hiDisplayForm(myGlobalForm)



The problem with this is that you can only have one version of the form displayed at any given time. Activating the form again (through menubar, bindkey, etc.), simply raises the already open form.


I believe you have to use a variant of gensym() for the formName and either randomize or localize the form handle being displayed to open multiple forms. Of course, you'll lose the current data.

In a former life, I wrote a form-template/save-state package. It's not too hard to write, and it's very powerful to have all your forms linked under a single interface, which can load and apply templates on a cell basis.

HTH

Trevor

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
---------------------------------------------------------- http://www.usenet.com
.



Relevant Pages

  • Re: error 3048 - Cannot open any more databases
    ... The combo that uses the callback function as its RowSourceType will still be able to display the desired data. ... What happens is that you load the static array one, and then it calls the callback function whenever it needs a value. ... I am using these combo boxes not only as a way of selecting a ... > the same subform, just inserted 48 times. ...
    (microsoft.public.access.formscoding)
  • Gui
    ... I created a very simple gui using GUIDE. ... All seems to work except the MyGUI_OutputFcn callback (is ... have some display commands that it sends to standard output), ... appears that the input variables to the callback don't exist anymore. ...
    (comp.soft-sys.matlab)
  • Re: how to create a Hierarchical data model in the ListBox
    ... under this I want to display a sub-list ... the windows Folders Explorer) and If I click item1.1, ... when you create a listbox, the Callback is the same for every item ...
    (comp.soft-sys.matlab)
  • Re: how to create a Hierarchical data model in the ListBox
    ... under this I want to display a sub-list ... the windows Folders Explorer) and If I click item1.1, ... when you create a listbox, the Callback is the same for every item ...
    (comp.soft-sys.matlab)
  • Re: Fixing time durations between events
    ... explicit argumentss. ... handle that the callback was generated for ... The second parameter, often referred to as evt, is either an empty ... for callbacks related to key presses.) ...
    (comp.soft-sys.matlab)