The skill below is used to create a simple form containing a string field with a modifyCallback.
Eveything goes fine writing in the string field, but when the callback generates an error (artificially reproduced typing "abc") the form is locked and "OK"/"Cancel" buttons can't be used anymore. Once this happens, even if the form is invoked again or it is set to 'unbound in the CIW, the issue persists.
Could someone be so kind and explain me why this wrong behaviour?
hiCreateStringField(?name 'myString ?prompt "->" ?modifyCallback
"matchCB" ?editable t) 10:10 200:20 100 ))
procedure(matchCB( @rest arg)
equal(stringItem "abc") then
%s \n" ) ;;;; ERROR
HERE, it locks the form
world %s \n" stringItem)
t ;any value is allowed in the string field
It looks like a bug. I'll create a service request and a CCR for this (I think I know which "Danilo P" you are).
In reply to Andrew Beckett:
any way to unbound via skill the form from the CIW when this happens? Something like test_form = nil.
Just not to close dfII and start again to un-lock the form
In reply to Danilo P:
hiFormDelete doesn't help, and setting it to 'unbound doesn't help. I also tried hiFormUnmap.
You could use a new symbol for the form each time (which is a bit inconvenient). For example:
procedure(testMyForm() let(() test_form=hiCreateAppForm( ?name gensym('test_form) ?formTitle "TEST" ?fields list( list(hiCreateStringField(?name 'myString ?prompt "->" ?modifyCallback "matchCB" ?editable t) 10:10 200:20 100 )) ?buttonLayout list( 'OKCancelDef) ?callback list( "printf(\"OK\")" "printf(\"CANCEL\")") ) hiDisplayForm('test_form)))
That way the global variable test_form contains a handle to the form, but it's stored in a unique symbol each time it is created.