Re: Programming forms in cadence
- From: Trevor Bowen <m27315@xxxxxxxxx>
- Date: Fri, 10 Aug 2007 18:13:47 -0500
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
.
- References:
- Programming forms in cadence
- From: Guenther Sohler
- Programming forms in cadence
- Prev by Date: inheriting the min of 2 parent parameters?
- Next by Date: Re: Programming forms in cadence
- Previous by thread: Re: Programming forms in cadence
- Next by thread: Re: Programming forms in cadence
- Index(es):
Relevant Pages
|